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

javac throws NullPointerException

XMLWordPrintable

    • b04
    • x86_64
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Linux 4.15.0-43-generic #46~16.04.1-Ubuntu SMP Fri Dec 7 13:31:08 UTC 2018 x86_64

      A DESCRIPTION OF THE PROBLEM :
      $ javac -version
      javac 1.8.0_191

      $ cat Test.java
      class Test {
          static Object test(android.content.pm.PackageParser.Package p) {
              return p.requestedPermissions;
          }
      }

      $ javac -cp ~framework.jar.dedex.jar Test.java
      An exception has occurred in the compiler (1.8.0_191). 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 and the following diagnostic in your report. Thank you.
      java.lang.NullPointerException
      at com.sun.tools.javac.code.Symbol$ClassSymbol.isSubClass(Symbol.java:1020)
      at com.sun.tools.javac.comp.Lower.accessClass(Lower.java:1108)
      at com.sun.tools.javac.comp.Lower.accessSymbol(Lower.java:983)
      at com.sun.tools.javac.comp.Lower.access(Lower.java:1220)
      at com.sun.tools.javac.comp.Lower.visitSelect(Lower.java:3855)
      at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897)
      at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
      at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
      at com.sun.tools.javac.comp.Lower.translate(Lower.java:2382)
      at com.sun.tools.javac.comp.Lower.visitReturn(Lower.java:3588)
      at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1384)
      at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
      at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
      at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
      at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:162)
      at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:3561)
      at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909)
      at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
      at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
      at com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:145)
      at com.sun.tools.javac.comp.Lower.visitMethodDefInternal(Lower.java:2828)
      at com.sun.tools.javac.comp.Lower.visitMethodDef(Lower.java:2737)
      at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
      at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
      at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
      at com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:2508)
      at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
      at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
      at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
      at com.sun.tools.javac.comp.Lower.translate(Lower.java:2390)
      at com.sun.tools.javac.comp.Lower.translateTopLevelClass(Lower.java:3932)
      at com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1512)
      at com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1356)
      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.main.Main.compile(Main.java:381)
      at com.sun.tools.javac.main.Main.compile(Main.java:370)
      at com.sun.tools.javac.main.Main.compile(Main.java:361)
      at com.sun.tools.javac.Main.compile(Main.java:56)
      at com.sun.tools.javac.Main.main(Main.java:42)

      $

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      clone this git repo: https://gist.github.com/Lanchon/383f05664d59b096dc9d58ba32cdd667
      and run: ./repro.sh


      ---------- BEGIN SOURCE ----------
      https://gist.github.com/Lanchon/383f05664d59b096dc9d58ba32cdd667
      ---------- END SOURCE ----------

      FREQUENCY : always


            acobbs Archie Cobbs
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: