Community
Participate
Working Groups
Build ID: M20070212-1330 Steps To Reproduce: 1. Create a new Java class file: public class FormatTest { private String a, b, c; @SuppressWarnings("unchecked") private Long one, two; } 2. Press CTRL+SHIFT+F to format the source, nothing happens. 3. Change the class file to: public class FormatTest { private String a, b, c; @SuppressWarnings("unchecked") private Long one private Long two; } 4. Press CTRL+SHIFT+F to format the new source and works as expected. More information: When the Java class file contains annotation preceding a single line multiple field declaration, the formatter won't format the source code. In other word, if you have lines like this in your code: @SuppressWarnings("unchecked") // can be any annotations private Long one, two; // multiple declarations in single line The Java source formatter will stop working. There is no error messages in the log file.
Reproduced with 3.3RC4.
Created attachment 71335 [details] Proposed fix + regression test
Good candidate for 3.3.1. The fix is low risk.
Released for 3.4M1 in HEAD. Waiting approval to release it for 3.3.1.
Regression test added in org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test667
Jérôme, candidate for 3.3.1?
Verified for 3.4M1 using build I20070806-1800.
+1 for backporting to 3.3.1
Reopen for 3.3.1
Released for 3.3.1. Regression test added in org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test667
Verified for 3.3.1 using build M20070831-2000