Comments (3)
since removing unsafe reflection and postponing the compiler patching, this is more stable, but still broken
$ jshell --class-path unchecked.jar -C-Xplugin:unchecked -J--add-opens=java.base/java.lang=ALL-UNNAMED
| Welcome to JShell -- Version 17.0.2
| For an introduction type: /help intro
jshell> int i =0;
i ==> 0
jshell> System.out.println(i)
| Resetting...
jshell> System.out.println(i)
An exception has occurred in the compiler (17.0.2). 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, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1439)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1797)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitReturn(Flow.java:1415)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1709)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitBlock(Flow.java:1188)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitMethodDef(Flow.java:1154)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitClassDef(Flow.java:1117)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:819)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1532)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1522)
at jdk.compiler/com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:222)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1377)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1341)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:404)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$analyze$1(JavacTaskImpl.java:379)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:379)
at jdk.jshell/jdk.jshell.TaskFactory$AnalyzeTask.analyze(TaskFactory.java:390)
at jdk.jshell/jdk.jshell.TaskFactory$AnalyzeTask.<init>(TaskFactory.java:384)
at jdk.jshell/jdk.jshell.TaskFactory.lambda$analyze$1(TaskFactory.java:177)
at jdk.jshell/jdk.jshell.TaskFactory.lambda$runTask$4(TaskFactory.java:212)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskPool.getTask(JavacTaskPool.java:193)
at jdk.jshell/jdk.jshell.TaskFactory.runTask(TaskFactory.java:205)
at jdk.jshell/jdk.jshell.TaskFactory.analyze(TaskFactory.java:174)
at jdk.jshell/jdk.jshell.TaskFactory.analyze(TaskFactory.java:160)
at jdk.jshell/jdk.jshell.TaskFactory.analyze(TaskFactory.java:149)
at jdk.jshell/jdk.jshell.ExpressionToTypeInfo.expressionInfo(ExpressionToTypeInfo.java:239)
at jdk.jshell/jdk.jshell.Eval.processExpression(Eval.java:604)
at jdk.jshell/jdk.jshell.Eval.lambda$sourceToSnippets$1(Eval.java:220)
at jdk.jshell/jdk.jshell.TaskFactory.lambda$parse$6(TaskFactory.java:254)
at jdk.jshell/jdk.jshell.TaskFactory.lambda$runTask$4(TaskFactory.java:212)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskPool.getTask(JavacTaskPool.java:193)
at jdk.jshell/jdk.jshell.TaskFactory.runTask(TaskFactory.java:205)
at jdk.jshell/jdk.jshell.TaskFactory.parse(TaskFactory.java:139)
at jdk.jshell/jdk.jshell.TaskFactory.parse(TaskFactory.java:239)
at jdk.jshell/jdk.jshell.Eval.sourceToSnippets(Eval.java:194)
at jdk.jshell/jdk.jshell.Eval.eval(Eval.java:130)
at jdk.jshell/jdk.jshell.JShell.eval(JShell.java:493)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSource(JShellTool.java:3618)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSourceCatchingReset(JShellTool.java:1342)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processInput(JShellTool.java:1240)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1211)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:995)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:261)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:120)
Exception in thread "main" java.lang.InternalError: Exception during analyze - java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null
at jdk.jshell/jdk.jshell.TaskFactory$AnalyzeTask.analyze(TaskFactory.java:393)
at jdk.jshell/jdk.jshell.TaskFactory$AnalyzeTask.<init>(TaskFactory.java:384)
at jdk.jshell/jdk.jshell.TaskFactory.lambda$analyze$1(TaskFactory.java:177)
at jdk.jshell/jdk.jshell.TaskFactory.lambda$runTask$4(TaskFactory.java:212)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskPool.getTask(JavacTaskPool.java:193)
at jdk.jshell/jdk.jshell.TaskFactory.runTask(TaskFactory.java:205)
at jdk.jshell/jdk.jshell.TaskFactory.analyze(TaskFactory.java:174)
at jdk.jshell/jdk.jshell.TaskFactory.analyze(TaskFactory.java:160)
at jdk.jshell/jdk.jshell.TaskFactory.analyze(TaskFactory.java:149)
at jdk.jshell/jdk.jshell.ExpressionToTypeInfo.expressionInfo(ExpressionToTypeInfo.java:239)
at jdk.jshell/jdk.jshell.Eval.processExpression(Eval.java:604)
at jdk.jshell/jdk.jshell.Eval.lambda$sourceToSnippets$1(Eval.java:220)
at jdk.jshell/jdk.jshell.TaskFactory.lambda$parse$6(TaskFactory.java:254)
at jdk.jshell/jdk.jshell.TaskFactory.lambda$runTask$4(TaskFactory.java:212)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskPool.getTask(JavacTaskPool.java:193)
at jdk.jshell/jdk.jshell.TaskFactory.runTask(TaskFactory.java:205)
at jdk.jshell/jdk.jshell.TaskFactory.parse(TaskFactory.java:139)
at jdk.jshell/jdk.jshell.TaskFactory.parse(TaskFactory.java:239)
at jdk.jshell/jdk.jshell.Eval.sourceToSnippets(Eval.java:194)
at jdk.jshell/jdk.jshell.Eval.eval(Eval.java:130)
at jdk.jshell/jdk.jshell.JShell.eval(JShell.java:493)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSource(JShellTool.java:3618)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSourceCatchingReset(JShellTool.java:1342)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processInput(JShellTool.java:1240)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1211)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:995)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:261)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:120)
Caused by: java.lang.IllegalStateException: java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383)
at jdk.jshell/jdk.jshell.TaskFactory$AnalyzeTask.analyze(TaskFactory.java:390)
... 27 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1439)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1797)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitReturn(Flow.java:1415)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1709)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitBlock(Flow.java:1188)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitMethodDef(Flow.java:1154)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitClassDef(Flow.java:1117)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:819)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1532)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1522)
at jdk.compiler/com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:222)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1377)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1341)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:404)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$analyze$1(JavacTaskImpl.java:379)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:379)
... 28 more
- unchecked not in the stacktrace, so: broken state
- restoring the prev logger after ANALYZE is even more flaky
from unchecked.
- jshell uses a custom context: com.sun.tools.javac.api.JavacTaskPool$ReusableContext and Log from this class
- it won't be easy to patch
from unchecked.
replacing the custom log class with a custom diagnosticHandler fixes this problem (commit 6d586e6)
from unchecked.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unchecked.