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

JSR 199: The method JavaCompilerTool.run fails to handle null arguments

XMLWordPrintable

    • 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>

            ahe Peter Ahe
            savadhansunw Seetharama Avadhanam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: