| Summary: | [1.7][formatter] Line wrapping for multi-catch arguments | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Ayushman Jain <amj87.iitr> | ||||||
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | CC: | deepakazad, markus.kell.r, Olivier_Thomann, satyam.kandula | ||||||
| Version: | 3.7 | Flags: | Olivier_Thomann:
review+
|
||||||
| Target Milestone: | 3.7.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 198641 [details]
proposed fix v1.0 + regression tests
This patch adds just an aligment option for exceptions in a multi catch. The spacing before or after the '|' is decided by the option DefaultCodeFormatterOptions.insert_space_before_binary_operator and insert_space_after_binary_operator
By default the alignment is set to Wrap when necessary with Default indentation
Olivier, the patch is very similar to that in bug 349396. Can you review this as well? Thanks! (In reply to comment #1) > Created attachment 198641 [details] [diff] > proposed fix v1.0 + regression tests + final Object alignmentForUnionTypeInMulticatch = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH); + if (alignmentForResourcesInTry != null) { The 'if' tests the wrong variable here. Same comment as Markus. Otherwise it looks good. Created attachment 198704 [details]
proposed fix v1.1 + regression tests
Thanks Markus, Olivier
Released in BETA_JAVA7 branch Verified with v20110714-1300. |
BETA_JAVA7 In the below given test case, we currently have no option in the formatter to wrap exceptions inside a multi-catch. So the exceptions never get wrapped currently. It will be good to have such an option. class MultiCatch { void foo() { try { throw new FileNotFoundException(); } catch (FileNotFoundException | IOException | RuntimeException | ArrayIndexOutOfBoundsException | IllegalArgumentException ex) { } } }