-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
6u16
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The javac compiler reports an error while trying to compile the attached code (which seems to be correct). The code is compiled just fine by the Java compiler used by Eclipse IDE and can be fixed by simply changing the order of the import.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Attempt to compile the attached code will cause compilations errors (the import java.util.Date can be replaced by any other class, assuming it is not in the same package):
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The code should compile without any errors. (it is compiled by the compiler used by Eclipse IDE)
ACTUAL -
The code does not compile.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
\src\a\A.java:8: cannot find symbol
symbol : class Date
location: class a.A
public static class InnerB extends Date {
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package a;
import a.A.InnerB.InterfaceB;
import java.util.Date;
public class A {
public static class InnerB extends Date {
public interface InterfaceB {
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Any of the following will fix the problem:
*changing the order of the imports
*changing "extends Date" to "extends java.util.Date"
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The javac compiler reports an error while trying to compile the attached code (which seems to be correct). The code is compiled just fine by the Java compiler used by Eclipse IDE and can be fixed by simply changing the order of the import.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Attempt to compile the attached code will cause compilations errors (the import java.util.Date can be replaced by any other class, assuming it is not in the same package):
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The code should compile without any errors. (it is compiled by the compiler used by Eclipse IDE)
ACTUAL -
The code does not compile.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
\src\a\A.java:8: cannot find symbol
symbol : class Date
location: class a.A
public static class InnerB extends Date {
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package a;
import a.A.InnerB.InterfaceB;
import java.util.Date;
public class A {
public static class InnerB extends Date {
public interface InterfaceB {
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Any of the following will fix the problem:
*changing the order of the imports
*changing "extends Date" to "extends java.util.Date"