JDK-6502704 : NullPointerException thrown from the compiler used via JSR199
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-12-09
  • Updated: 2011-01-19
  • Resolved: 2006-12-21
Related Reports
Relates :  
Description
Java compiler is used via JSR199 just like in CR6499662.
When an annotation source (attached to CR) was passed a NullPointerException occured:
------------------------------------------------
An exception has occurred in the compiler (1.6.0-rc). 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.code.Scope$ImportScope.lookup(Scope.java:390)
	at com.sun.tools.javac.code.Scope.includes(Scope.java:253)
	at com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:131)
	at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:509)
	at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
	at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
	at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
	at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
	at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
	at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
	at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
	at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
	at com.sun.tools.javac.main.Main.compile(Main.java:353)
	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
	at javasoft.sqe.jck.jsr269.modelapi.io.Saving2XML.allEntitiesIn(Saving2XML.java:244)
	at javasoft.sqe.jck.jsr269.modelapi.io.Saving2XML.all(Saving2XML.java:195)
Another NPE that was thrown and is also almost unreproducible looks the following way:

An exception has occurred in the compiler (1.6.0). Please file a bug at the Java Developer Connection (http://java.sun.c
om/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic i
n your report.  Thank you.
java.lang.NullPointerException
        at com.sun.tools.javac.tree.TreeMaker.at(TreeMaker.java:101)
        at com.sun.tools.javac.comp.Lower.make_at(Lower.java:458)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:1900)
        at com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:2010)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:575)
        at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:44)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:1901)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:1921)
        at com.sun.tools.javac.comp.Lower.translateTopLevelClass(Lower.java:3101)
        at com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1199)
        at com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1118)
        at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:765)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
        at com.sun.tools.javac.main.Main.compile(Main.java:353)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
        at CCException.main(CCException.java:23)