-
Bug
-
Resolution: Fixed
-
P3
-
11
-
b17
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8204766 | 11.0.1 | Jan Lahoda | P3 | Resolved | Fixed | team |
Consider these files:
---pkg/Missing.java
broken
---Test.java
import pkg.Missing;
---
Then:
---
$ javac -sourcepath . Test.java ; echo $?
./pkg/Missing.java:1: error: reached end of file while parsing
broken
^
Test.java:1: error: cannot access Missing
import pkg.Missing;
^
bad source file: ./pkg/Missing.java
file does not contain class pkg.Missing
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
2 errors
4
---
---
$ javac -sourcepath . -XDdev Test.java
./pkg/Missing.java:1: error: reached end of file while parsing
broken
^
Test.java:1: error: cannot access Missing
import pkg.Missing;
^
bad source file: ./pkg/Missing.java
file does not contain class pkg.Missing
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
2 errors
An exception has occurred in the compiler (11-internal). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
at jdk.compiler/com.sun.tools.javac.comp.Check.isCanonical(Check.java:3565)
at jdk.compiler/com.sun.tools.javac.comp.Check.checkCanonical(Check.java:3557)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.doImport(TypeEnter.java:425)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.resolveImports(TypeEnter.java:362)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.access$1700(TypeEnter.java:299)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.lambda$ensureImportsChecked$0(TypeEnter.java:168)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.finishImports(TypeEnter.java:220)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.ensureImportsChecked(TypeEnter.java:168)
at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:600)
at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:560)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1061)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:932)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:306)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:165)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
---
---pkg/Missing.java
broken
---Test.java
import pkg.Missing;
---
Then:
---
$ javac -sourcepath . Test.java ; echo $?
./pkg/Missing.java:1: error: reached end of file while parsing
broken
^
Test.java:1: error: cannot access Missing
import pkg.Missing;
^
bad source file: ./pkg/Missing.java
file does not contain class pkg.Missing
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
2 errors
4
---
---
$ javac -sourcepath . -XDdev Test.java
./pkg/Missing.java:1: error: reached end of file while parsing
broken
^
Test.java:1: error: cannot access Missing
import pkg.Missing;
^
bad source file: ./pkg/Missing.java
file does not contain class pkg.Missing
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
2 errors
An exception has occurred in the compiler (11-internal). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
at jdk.compiler/com.sun.tools.javac.comp.Check.isCanonical(Check.java:3565)
at jdk.compiler/com.sun.tools.javac.comp.Check.checkCanonical(Check.java:3557)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.doImport(TypeEnter.java:425)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.resolveImports(TypeEnter.java:362)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.access$1700(TypeEnter.java:299)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.lambda$ensureImportsChecked$0(TypeEnter.java:168)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.finishImports(TypeEnter.java:220)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.ensureImportsChecked(TypeEnter.java:168)
at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:600)
at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:560)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1061)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:932)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:306)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:165)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
---
- backported by
-
JDK-8204766 javac crash when checking imports and a broken class is present
-
- Resolved
-
- relates to
-
JDK-8200311 BadConstantValue.java fails java.lang.AssertionError: did not see expected error
-
- Closed
-