JDK-8177014 : tools/javac/tree/TreePosTest.java test fails with IllegalArgumentException
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2017-03-16
  • Updated: 2017-03-25
  • Resolved: 2017-03-17
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 10 JDK 9
10Fixed 9 b162Fixed
Related Reports
Relates :  
Description
The test fails with the following exception:

java.lang.IllegalArgumentException: Not a valid class name: -proc:none
	at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:151)
	at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:119)
	at TreePosTest.read(TreePosTest.java:284)
	at TreePosTest.test(TreePosTest.java:251)
	at TreePosTest.test(TreePosTest.java:240)
	at TreePosTest.test(TreePosTest.java:240)
	at TreePosTest.test(TreePosTest.java:240)
	at TreePosTest.test(TreePosTest.java:240)
	at TreePosTest.test(TreePosTest.java:240)
	at TreePosTest.test(TreePosTest.java:240)
	at TreePosTest.run(TreePosTest.java:187)
	at TreePosTest.main(TreePosTest.java:125)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:547)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.base/java.lang.Thread.run(Thread.java:844)
Comments
Doh!
16-03-2017

I think this would fix the test: - JavacTask task = tool.getTask(pw, fm, r, Collections.<String>emptyList(), - List.of("-proc:none"), files); + JavacTask task = tool.getTask(pw, fm, r, List.of("-proc:none"), null, files);
16-03-2017

This seems to be caused by JDK-8176900 which is a test bug. This one looks like a test bug as well. Jonathan, Could you please take a look?
16-03-2017