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

[lworld] Javac fails to properly handle inline class files with inner classes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: tools
    • Labels:

      Description

      An exception has occurred in the compiler (16-lworld3ea). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://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 read field "name" because "sym" is null
      at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl.enter(Scope.java:434)
      at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.enterMember(ClassReader.java:324)
      at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readInnerClasses(ClassReader.java:2618)
      at jdk.compiler/com.sun.tools.javac.jvm.ClassReader$6.read(ClassReader.java:913)
      at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readAttrs(ClassReader.java:1399)
      at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassAttrs(ClassReader.java:1413)
      at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2562)
      at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2664)
      at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFileInternal(ClassReader.java:2704)
      at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2668)
      at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:362)
      at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:292)
      at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:716)
      at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1450)
      at jdk.compiler/com.sun.tools.javac.code.ClassFinder.loadClass(ClassFinder.java:435)
      at jdk.compiler/com.sun.tools.javac.comp.Resolve.loadClass(Resolve.java:2041)
      at jdk.compiler/com.sun.tools.javac.comp.Resolve.findIdentInPackageInternal(Resolve.java:2480)
      at jdk.compiler/com.sun.tools.javac.comp.Resolve.findIdentInPackage(Resolve.java:2468)
      at jdk.compiler/com.sun.tools.javac.comp.Attr.selectSym(Attr.java:4352)
      at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:4237)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2321)
      at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:685)
      at jdk.compiler/com.sun.tools.javac.comp.Attr.attribImportQualifier(Attr.java:423)
      at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.doImport(TypeEnter.java:415)
      at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.resolveImports(TypeEnter.java:369)
      at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.runPhase(TypeEnter.java:326)
      at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.doCompleteEnvs(TypeEnter.java:287)
      at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:256)
      at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.complete(TypeEnter.java:203)
      at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:716)
      at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1450)
      at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:594)
      at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:571)
      at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1069)
      at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:936)
      at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
      at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
      at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
      at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
      printing javac parameters to: /home/tobias/Downloads/smallset/SmallSet/src/javac.20200915_151136.args

      It only happens when I make changes to a single file and recompile that one. If I remove all .class files and recompile, it does not happen. Test files attached.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sadayapalam Srikanth Adayapalam
              Reporter:
              thartmann Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: