JDK-8075572 : Exception compiling java code from IntelliJ IDEA
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8u31
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2015-03-18
  • Updated: 2015-07-01
  • Resolved: 2015-03-20
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
C:\Java\jdk1.8.0_31\bin>java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

A DESCRIPTION OF THE PROBLEM :
Information:Using javac 1.8.0_31 to compile java sources
Information:java: An exception has occurred in the compiler (1.8.0_31). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
Information:java: 	at com.sun.tools.javac.util.Assert.check(Assert.java:94)
Information:java: 	at com.sun.tools.javac.util.Bits.incl(Bits.java:186)
Information:java: 	at com.sun.tools.javac.comp.Flow$AssignAnalyzer.checkInit(Flow.java:2510)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.checkInit(Flow.java:1586)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitIdent(Flow.java:2381)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2011)
Information:java: 	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
Information:java: 	at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:398)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1376)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExpr(Flow.java:1627)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExprs(Flow.java:1639)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitApply(Flow.java:2236)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
Information:java: 	at com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:175)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1296)
Information:java: 	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitBlock(Flow.java:1846)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitLambda(Flow.java:2263)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1624)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2423)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2406)
Information:java: 	at com.sun.tools.javac.comp.Flow.analyzeLambdaThrownTypes(Flow.java:250)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2423)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607)
Information:java: 	at com.sun.tools.javac.comp.DeferredAttr$2.complete(DeferredAttr.java:284)
Information:java: 	at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:245)
Information:java: 	at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:232)
Information:java: 	at com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:993)
Information:java: 	at com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:826)
Information:java: 	at com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:731)
Information:java: 	at com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:835)
Information:java: 	at com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:162)
Information:java: 	at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:564)
Information:java: 	at com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:601)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:3809)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkIdInternal(Attr.java:3615)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkMethodIdInternal(Attr.java:3522)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkMethodId(Attr.java:3501)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkId(Attr.java:3488)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3370)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1843)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1704)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1384)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:676)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:692)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1142)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1035)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4342)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4252)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4181)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitClassDef(Attr.java:892)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitNewClass(Attr.java:2162)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1516)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:705)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1834)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:649)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitAssign(Attr.java:3000)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCAssign.accept(JCTree.java:1686)
Information:java: 	at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4156)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1248)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860)
Information:java: 	at com.sun.tools.javac.main.Main.compile(Main.java:523)
Information:java: 	at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
Information:java: 	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
Information:java: 	at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:168)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:382)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:296)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:204)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:176)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1196)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:877)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:945)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:840)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.access$800(IncProjectBuilder.java:81)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder$BuildParallelizer$2.run(IncProjectBuilder.java:809)
Information:java: 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
Information:java: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Information:java: 	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:37)
Information:java: 	at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
Information:java: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
Information:java: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Information:java: 	at java.lang.Thread.run(Thread.java:745)
Information:18.03.2015 11:52 - Compilation completed with 2 errors and 0 warnings in 3s 429ms


ERROR MESSAGES/STACK TRACES THAT OCCUR :
Information:Using javac 1.8.0_31 to compile java sources
Information:java: An exception has occurred in the compiler (1.8.0_31). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
Information:java: 	at com.sun.tools.javac.util.Assert.check(Assert.java:94)
Information:java: 	at com.sun.tools.javac.util.Bits.incl(Bits.java:186)
Information:java: 	at com.sun.tools.javac.comp.Flow$AssignAnalyzer.checkInit(Flow.java:2510)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.checkInit(Flow.java:1586)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitIdent(Flow.java:2381)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2011)
Information:java: 	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
Information:java: 	at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:398)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1376)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExpr(Flow.java:1627)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExprs(Flow.java:1639)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitApply(Flow.java:2236)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
Information:java: 	at com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:175)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1296)
Information:java: 	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitBlock(Flow.java:1846)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitLambda(Flow.java:2263)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1624)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2423)
Information:java: 	at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2406)
Information:java: 	at com.sun.tools.javac.comp.Flow.analyzeLambdaThrownTypes(Flow.java:250)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2423)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607)
Information:java: 	at com.sun.tools.javac.comp.DeferredAttr$2.complete(DeferredAttr.java:284)
Information:java: 	at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:245)
Information:java: 	at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:232)
Information:java: 	at com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:993)
Information:java: 	at com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:826)
Information:java: 	at com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:731)
Information:java: 	at com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:835)
Information:java: 	at com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:162)
Information:java: 	at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:564)
Information:java: 	at com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:601)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:3809)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkIdInternal(Attr.java:3615)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkMethodIdInternal(Attr.java:3522)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkMethodId(Attr.java:3501)
Information:java: 	at com.sun.tools.javac.comp.Attr.checkId(Attr.java:3488)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3370)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1843)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1704)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1384)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:676)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:692)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1142)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1035)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4342)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4252)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4181)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitClassDef(Attr.java:892)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitNewClass(Attr.java:2162)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1516)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:705)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1834)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:649)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitAssign(Attr.java:3000)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCAssign.accept(JCTree.java:1686)
Information:java: 	at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4156)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1248)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860)
Information:java: 	at com.sun.tools.javac.main.Main.compile(Main.java:523)
Information:java: 	at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
Information:java: 	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
Information:java: 	at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:168)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:382)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:296)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:204)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:176)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1196)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:877)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:945)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:840)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.access$800(IncProjectBuilder.java:81)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder$BuildParallelizer$2.run(IncProjectBuilder.java:809)
Information:java: 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
Information:java: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Information:java: 	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:37)
Information:java: 	at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
Information:java: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
Information:java: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Information:java: 	at java.lang.Thread.run(Thread.java:745)
Information:18.03.2015 11:52 - Compilation completed with 2 errors and 0 warnings in 3s 429ms

REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Seems like a dup of 8062747.
20-03-2015

Submitter responded conveying that he is abl eto compile with some code changes. Details below: ******************************************************************************************************************* On 3/19/2015 3:29 PM, ................. wrote: > Hi, > Thank you for writing to me! > Unfortunately, I managed to make it compile by some code changes. So I can only share what I believe may caused the crash, > I was writing a code with interface like interface Foo<Y,E extends Throwable> { Y run() throws E; } and I had a method > <Y,E extends Throwable> Y call(Foo<Y,E> f) throws E. I had several usages of the method in my code with labdas (so Y and E were > inferred by java). Next In the implementation of the call method I had a code like this: > <Y,E extends Throwable> Y call(Foo<Y,E> f) throws E { > AtomicReference<Throwable> err = new AtomicReference<>(null); > AtomicReference<Y> res = new AtomicReference<>(null); > someMethodFormRunnable(() -> { > try { > res.set(f.call()); > } catch(Throwable t) { > err.set(t); > } > }); > if (err.get() != null) throw (E)err.get(); /// this case may have broken javac > return res.get(); > } > void someMethodFormRunnable(Runnable r) { ... } > To fix the issue I did the following > - I replaced all usages of call and put anonymous classes there (replaced labdas with classes) > - I removed the (E) cast > Before fixing that I tried to rebuild the whole project, that did not worked out. > Some moments after I re-wrote the code totally to avoid unchecked cast to E, > so I no longer able to reproduce the javac crash. > Best regards, > ............................ **********************************************************************************************************
20-03-2015