FULL PRODUCT 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)
ADDITIONAL OS VERSION INFORMATION :
Linux 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Hello,
I have stumbled up this issue while trying to migrate java web application to Java 8.
When -source & -target are set to 1.7, project compiles successfully.
If I set -source & -target to 1.8, java compiler fails with following stacktrace:
Using javac 1.8.0_31 to compile java sources
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.
com.sun.tools.javac.comp.Infer$GraphStrategy$NodeNotFoundException
at com.sun.tools.javac.comp.Infer$LeafSolver.pickNode(Infer.java:1211)
at com.sun.tools.javac.comp.Infer$GraphSolver.solve(Infer.java:1579)
at com.sun.tools.javac.comp.Infer$InferenceContext.solve(Infer.java:2198)
at com.sun.tools.javac.comp.Infer$InferenceContext.solve(Infer.java:2190)
at com.sun.tools.javac.comp.Infer$InferenceContext.solve(Infer.java:2205)
at com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:186)
at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:564)
at com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1431)
at com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1618)
at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1689)
at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1662)
at com.sun.tools.javac.comp.Resolve$9.doLookup(Resolve.java:2415)
at com.sun.tools.javac.comp.Resolve$BasicLookupHelper.lookup(Resolve.java:3074)
at com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3325)
at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2412)
at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2406)
at com.sun.tools.javac.comp.Attr.selectSym(Attr.java:3395)
at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3281)
at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607)
at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1843)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
at com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:386)
at com.sun.tools.javac.comp.DeferredAttr$2.complete(DeferredAttr.java:279)
at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:245)
at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:232)
at com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:993)
at com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:826)
at com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:731)
at com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:835)
at com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:162)
at com.sun.tools.javac.comp.Resolve.findFun(Resolve.java:1870)
at com.sun.tools.javac.comp.Resolve$8.doLookup(Resolve.java:2383)
at com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3310)
at com.sun.tools.javac.comp.Resolve.resolveMethod(Resolve.java:2379)
at com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:3170)
at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2011)
at com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:747)
at com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1704)
at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1384)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:676)
at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:692)
at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1142)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909)
at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1035)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4342)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4252)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4181)
at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4156)
at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1248)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:168)
at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:364)
at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:276)
at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:190)
at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:162)
at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1018)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:742)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:790)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:705)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:526)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:314)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:179)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:129)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:220)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:112)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:132)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Errors occurred while compiling module 'MAIN-APP_MODULE'
Information:Compilation completed with 1 error and 8 warnings in 1 min 13 sec
Information:1 error
Information:8 warnings
Error:java: Compilation failed: internal java compiler error
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Project classes are either compiled successfully or java compiler gives a cause of compilation failure.
ACTUAL -
Compiler throws com.sun.tools.javac.comp.Infer$GraphStrategy$NodeNotFoundException
REPRODUCIBILITY :
This bug can be reproduced always.