setOption() and setExtendedOption() of JavacTool throws NullPointerException for undefined options
Please see the following code:
<code>
import javax.tools.*;
public class Test1 {
public static void test(String... args) {
JavacTool javac = com.sun.tools.javac.Tool.create();
javac.setOption("seetharam",".");
javac.setExtendedOption("seetharam",".");
}
public static void main(String... arg){
Test1 test = new Test1();
test.test();
}
}
</code>
Output of the code:
<output>
bash-2.05b$ $b/javac Test1.java
bash-2.05b$ $b/java Test1
Exception in thread "main" java.lang.NullPointerException
at com.sun.tools.javac.Tool.setOption1(Tool.java:142)
at com.sun.tools.javac.Tool.setOption(Tool.java:157)
at Test1.test(Test1.java:5)
at Test1.main(Test1.java:9)
</output>
###@###.### 2005-04-19 09:08:13 GMT
Please see the following code:
<code>
import javax.tools.*;
public class Test1 {
public static void test(String... args) {
JavacTool javac = com.sun.tools.javac.Tool.create();
javac.setOption("seetharam",".");
javac.setExtendedOption("seetharam",".");
}
public static void main(String... arg){
Test1 test = new Test1();
test.test();
}
}
</code>
Output of the code:
<output>
bash-2.05b$ $b/javac Test1.java
bash-2.05b$ $b/java Test1
Exception in thread "main" java.lang.NullPointerException
at com.sun.tools.javac.Tool.setOption1(Tool.java:142)
at com.sun.tools.javac.Tool.setOption(Tool.java:157)
at Test1.test(Test1.java:5)
at Test1.main(Test1.java:9)
</output>
###@###.### 2005-04-19 09:08:13 GMT