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

java.lang.NullPointerException in javac Flow

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux_redhat_6.0

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_51"
      Java(TM) SE Runtime Environment (build 1.8.0_51-b31)
      Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux wadev2 2.6.32-504.16.2.el6.x86_64 #1 SMP Tue Mar 10 17:01:00 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
      Red Hat Enterprise Linux Server release 6.7 (Santiago)

      A DESCRIPTION OF THE PROBLEM :
      An exception has occurred in the compiler (1.8.0_51). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.NullPointerException
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitIdent(Flow.java:2377)
              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$AbstractAssignAnalyzer.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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExpr(Flow.java:1624)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExprs(Flow.java:1636)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitApply(Flow.java:2233)
              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$AbstractAssignAnalyzer.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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitBlock(Flow.java:1843)
              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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitMethodDef(Flow.java:1780)
              at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitMethodDef(Flow.java:2546)
              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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitClassDef(Flow.java:1733)
              at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitClassDef(Flow.java:2525)
              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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2420)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2403)
              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.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
              at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
              at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
              at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
              at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785)
              at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.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(LifecycleModuleBuilder.java:116)
              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
              at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.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.java: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.java:415)
              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      compile the attached program

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The program should either compile or emit a user freindly error message. (Not a NullPointerException)
      ACTUAL -
      java.lang.NullPointerException

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      An exception has occurred in the compiler (1.8.0_51). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.NullPointerException
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitIdent(Flow.java:2377)
              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$AbstractAssignAnalyzer.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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExpr(Flow.java:1624)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExprs(Flow.java:1636)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitApply(Flow.java:2233)
              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$AbstractAssignAnalyzer.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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitBlock(Flow.java:1843)
              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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitMethodDef(Flow.java:1780)
              at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitMethodDef(Flow.java:2546)
              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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitClassDef(Flow.java:1733)
              at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitClassDef(Flow.java:2525)
              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$AbstractAssignAnalyzer.scan(Flow.java:1382)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2420)
              at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2403)
              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.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
              at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
              at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
              at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
              at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785)
              at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.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(LifecycleModuleBuilder.java:116)
              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
              at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.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.java: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.java:415)
              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package edu.uark.util.bugreport;

      import java.util.function.*;
      import javax.servlet.*;

      /**
       * @author Michael Akerman
       */
      public final class BugReport
      {
      static volatile BugReport instance = new BugReport( "bugs@uark.edu" );

      public static BugReport getInstance()
      {
      return instance;
      }

      public static BugReport getInstance( final FilterConfig fc )
      {
      instance = new BugReport(fc);
      return instance;
      }

      public static BugReport getInstance( final ServletConfig sc )
      {
      instance = new BugReport(sc);
      return instance;
      }

      public static BugReport getInstance( final ServletContext sc )
      {
      instance = new BugReport(sc);
      return instance;
      }

      private BugReport( final FilterConfig fc )
      {
      this( fc::getInitParmeter );
      }

      private BugReport( final ServletConfig sc )
      {
      this( sc::getInitParmeter );
      }

      private BugReport( final ServletContext sc )
      {
      this( sc::getInitParmeter );
      }

      private BugReport( final Function<String,String> function )
      {
      this( function.apply( "developerEmail" ) );
      }

      final String to;

      private BugReport( final String to )
      {
      this.to = to;
      }
      }
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aroy Abhijit Roy (Inactive)
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: