TypeElement.getSuperclass crashes for a record TypeElement when j.l.Record is not available

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 18
    • Affects Version/s: 18
    • Component/s: tools
    • None
    • b15

      Consider a TypeElement for a record when the j.l.Record is unavailable for any reason. Calling TypeElement.getSuperclass() leads to a NPE like:
      ---
      java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.tree.JCTree.accept(com.sun.tools.javac.tree.JCTree$Visitor)" because "tree" is null
      "MainThread"
      at com.sun.tools.javac.comp.TypeEnter$AbstractHeaderPhase$Synthesizer.visit(TypeEnter.java:595)
      at com.sun.tools.javac.comp.TypeEnter$AbstractHeaderPhase$1.getModelType(TypeEnter.java:575)
      at com.sun.tools.javac.code.Symbol$ClassSymbol.getSuperclass(Symbol.java:1443)
      at com.sun.tools.javac.code.Symbol$ClassSymbol.getSuperclass(Symbol.java:1257)
      at RecordsErrorRecovery.getSuperclass(RecordsErrorRecovery.java:73)
      ---

            Assignee:
            Jan Lahoda
            Reporter:
            Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: