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

NullPointerException in Javac

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      crash javac 1.8.0_60-ea by compiling the following code:

      public class Main {
          public enum MyListener {
              INSTANCE;
          }
          public static class AbstractImpl {
              private final MyListener listener;
              AbstractImpl(MyListener listener)
                      throws NullPointerException {
                  this.listener = listener;
              }
          }

          public static final class DefaultImpl extends AbstractImpl {

              private DefaultImpl() {
                  super(MyListener::INSTANCE);
              }
          }

          public static void main(String[] args) {
          }
      }

      The stack-trace is:

      An exception has occurred in the compiler (1.8.0_60-ea). Please file a bug at
      the Java Bug Database (http://bugreport.java.com/bugreport/) after checking
      the database for duplicates. Include your program and the following
      diagnostic in your report. Thank you.
      java.lang.NullPointerException
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitIdent(Flow.java:2403)
      at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2011)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.tree.TreeScanner.visitReference(TreeScanner.java:268)
      at com.sun.tools.javac.tree.JCTree$JCMemberReference.accept(JCTree.java:1973)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scanExpr(Flow.java:1635)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scanExprs(Flow.java:1647)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitApply(Flow.java:2259)
      at
      com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:175)
      at
      com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1296)

      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitBlock(Flow.java:1883)
      at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1382)
      at
      com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitMethodDef(Flow.java:1811)
      at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitClassDef(Flow.java:1749)
      at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitClassDef(Flow.java:1722)
      at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.analyzeTree(Flow.java:2446)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.analyzeTree(Flow.java:2429)
      at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:211)
      at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1327)
      at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1296)
      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:74)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j
      ava:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at
      org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompile
      r.java:554)
      at
      org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:16
      1)
      at
      org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java
      :605)
      at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
      at
      org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPlug
      inManager.java:134)
      at
      org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208
      )
      at
      org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153
      )
      at
      org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145
      )
      at
      org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(Lifecy
      cleModuleBuilder.java:116)
      at
      org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(Lifecy
      cleModuleBuilder.java:80)
      at
      org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuild
      er.build(SingleThreadedBuilder.java:51)
      at
      org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.
      java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j
      ava:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at
      org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java
      :289)
      at
      org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at
      org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.ja
      va:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                shadowbug Shadow Bug
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: