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

Bug 434821

Summary: [formatter] Comment at end of line messes with indentation
Product: [Eclipse Project] JDT Reporter: Alex W <awang060843>
Component: CoreAssignee: Manoj N Palat <manoj.palat>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: manoj.palat
Version: 4.4   
Target Milestone: 4.5 M7   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
XML for formatting settings none

Description Alex W CLA 2014-05-14 04:20:18 EDT
Created attachment 243066 [details]
XML for formatting settings

Not sure if this is the right place...

Essentially, end-of-line comments seem to prevent proper indentation for try/catch blocks on my computer. Removing the comment makes the formatter work again. Putting it back breaks it. Eclipse 4.4 M7, build 20140508-1440. Attached is the XML for my formatting settings.

public class FormatterTest {
	public void doNothing() {
		new Thread(() -> {
			synchronized (this) {
				try {
					Thread.sleep(0); // blah
			} catch (final InterruptedException e2) {
				e2.printStackTrace();
			}
		}
		
	}	).start();
	}
}
Comment 1 Manoj N Palat CLA 2014-05-14 06:44:20 EDT
will take a look post luna
Comment 2 Manoj N Palat CLA 2015-04-07 08:06:14 EDT
Issue resolved by the umbrella bug 303519. Test case  committed via : http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=959aac6fcb83b61039c3ddae468ad5563b6ccb62

*** This bug has been marked as a duplicate of bug 303519 ***
Comment 3 Sasikanth Bharadwaj CLA 2015-04-27 08:09:06 EDT
Verified for M7 using I20150426-2000 build