-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.1.8, 1.2.0
-
generic, x86
-
solaris_2.5.1, windows_nt
A type-import-on-demand declaration that names an inaccessible package should throw a compile-time error (JLS 7.5.2).
Correct behaviour is shown for JDK 1.1.7. For Win32 1.1.8, the compiler does not throw an error if mixed case letters are substituted in an existent package name. For example:
import java.AWT.*; //no error
//import jaVa.util.*; //no error
//import java.foo.*; //error
public class NonExistPackage {
public static void main(String argv[]) {
//do nothing
}
}
The above compiles successfully but should throw an error (as seen for 1.1.8 on Solaris):
javac NonExistPackage.java
NonExistPackage.java:1: Package java.AWT not found in import.
import java.AWT.*; does not actually import java.awt.*;
This is demonstrated by
import java.AWT.*;
public class NonExistPackage {
public static void main(String argv[]) {
Label l;
}
}
which throws an error on compilation.
stuart.lawrence@eng 1998-10-07
Correct behaviour is shown for JDK 1.1.7. For Win32 1.1.8, the compiler does not throw an error if mixed case letters are substituted in an existent package name. For example:
import java.AWT.*; //no error
//import jaVa.util.*; //no error
//import java.foo.*; //error
public class NonExistPackage {
public static void main(String argv[]) {
//do nothing
}
}
The above compiles successfully but should throw an error (as seen for 1.1.8 on Solaris):
javac NonExistPackage.java
NonExistPackage.java:1: Package java.AWT not found in import.
import java.AWT.*; does not actually import java.awt.*;
This is demonstrated by
import java.AWT.*;
public class NonExistPackage {
public static void main(String argv[]) {
Label l;
}
}
which throws an error on compilation.
stuart.lawrence@eng 1998-10-07
- duplicates
-
JDK-4118500 Spurious ambiguous import errors on win32. Case sensitive.
- Closed