Community
Participate
Working Groups
It is now possible to launch the compiler via the javax.tools.JavaCompiler interface. This corresponds to functionality in javac version 6.0. I think that when the compiler is launched this way, we should default to the "-6.0" option. This interface is only available on a 1.6 JVM anyway, and I do not think that anyone launching a compiler this way is going to expect it to default to an earlier compliance level.
The default compliance of the tool compiler is 1.6. So you are right, we should also set the default to be 1.6. This could of course be overridden with the options passed to the compilation unit task.
Released for 3.3M6. Added check in test org.eclipse.jdt.compiler.tool.tests.CompilerToolTests#testCompilerOneClassWithEclipseCompiler2
Verified for 3.3 M6 using v_744. I could see by stepping in the code that we set the default to 1.6, hence I consider the bug as verified. Yet, I could not get how the test is supposed to check that. More precisely, I modified it to explicitly set the compliance level to 1.5 (added options.add("-1.5"); at CompilerToolTests#434), and I got no error. Could you explain please? The test is also flushing lines in the console when performing as expected. I suggest you remove that behavior.
Regression test has been improved.