Bug 94262

Summary: [1.5] non static class must not be visible through static import
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Audel CLA 2005-05-10 06:34:54 EDT
build I20050509-2010

1) create QQType1.java
package pkgstaticimport;
public class QQType1 {
	public class Inner1 {}
	public static class Inner2 {}
	protected class Inner3 {}
	protected static class Inner4 {}
	private class Inner5 {}
	private static class Inner6 {}
	class Inner7 {}
	static class Inner8 {}
}

2) create Test.java
package a;
import static pkgstaticimport.QQType1.*;
public class Test {
	void foo() {
		Inner1 i;
		Inner2 j;
	}
}
3) compile

no errors

but javac does not accept this code

a\Test.java:5: cannot find symbol
symbol  : class Inner1
location: class a.Test
                Inner1 i;
                ^
1 error
Comment 1 David Audel CLA 2005-05-10 07:07:39 EDT
another problem in the same area

package a;
import static pkgstaticimport.QQType1.*;
import pkgstaticimport.QQType1.*;
public class Test {
	void foo() {
		Inner1 i;
		Inner2 j;
	}
}

We find 2 errors

The type Inner1 is ambiguous
The type Inner2 is ambiguous

and javac 0 error.
Comment 2 Kent Johnson CLA 2005-05-10 12:01:39 EDT
Added StaticImport test030
Comment 3 Olivier Thomann CLA 2005-05-11 10:03:52 EDT
Verified in I20050510-0010 + JDT/Core HEAD