Community
Participate
Working Groups
Build ID: M20080911-1700 Formatting this Java code works : if (true) { a = 1; } else { a = 2; } ... and you get this : if (true) { a = 1; } else { a = 2; } ... but formatting that code fails : if (true) { a = 1; } else { a = 2; } ... because of the blank line between "}" and "else {"
Please attach your formatter settings (export the profile).
All the settings are the default settings. Profile : Eclipse [built-in]
Then provide a test case and describe what you mean by "code formatting fails". Do you get a stack trace?
I mean : The code formatting does not work correctly since there is still a blank line between "}" and "else {" whereas the "}" and the "else {" should be on the same line like that : } else { In other words, the code formatting is able to correctly format when there is only one newline to remove but is unable to format when there is TWO newlines to remove. If you want samples, just copy/paste the code I have written in the decription and make a code formatting on it.
This is due to the fact that the Eclipse built-in formatter settings preserve one blank line (ie. 'Number of empty lines to preserve' preference is equal to '1' in 'Blank lines' tab). If you change this value to 0, then you'll get the expected output: if (true) { a = 1; } else { a = 2; }
So, OK to close as WORKSFORME?
(In reply to comment #6) > So, OK to close as WORKSFORME? > Close as WORKSFORME
Verified for 3.6M1 using build I20090802-2000