Community
Participate
Working Groups
Build Identifier: 20100917-0705 When a enum has two semicolons after the list of enum values, and any body the formatter fails to format the whole file that contains the enum. No exceptions show up in the logs when the formatter fails to run. Reproducible: Always Steps to Reproduce: The following examples fail to format (Java 5): enum Fail1 {A;;{}} enum Fail2 {A,B;;{}} enum Fail3 {A;;public void foo() {}} enum Fail4 {A;;public int i = 0;} The following examples do format correctly: enum Good1 {A;;} enum Good2 {A,B;;} enum Good3 {A;;/* blah */} enum Good4 {A;{}} enum Good5 {A;public void foo() {}} enum Good6 {A;public int i = 0;}
I'll take a look.
Created attachment 182716 [details] Proposed fix + regression tests We need to check for semi-colons before the first member.
Released for 3.7M4. Regression tests added in: org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test730 org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test731 org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test732 org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test733
Verified for 3.7M4 using build I20101206-1800.