Bug 79779 - Code Formatter fails with static imports
Summary: Code Formatter fails with static imports
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-30 10:42 EST by Eric Vickery CLA
Modified: 2004-12-15 13:15 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Vickery CLA 2004-11-30 10:42:29 EST
In eclipse 3.1.0 build 200411050810 the code formatter fails if there are any 
static imports.
Comment 1 Olivier Thomann CLA 2004-11-30 11:52:28 EST
Are you sure that the corresponding compilation unit is located in a project
that is using 1.5 compiler settings?
Comment 2 Eric Vickery CLA 2004-11-30 11:55:53 EST
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.
Comment 3 Olivier Thomann CLA 2004-11-30 11:59:04 EST
Could you please provide the offending compilation unit?
Comment 4 Eric Vickery CLA 2004-11-30 12:49:50 EST
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;
    }
Comment 5 Olivier Thomann CLA 2004-11-30 18:34:16 EST
I will investigate. This is supposed to work fine if the 1.5 settings are used
for the corresponding project.
Comment 6 Olivier Thomann CLA 2004-11-30 21:34:32 EST
Reproduced.
Fixed and released in HEAD.
Regression tests added in FormatterRegressionTest.test528 and test529.
Comment 7 Frederic Fusier CLA 2004-12-15 13:15:40 EST
Verified for 3.1 M4 using build I200412142000.