-
Bug
-
Resolution: Incomplete
-
P4
-
None
-
17
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Tested with JDK 17.0.9, 21.0.1, and latest 23. Issue is always the same.
A DESCRIPTION OF THE PROBLEM :
An exception has occurred in the compiler (17.0.9). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://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.Symbol$MethodSymbol.flags()" because "com.sun.tools.javac.code.Types.interfaceCandidates(com.sun.tools.javac.code.Type, com.sun.tools.javac.code.Symbol$MethodSymbol).head" is null
at jdk.compiler/com.sun.tools.javac.code.Types$DescriptorFilter.test(Types.java:997)
at jdk.compiler/com.sun.tools.javac.code.Types$DescriptorFilter.test(Types.java:984)
at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl$1.skipToNextMatchingEntry(Scope.java:620)
at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl$1.update(Scope.java:608)
at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl$1.<init>(Scope.java:578)
at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl.lambda$getSymbols$1(Scope.java:573)
at jdk.compiler/com.sun.tools.javac.code.Scope$CompoundScope.lambda$getSymbols$0(Scope.java:1085)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.update(Iterators.java:78)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.hasNext(Iterators.java:60)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.update(Iterators.java:79)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.hasNext(Iterators.java:60)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.update(Iterators.java:79)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.hasNext(Iterators.java:60)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.update(Iterators.java:79)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.hasNext(Iterators.java:60)
at jdk.compiler/com.sun.tools.javac.code.Types$DescriptorCache.findDescriptorInternal(Types.java:740)
at jdk.compiler/com.sun.tools.javac.code.Types$DescriptorCache.get(Types.java:720)
at jdk.compiler/com.sun.tools.javac.code.Types.findDescriptorType(Types.java:828)
at jdk.compiler/com.sun.tools.javac.comp.Attr.getTargetInfo(Attr.java:3264)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitReference(Attr.java:3584)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMemberReference.accept(JCTree.java:2531)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:500)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:480)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:467)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.complete(DeferredAttr.java:315)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:359)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:343)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:1076)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:903)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:791)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:912)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:634)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1582)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1788)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1858)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1832)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$11.doLookup(Resolve.java:2737)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$BasicLookupHelper.lookup(Resolve.java:3454)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3706)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2734)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2728)
at jdk.compiler/com.sun.tools.javac.comp.Attr.selectSym(Attr.java:4418)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:4298)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2450)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2568)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1797)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:723)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitVarDef(Attr.java:1315)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1027)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:770)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1449)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitIf(Attr.java:2199)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1553)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:770)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1449)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1239)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:5463)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5354)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5185)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attrib(Attr.java:5143)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1317)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
By compiling my application. One specific maven module causes this error. This module contains 228 source files and the error does not output which source file is affected, so I am not able to provide a demo program here :(
As far as I could examine it seems like `com.sun.tools.javac.code.Types#interfaceCandidates` is returning an empty list, but `com.sun.tools.javac.code.Types.DescriptorFilter#test` is accesing the `head` of the list without null check. Therefore the call to `flags()` method of `head` fails, since `head` is `null`.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Program compiled successfully or syntax error is reported.
ACTUAL -
Internal compiler error with message to search for similar bugs (found none) and creating a new bug report.
CUSTOMER SUBMITTED WORKAROUND :
None available.
FREQUENCY : always
Tested with JDK 17.0.9, 21.0.1, and latest 23. Issue is always the same.
A DESCRIPTION OF THE PROBLEM :
An exception has occurred in the compiler (17.0.9). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://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.Symbol$MethodSymbol.flags()" because "com.sun.tools.javac.code.Types.interfaceCandidates(com.sun.tools.javac.code.Type, com.sun.tools.javac.code.Symbol$MethodSymbol).head" is null
at jdk.compiler/com.sun.tools.javac.code.Types$DescriptorFilter.test(Types.java:997)
at jdk.compiler/com.sun.tools.javac.code.Types$DescriptorFilter.test(Types.java:984)
at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl$1.skipToNextMatchingEntry(Scope.java:620)
at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl$1.update(Scope.java:608)
at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl$1.<init>(Scope.java:578)
at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl.lambda$getSymbols$1(Scope.java:573)
at jdk.compiler/com.sun.tools.javac.code.Scope$CompoundScope.lambda$getSymbols$0(Scope.java:1085)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.update(Iterators.java:78)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.hasNext(Iterators.java:60)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.update(Iterators.java:79)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.hasNext(Iterators.java:60)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.update(Iterators.java:79)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.hasNext(Iterators.java:60)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.update(Iterators.java:79)
at jdk.compiler/com.sun.tools.javac.util.Iterators$CompoundIterator.hasNext(Iterators.java:60)
at jdk.compiler/com.sun.tools.javac.code.Types$DescriptorCache.findDescriptorInternal(Types.java:740)
at jdk.compiler/com.sun.tools.javac.code.Types$DescriptorCache.get(Types.java:720)
at jdk.compiler/com.sun.tools.javac.code.Types.findDescriptorType(Types.java:828)
at jdk.compiler/com.sun.tools.javac.comp.Attr.getTargetInfo(Attr.java:3264)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitReference(Attr.java:3584)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMemberReference.accept(JCTree.java:2531)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:500)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:480)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:467)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.complete(DeferredAttr.java:315)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:359)
at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:343)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:1076)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:903)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:791)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:912)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:634)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1582)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1788)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1858)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1832)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$11.doLookup(Resolve.java:2737)
at jdk.compiler/com.sun.tools.javac.comp.Resolve$BasicLookupHelper.lookup(Resolve.java:3454)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3706)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2734)
at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2728)
at jdk.compiler/com.sun.tools.javac.comp.Attr.selectSym(Attr.java:4418)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:4298)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2450)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2568)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1797)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:723)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitVarDef(Attr.java:1315)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1027)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:770)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1449)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitIf(Attr.java:2199)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1553)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:770)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1449)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1239)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:5463)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5354)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5185)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attrib(Attr.java:5143)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1317)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
By compiling my application. One specific maven module causes this error. This module contains 228 source files and the error does not output which source file is affected, so I am not able to provide a demo program here :(
As far as I could examine it seems like `com.sun.tools.javac.code.Types#interfaceCandidates` is returning an empty list, but `com.sun.tools.javac.code.Types.DescriptorFilter#test` is accesing the `head` of the list without null check. Therefore the call to `flags()` method of `head` fails, since `head` is `null`.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Program compiled successfully or syntax error is reported.
ACTUAL -
Internal compiler error with message to search for similar bugs (found none) and creating a new bug report.
CUSTOMER SUBMITTED WORKAROUND :
None available.
FREQUENCY : always