Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8171325

NPE in Check.clearLocalClassNameIndexes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b153
    • Verification:
      Verified

      Description

      The following program crashes javac 9-ea+149:

      ===
      import java.util.List;
      import java.util.function.Function;
      import java.util.function.Supplier;

      abstract class Test {

        abstract <A> void f(List<A> t);
        abstract <B, C> C g(C u, Function<B, C> v);
        abstract <D> D g(Supplier<D> w);

        public void test() {
          f(g((String) null, task -> g(new NoSuch() {})));
        }
      }
      ===

      java.lang.NullPointerException
              at jdk.compiler/com.sun.tools.javac.comp.Check.clearLocalClassNameIndexes(Check.java:440)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$UnenterScanner.visitClassDef(DeferredAttr.java:483)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:774)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitNewClass(TreeScanner.java:246)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1683)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitApply(TreeScanner.java:238)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1628)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitLambda(TreeScanner.java:259)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1801)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitApply(TreeScanner.java:238)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1628)
              at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:461)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:447)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$4.complete(DeferredAttr.java:335)
              at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr$ArgumentType.complete(ArgumentAttr.java:354)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:301)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:287)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$RecoveryDeferredTypeMap.recover(DeferredAttr.java:992)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$RecoveryDeferredTypeMap.typeOf(DeferredAttr.java:981)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve$ResolveDeferredRecoveryMap.typeOf(Resolve.java:2384)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredTypeMap.visitType(DeferredAttr.java:948)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$RecoveryDeferredTypeMap.visitType(DeferredAttr.java:971)
              at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredTypeMap.visitType(DeferredAttr.java:934)
              at jdk.compiler/com.sun.tools.javac.code.Type.accept(Type.java:214)
              at jdk.compiler/com.sun.tools.javac.code.Types$MapVisitor.visit(Types.java:4706)
              at jdk.compiler/com.sun.tools.javac.code.Type$TypeMapping.apply(Type.java:231)
              at jdk.compiler/com.sun.tools.javac.code.Type$TypeMapping.apply(Type.java:227)
              at jdk.compiler/com.sun.tools.javac.util.List.map(List.java:425)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve$7.getArgumentTypes(Resolve.java:2372)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve.accessInternal(Resolve.java:2293)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve.accessMethod(Resolve.java:2313)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve$BasicLookupHelper.access(Resolve.java:3102)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3343)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3323)
              at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveMethod(Resolve.java:2438)
              at jdk.compiler/com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:3311)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2223)
              at jdk.compiler/com.sun.tools.javac.comp.Attr$ResultInfo.attr(Attr.java:501)
              at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:639)

        Attachments

          Activity

            People

            Assignee:
            vromero Vicente Arturo Romero Zaldivar
            Reporter:
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: