-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b85
-
generic
-
generic
-
Verified
The method JavaCompilerTool.run fails to handle null arguments.
<code>
import javax.tools.JavaCompilerTool;
import javax.tools.ToolProvider;
public class Foo {
public static void main(String... arg) {
JavaCompilerTool jct = ToolProvider.getSystemJavaCompilerTool();
jct.run(null,null,null,"Foo.java",null);
}
}
</code>
<output>
E:\MustangTestDev\tools\jsr199\ToolTest\ToolTest01>java Foo
An exception has occurred in the compiler (1.6.0-auto). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) af
ter 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.main.CommandLine.parse(CommandLine.java:47)
at com.sun.tools.javac.main.Main.compile(Main.java:288)
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:88)
at com.sun.tools.javac.api.JavacTool.run(JavacTool.java:304)
at Foo.main(Foo.java:7)
</output>
<java-version>
java version "1.6.0-auto"
Java(TM) SE Runtime Environment (build 1.6.0-auto-087)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b78, mixed mode)
</java-version>
<code>
import javax.tools.JavaCompilerTool;
import javax.tools.ToolProvider;
public class Foo {
public static void main(String... arg) {
JavaCompilerTool jct = ToolProvider.getSystemJavaCompilerTool();
jct.run(null,null,null,"Foo.java",null);
}
}
</code>
<output>
E:\MustangTestDev\tools\jsr199\ToolTest\ToolTest01>java Foo
An exception has occurred in the compiler (1.6.0-auto). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) af
ter 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.main.CommandLine.parse(CommandLine.java:47)
at com.sun.tools.javac.main.Main.compile(Main.java:288)
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:88)
at com.sun.tools.javac.api.JavacTool.run(JavacTool.java:304)
at Foo.main(Foo.java:7)
</output>
<java-version>
java version "1.6.0-auto"
Java(TM) SE Runtime Environment (build 1.6.0-auto-087)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b78, mixed mode)
</java-version>
- relates to
-
JDK-6409829 JSR 199: enforce the use of valid package and class names in get{Java,}FileFor{Input,Output}
-
- Closed
-
-
JDK-8154448 I am uploading a .java file through UI and this file is complied and loading successfully in web application. But, when I give it to Quartz
-
- Closed
-