Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349645 - [1.7][typing] Update the indenter for try with resources
Summary: [1.7][typing] Update the indenter for try with resources
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.7.1   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-17 01:50 EDT by Deepak Azad CLA
Modified: 2011-08-02 05:45 EDT (History)
3 users (show)

See Also:
daniel_megert: review+


Attachments
fix + test (4.35 KB, patch)
2011-06-17 05:21 EDT, Deepak Azad CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2011-06-17 01:50:34 EDT
Formatter has been updated for try with resources (see Bug 349008). Now Ctrl+I and Enter behave differently from the formatter and need to be updated.
------------------------------------------------------------------------
try (FileReader reader1 = new FileReader("file1");
					FileReader reader2 = new FileReader("file2");
					FileReader reader3 = new FileReader("file3");
					FileReader reader4 = new FileReader("file4");
					FileReader reader5 = new FileReader("file5")) {
				int ch;
				while ((ch = reader1.read()) != -1) {
					System.out.println(ch);
				}
			}
------------------------------------------------------------------------
Comment 1 Dani Megert CLA 2011-06-17 01:52:34 EDT
3.7.1 time permitting.
Comment 2 Deepak Azad CLA 2011-06-17 01:55:52 EDT
"FileReader reader2 = new FileReader("file2");" and subsequent resource
declarations are indented by 2 with respect to 'try' by the formatter, however
Ctrl+I does not indent them at all.
Comment 3 Deepak Azad CLA 2011-06-17 05:21:32 EDT
Created attachment 198169 [details]
fix + test
Comment 4 Deepak Azad CLA 2011-06-17 05:22:24 EDT
Dnai, the fix looks ok?
Comment 5 Dani Megert CLA 2011-06-21 11:59:27 EDT
The patch looks good. Please merge it with the patch from bug 348198 (this is also intended to go into 3.7.1 anyway) and commit both together into the beta branch.

Thanks.
Comment 6 Deepak Azad CLA 2011-06-22 01:04:17 EDT
Thanks for the review Dani! 

Committed to BETA_JAVA7.
Comment 7 Ayushman Jain CLA 2011-07-20 02:49:23 EDT
Verified using JDT feature patch v20110714-1300.