Bug 46033

Summary: New formatter not formatting nested constructor/methods properly
Product: [Eclipse Project] JDT Reporter: Joseph Cavanaugh <joseph.cavanaugh>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: joseph.cavanaugh, oyvind.harboe
Version: 3.0   
Target Milestone: 3.0 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Joseph Cavanaugh CLA 2003-11-04 10:48:31 EST
In the example below, the "Expression s = getBuilder ...." line should be
indented to the same spot as the comment above it.

public class Test {

	protected void doSomeStuff() {
		/*
		 * Comment
		 */
		doSomething(Expression.class, "Sting value for something",
				new Object() {
					public Something buildSomething() {
						// Comment
					Expression s = getBuilder().get("name")
							.equal(getArgument("name", String.class, 0));
					return s;
				}

				});
	}
}
Comment 1 Olivier Thomann CLA 2003-11-06 09:14:26 EST
Now we have:
public class Test {
    protected void doSomeStuff() {
        /*
         * Comment
         */
        doSomething(Expression.class, "Sting value for something",
                new Object() {
                    public Something buildSomething() {
                        // Comment
                        Expression s = getBuilder().get("name")
                                .equal(getArgument("name", String.class, 0));
                        return s;
                    }
                });
    }
}

I think it is much better.
Fixed and released in HEAD.
Regression test added.
Comment 2 Olivier Thomann CLA 2003-11-06 09:45:28 EST
*** Bug 46023 has been marked as a duplicate of this bug. ***
Comment 3 Olivier Thomann CLA 2003-11-06 10:10:25 EST
Change milestone.