Bug 94262 - [1.5] non static class must not be visible through static import
Summary: [1.5] non static class must not be visible through static import
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-10 06:34 EDT by David Audel CLA
Modified: 2005-05-11 10:03 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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