Community
Participate
Working Groups
In eclipse 3.1.0 build 200411050810 the code formatter fails if there are any static imports.
Are you sure that the corresponding compilation unit is located in a project that is using 1.5 compiler settings?
Yes, I just checked again. The file compiles fine it just won't format. I don't get any errors, just nothing happens unless I comment out the 2 static imports I have.
Could you please provide the offending compilation unit?
Not sure if I should attach or inline. They are small so I will just put them in this comment. I created a small test case that doesn't format either. package test; import static test.TestConstants.*; public class TestClass { public void someMethod() { int x = 0; if(x == 0) { //Do something } } } package test; public class TestConstants { public static final int CMD_FAILURE = 0x00; public static final int CMD_SUCCESS = 0x01; public static final int STATUS = 0x02; public static final int MONITOR_DATA = 0x04; }
I will investigate. This is supposed to work fine if the 1.5 settings are used for the corresponding project.
Reproduced. Fixed and released in HEAD. Regression tests added in FormatterRegressionTest.test528 and test529.
Verified for 3.1 M4 using build I200412142000.