JDK-7073508 : Regression: NullPointerException at com.sun.tools.javac.code.Lint$AugmentVisitor.augment
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7,7u1
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,linux_redhat_5.0,windows_7
  • CPU: x86
  • Submitted: 2011-08-01
  • Updated: 2013-08-01
  • Resolved: 2012-04-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u2Fixed 8 b06Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux piv 2.6.35-30-generic #54-Ubuntu SMP Tue Jun 7 18:41:54 UTC 2011 x86_64 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
Information:java.lang.AssertionError: java.lang.NullPointerException
Information:	at com.sun.tools.javac.code.Symbol$VarSymbol.getConstValue(Symbol.java:1005)
Information:	at com.sun.tools.javac.comp.Attr.checkInit(Attr.java:2627)
Information:	at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:2285)
Information:	at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1677)
Information:	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:431)
Information:	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418)
Information:	at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:449)
Information:	at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:203)
Information:	at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:243)
Information:	at com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:181)
Information:	at com.sun.tools.javac.comp.MemberEnter.enterAnnotations(MemberEnter.java:778)
Information:	at com.sun.tools.javac.comp.MemberEnter.access$300(MemberEnter.java:56)
Information:	at com.sun.tools.javac.comp.MemberEnter$5.enterAnnotation(MemberEnter.java:746)
Information:	at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:109)
Information:	at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:101)
Information:	at com.sun.tools.javac.comp.Enter.complete(Enter.java:510)
Information:	at com.sun.tools.javac.comp.Enter.main(Enter.java:469)
Information:	at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:929)
Information:	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
Information:	at com.sun.tools.javac.main.Main.compile(Main.java:417)
Information:	at com.sun.tools.javac.main.Main.compile(Main.java:331)
Information:	at com.sun.tools.javac.main.Main.compile(Main.java:322)
Information:	at com.sun.tools.javac.Main.compile(Main.java:76)
Information:	at com.sun.tools.javac.Main.main(Main.java:61)
Information:	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Information:	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
Information:	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Information:	at java.lang.reflect.Method.invoke(Method.java:601)
Information:	at com.intellij.rt.compiler.JavacRunner.main(JavacRunner.java:71)
Information:Caused by: java.lang.NullPointerException
Information:	at com.sun.tools.javac.code.Lint$AugmentVisitor.augment(Lint.java:290)
Information:	at com.sun.tools.javac.code.Lint.augment(Lint.java:82)
Information:	at com.sun.tools.javac.comp.Attr.attribLazyConstantValue(Attr.java:597)
Information:	at com.sun.tools.javac.code.Symbol$VarSymbol$1.call(Symbol.java:971)
Information:	at com.sun.tools.javac.code.Symbol$VarSymbol.getConstValue(Symbol.java:1003)
Information:	... 28 more

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Try to compile the following code under Intellij Idea 10.5.1 using jdk 1.7

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It is compiled
ACTUAL -
Yet it doesn't

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Compiler internal error. Process terminated with exit code 4

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------

import org.jetbrains.annotations.NotNull;

@CompilerBugTest.TestAnnotation(paths = CompilerBugTest.DATA_FOLDER)
public class CompilerBugTest {
  @NotNull
  public static final String DATA_FOLDER = "resourceDB/testData/oldTests/data";

  public @interface TestAnnotation {
    @NotNull String[] paths();
  }
}
---------- END SOURCE ----------

Comments
EVALUATION Swallow NPE for now. Need to re-evaluate annotation handling for a complete solution.
11-08-2011