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

Bug 419909

Summary: comments are grouped together when Blank Lines > Number of empty lines to preserve is set to 0
Product: [Eclipse Project] JDT Reporter: Palmer Eldritch <the.ubik>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, mateusz.matela
Version: 4.3   
Target Milestone: 4.5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
formatting preferences none

Description Palmer Eldritch CLA 2013-10-19 12:18:07 EDT
Created attachment 236687 [details]
formatting preferences

One patch = 1000 words. On formatting :

 	private static volatile String uuid; // volatile needed - see EJ item 71
-	// need lazy initialization to get a context

+	// need lazy initialization to get a context
 	/**
 	 * javadoc omitted
 	 */
 	public static String getDeviceIdentifier(Context ctx,
 			boolean ignoreBuggyAndroidID) throws DeviceIDException {


As you see the formatter relates the comment to the next block of "declarations of the same kind". The formatter should detect there is a comment in the previous line and continue streaming the comment. This is an example of the line comments being "second line citizens" - see the blocked bug at https://bugs.eclipse.org/bugs/show_bug.cgi?id=396686.

I attach my formatting preferences

Thanks
Comment 1 Mateusz Matela CLA 2015-12-26 15:55:24 EST
This problem no longer occurs after the formatter redesign.

*** This bug has been marked as a duplicate of bug 303519 ***