Bug 39607 - Incorrect formatting of anonymous inner class inside if statement
Summary: Incorrect formatting of anonymous inner class inside if statement
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-03 11:27 EDT by John Arthorne CLA
Modified: 2003-10-14 07:26 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2003-07-03 11:27:25 EDT
Build: I20030625

The following code is not formatted correctly by the formatter:

if (!lockListener.isUIWaiting())
	asyncExec(new Runnable() {
	public void run() {
		lockListener.doPendingWork();
	}
});

It should have indented the run method, like this:

if (!lockListener.isUIWaiting())
	asyncExec(new Runnable() {
		public void run() {
			lockListener.doPendingWork();
		}
	});

It formats correctly if braces are added to the "if" statement.
Comment 1 Tod Creasey CLA 2003-07-10 11:42:13 EDT
You can also see this by formatting the class 
org.eclipse.ui.progress.DeferredTreeContentManager

John did you mean to mark this as 2.1? I have only seen it since 20030709.
Comment 2 John Arthorne CLA 2003-07-10 12:12:57 EDT
2.1 was the auto-detected value set by bugzilla.  I was using 3.0 stream build
I20030625.
Comment 3 Olivier Thomann CLA 2003-10-03 10:35:45 EDT
This is addressed in the new formatter.
Fixed and released in HEAD.
Regression test added.
Comment 4 David Audel CLA 2003-10-14 07:26:19 EDT
Verified.