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

NPE from Lint$AugmentVisitor.augment -> AE from Symbol$VarSymbol.getConstValue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 7u1
    • tools
    • x86
    • linux

      After applying the following patch

      diff --git a/java.project/src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java b/java.project/src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java
      --- a/java.project/src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java
      +++ b/java.project/src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java
      @@ -134,6 +134,7 @@
            * @see #createJavaTemplateIterator
            * @since 1.40
            */
      + @org.netbeans.api.annotations.common.NonNull
           public static final String JAVA_ICON = "org/netbeans/spi/java/project/support/ui/templates/class.png";
           
       }

      to https://hg.netbeans.org/core-main/ @21b5127751a3, I cannot compile the java.project module using JDK 7 javac (with JDK 6 as the boot CP). It works using JDK 6 javac.

      $ JAVA_HOME=/space/jdk6 ant -f java.project/build.xml clean netbeans
      ...
      16 warnings
      ...
      BUILD SUCCESSFUL
      Total time: 6 seconds
      $ JAVA_HOME=/space/jdk7 ant -f java.project/build.xml clean netbeans
      Compiling 51 source files to /space/src/nb/main/java.project/build/classes
      An exception has occurred in the compiler (1.7.0_01). 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.AssertionError: java.lang.NullPointerException
      at com.sun.tools.javac.code.Symbol$VarSymbol.getConstValue(Symbol.java:1005)
      at com.sun.tools.javac.comp.Attr.checkInit(Attr.java:2627)
      at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:2285)
      at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1677)
      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:431)
      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418)
      at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:449)
      at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:203)
      at com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:181)
      at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:229)
      at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:243)
      at com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:181)
      at com.sun.tools.javac.comp.MemberEnter.enterAnnotations(MemberEnter.java:778)
      at com.sun.tools.javac.comp.MemberEnter.access$300(MemberEnter.java:56)
      at com.sun.tools.javac.comp.MemberEnter$5.enterAnnotation(MemberEnter.java:746)
      at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:109)
      at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:101)
      at com.sun.tools.javac.comp.Enter.complete(Enter.java:510)
      at com.sun.tools.javac.comp.Enter.main(Enter.java:469)
      at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:929)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
      at com.sun.tools.javac.main.Main.compile(Main.java:417)
      at com.sun.tools.javac.main.Main.compile(Main.java:331)
      at com.sun.tools.javac.main.Main.compile(Main.java:322)
      at com.sun.tools.javac.Main.compile(Main.java:76)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
      at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1134)
      at org.netbeans.nbbuild.CustomJavac.compile(CustomJavac.java:106)
      at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:912)
      at org.netbeans.nbbuild.CustomJavac.execute(CustomJavac.java:87)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:390)
      at org.apache.tools.ant.Target.performTasks(Target.java:411)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
      at org.apache.tools.ant.Main.runBuild(Main.java:809)
      at org.apache.tools.ant.Main.startAnt(Main.java:217)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
      Caused by: java.lang.NullPointerException
      at com.sun.tools.javac.code.Lint$AugmentVisitor.augment(Lint.java:290)
      at com.sun.tools.javac.code.Lint.augment(Lint.java:82)
      at com.sun.tools.javac.comp.Attr.attribLazyConstantValue(Attr.java:597)
      at com.sun.tools.javac.code.Symbol$VarSymbol$1.call(Symbol.java:971)
      at com.sun.tools.javac.code.Symbol$VarSymbol.getConstValue(Symbol.java:1003)
      ... 49 more
      BUILD FAILED

      Here the JAVA_ICON constant is being used as the value of the iconBase attribute in several annotations (handled by a processor) in NewJavaFileWizardIterator.java in the same source root.

            Unassigned Unassigned
            jglick Jesse Glick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: