Community
Participate
Working Groups
Build Identifier: 20090920-1017 I have the 'never joins lines' option enabled in the formatter preferences with it set to put braces on the next method. It mangles the opening brace for all blocks inside the anonymous class (specifically class declaration, method declaration, while loops). Notably, if the opening brace for a method is put on the same line as the method declaration then the first invocation of the formatter correctly drops the bracket to the next line. A second invocation of the formatter on the already formatted file, indents the bracket by 16 spaces (4 indents). Example Before Formatting: List l = new List() { @Override public boolean add(Object arg0) { // TODO Auto-generated method stub return false; } .... } Example After Formatting: List l = new List() { @Override public boolean add(Object arg0) { // TODO Auto-generated method stub return false; } .... } Reproducible: Always Steps to Reproduce: 1. Use the attached formatter settings. 2. Open the attached java file in Eclipse 3. From the menu select Source->Format (ctrl+shift+f) Expected: The formatter should not change anything. Actual: See details.
Created attachment 159359 [details] Sample file before running formatter
Created attachment 159361 [details] Formatter configuration that demonstrates the bug
I believe this is a duplicate of bug 286601. *** This bug has been marked as a duplicate of bug 286601 ***
(In reply to comment #3) > I believe this is a duplicate of bug 286601. > > *** This bug has been marked as a duplicate of bug 286601 *** I believe you are correct. My apologies for not searching resolved bugs as well as open ones.
verified for 3.6M6 using build I20100305-1011.
Verified