Bug 78075

Summary: normal and static import of the same class doesn't work correctly
Product: [Eclipse Project] JDT Reporter: Boris Kolar <boris.kolar>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Boris Kolar CLA 2004-11-08 10:32:19 EST
Let's have 2 imports of the same class:

import com.somecompany.SomeClass.*;
import static com.somecompany.SomeClass.*;

public class Test {
  public void test() {
    staticMethodFromSomeClass(); // eclipse reports error, javac doesn't
  }
}

If you reorder imports (or remove nonstatic one) it will work ok:
import static com.somecompany.SomeClass.*;
import com.somecompany.SomeClass.*; // obsolete import
Comment 1 Olivier Thomann CLA 2004-11-16 21:55:43 EST
The first import is incorrect.
It should be:
import com.somecompany.*;

It should not be possible to use such an import if the import is not static.
Comment 2 Kent Johnson CLA 2004-11-17 14:42:10 EST
Added StaticImport test 15
Comment 3 Olivier Thomann CLA 2004-12-14 11:05:44 EST
Verified in 200412140800