Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349798

Summary: [1.7][preferences][formatting] Line wrapping and indentation options for try with resources and multi-catch arguments
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Deepak Azad <deepakazad>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: amj87.iitr, deepakazad, jarthana, markus.kell.r, satyam.kandula
Version: 3.7Flags: markus.kell.r: review+
Target Milestone: 3.7.1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 349396, 350697    
Bug Blocks:    
Attachments:
Description Flags
fix none

Description Markus Keller CLA 2011-06-20 06:08:21 EDT
+++ This bug was initially created as a clone of Bug #349396 +++

BETA_JAVA7

UI for the new options from bug 349396.
Comment 1 Markus Keller CLA 2011-06-20 06:10:58 EDT
Deepak, can you please have a look? In the preview, please add 2 resources to the existing try statement.
Comment 2 Deepak Azad CLA 2011-06-28 10:08:06 EDT
Multi catch: UI for the new options from bug 349314.
Comment 3 Deepak Azad CLA 2011-06-28 10:08:39 EDT
*** Bug 350521 has been marked as a duplicate of this bug. ***
Comment 4 Deepak Azad CLA 2011-06-29 05:22:19 EDT
Created attachment 198806 [details]
fix

The preview on 'Line Wrapping' page is not coming correctly, I am not sure why. Markus can you please take a look.
Comment 5 Deepak Azad CLA 2011-06-29 06:09:36 EDT
- The same snippet for try with resources is formatted correctly on 'While space' page which uses SnippetPreview whereas 'Line wrapping' page uses CompilationUnitPreview
- JavaPreview.JavaPreview(Map<String, String>, Composite) has references to JavaCore.VERSION_1_5. I changed these to JavaCore.VERSION_1_7 but this did not change anything.
Comment 6 Markus Keller CLA 2011-06-29 08:40:27 EDT
Fix looks good with these corrections in WhiteSpaceOptions:

- createTryStatementTree(Map<String, String>, InnerNode):
FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_TRY should be at the end (options are sorted in declaration order)

- formatting of TRY_PREVIEW could be aligned with all the other snippets

Fix for bug 350697 resolved the problems with the preview formatting.
Comment 7 Deepak Azad CLA 2011-06-29 09:33:32 EDT
Committed to BETA_JAVA7 with the changes from comment 6.
Comment 8 Jay Arthanareeswaran CLA 2011-07-20 02:14:39 EDT
Verified.