JDK-6407011 : javac crashes in b78 with NPE in DefaultFileManager:293
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS:
    generic,linux,windows_2003,windows_xp generic,linux,windows_2003,windows_xp
  • CPU: generic,x86
  • Submitted: 2006-03-31
  • Updated: 2010-04-02
  • Resolved: 2006-04-06
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 6
6 b79Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
http://blogs.sun.com/ahe?entry=update_on_b78#comment1

javac crashes in b78 with NPE in DefaultFileManager:293
$ cat Test.java
public class Test {}
$ new javac -sourcepath /xyz Test.java
An exception has occurred in the compiler (1.6.0-internal). 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.util.DefaultFileManager.listAll(DefaultFileManager.java:293)
        at com.sun.tools.javac.util.DefaultFileManager.list(DefaultFileManager.java:700)
        at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1954)
        at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1703)
        at com.sun.tools.javac.code.Symbol.complete(Symbol.java:380)
        at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:259)
        at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:445)
        at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:223)
        at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:237)
        at com.sun.tools.javac.comp.Enter.complete(Enter.java:431)
        at com.sun.tools.javac.comp.Enter.main(Enter.java:416)
        at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:727)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:634)
        at com.sun.tools.javac.main.Main.compile(Main.java:333)
        at com.sun.tools.javac.main.Main.compile(Main.java:255)
        at com.sun.tools.javac.main.Main.compile(Main.java:246)
        at com.sun.tools.javac.Main.compile(Main.java:70)
        at com.sun.tools.javac.Main.main(Main.java:55)

Comments
WORK AROUND Do not use -sourcepath with only missing files, that is, do not do this: javac -sourcepath MISSING Foo.java
31-03-2006

SUGGESTED FIX Webrev of changes: http://sa.sfbay/projects/langtools/bugid_summary.pl?bugid=6407011 Workspace: /net/hest.sfbay/u/ws/6407011-b78_crash.ws/
31-03-2006

SUGGESTED FIX --- /tmp/geta24682 2006-03-31 08:33:25.713532544 -0800 +++ DefaultFileManager.java 2006-03-31 08:29:54.472646040 -0800 @@ -290,6 +290,8 @@ Set<JavaFileObject.Kind> fileKinds, boolean recurse, ListBuffer<JavaFileObject> l) { + if (directories == null) + return; for (File directory : directories) list(directory, subdirectory, fileKinds, recurse, l); }
31-03-2006

EVALUATION A bug caused by 6327885.
31-03-2006