diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/APTTestBase.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/APTTestBase.java index 5e3a022d36e..a0b0f9336dd 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/APTTestBase.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/APTTestBase.java @@ -33,6 +33,7 @@ import org.eclipse.jdt.core.tests.builder.BuilderTests; import org.eclipse.jdt.core.tests.builder.Problem; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import com.sun.mirror.apt.AnnotationProcessor; @@ -96,7 +97,7 @@ protected IJavaProject getCurrentJavaProject() { protected IJavaProject createJavaProject(final String projectName ) throws Exception { - IPath projectPath = env.addProject( projectName, "1.5" ); + IPath projectPath = env.addProject( projectName, CompilerOptions.getFirstSupportedJavaVersion() ); env.addExternalJars( projectPath, Util.getJavaClassLibs() ); // remove old package fragment root so that names don't collide env.removePackageFragmentRoot( projectPath, "" ); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AnnotationValueConversionTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AnnotationValueConversionTests.java index ce3dc379358..a30ef1ccdec 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AnnotationValueConversionTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AnnotationValueConversionTests.java @@ -21,6 +21,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.jdt.apt.tests.annotations.ProcessorTestStatus; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public class AnnotationValueConversionTests extends APTTestBase { @@ -67,7 +68,7 @@ private IProject setupTest() throws Exception { ProcessorTestStatus.reset(); // project will be deleted by super-class's tearDown() method - IPath projectPath = env.addProject( getUniqueProjectName(), "1.5" ); //$NON-NLS-1$ + IPath projectPath = env.addProject( getUniqueProjectName(), CompilerOptions.getFirstSupportedJavaVersion() ); //$NON-NLS-1$ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ env.addExternalJars( projectPath, Util.getJavaClassLibs() ); fullBuild( projectPath ); diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AptBuilderTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AptBuilderTests.java index b510cb5821b..5ccdb63cfea 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AptBuilderTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AptBuilderTests.java @@ -30,6 +30,7 @@ import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public class AptBuilderTests extends APTTestBase { @@ -53,7 +54,7 @@ public void setUp() throws Exception // project will be deleted by super-class's tearDown() method // create a project with a src directory as the project root directory // - IPath projectPath = env.addProject( getProjectName_ProjectRootAsSrcDir(), "1.5" ); + IPath projectPath = env.addProject( getProjectName_ProjectRootAsSrcDir(), CompilerOptions.getFirstSupportedJavaVersion() ); env.addExternalJars( projectPath, Util.getJavaClassLibs() ); fullBuild( projectPath ); diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AptReconcileTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AptReconcileTests.java index 003e3a9ee90..c46833db230 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AptReconcileTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AptReconcileTests.java @@ -29,6 +29,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.WorkingCopyOwner; import org.eclipse.jdt.core.tests.model.ModifyingResourceTests; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public class AptReconcileTests extends ModifyingResourceTests { @@ -490,8 +491,8 @@ public void setUp() throws Exception this._problemRequestor = new ProblemRequestor(); final IJavaProject project = createJavaProject( _testProject, - new String[] { "src" }, new String[] { "JCL15_LIB" }, - "bin", "1.5" ); + new String[] { "src" }, new String[] { "JCL18_LIB" }, + "bin", CompilerOptions.getFirstSupportedJavaVersion() ); TestUtil.createAndAddAnnotationJar(project); AptConfig.setEnabled(project, true); diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/JavaVersionTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/JavaVersionTests.java deleted file mode 100644 index 80f763018f1..00000000000 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/JavaVersionTests.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2008 BEA Systems, Inc. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * jgarms@bea.com - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.jdt.apt.tests; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jdt.apt.tests.annotations.ProcessorTestStatus; -import org.eclipse.jdt.apt.tests.annotations.mirrortest.CodeExample; -import org.eclipse.jdt.core.tests.builder.BuilderTests; -import org.eclipse.jdt.core.tests.util.Util; - -/** - * Test that processors do not get invoked on pre-1.5 projects - */ -public class JavaVersionTests extends BuilderTests { - - public JavaVersionTests(final String name) { - super( name ); - } - - public static Test suite() { - return new TestSuite( JavaVersionTests.class ); - } - - public void setUp() throws Exception { - super.setUp(); - - // project will be deleted by super-class's tearDown() method - IPath projectPath = env.addProject( getProjectName(), "1.4" ); //$NON-NLS-1$ - env.addExternalJars( projectPath, Util.getJavaClassLibs() ); - fullBuild( projectPath ); - - // remove old package fragment root so that names don't collide - env.removePackageFragmentRoot( projectPath, "" ); //$NON-NLS-1$ - - env.addPackageFragmentRoot( projectPath, "src" ); //$NON-NLS-1$ - env.setOutputFolder( projectPath, "bin" ); //$NON-NLS-1$ - - TestUtil.createAndAddAnnotationJar( env - .getJavaProject( projectPath ) ); - } - - public static String getProjectName() { - return JavaVersionTests.class.getName() + "Project"; //$NON-NLS-1$ - } - - public IPath getSourcePath() { - IProject project = env.getProject( getProjectName() ); - IFolder srcFolder = project.getFolder( "src" ); //$NON-NLS-1$ - IPath srcRoot = srcFolder.getFullPath(); - return srcRoot; - } - - /** - * Runs the MirrorTestAnnotationProcessor, which contains - * the actual tests - */ - public void testMirror() throws Exception { - ProcessorTestStatus.reset(); - - IProject project = env.getProject( getProjectName() ); - IPath srcRoot = getSourcePath(); - - String code = CodeExample.CODE; - - env.addClass( - srcRoot, - CodeExample.CODE_PACKAGE, - CodeExample.CODE_CLASS_NAME, - code ); - - fullBuild( project.getFullPath() ); - - assertFalse("Processor was run", ProcessorTestStatus.processorRan()); //$NON-NLS-1$ - } - -} diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/MirrorTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/MirrorTests.java index cc74657628f..ffcc16e3b95 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/MirrorTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/MirrorTests.java @@ -26,6 +26,7 @@ import org.eclipse.jdt.apt.tests.annotations.mirrortest.CodeExample; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public class MirrorTests extends APTTestBase { @@ -66,7 +67,7 @@ public void testMirror() throws Exception { public void testTypeParmaterAPI() throws Exception{ final String projName = MirrorTests.class.getName() + "TypeParameter.Project"; //$NON-NLS-1$ - IPath projectPath = env.addProject( projName, "1.5" ); //$NON-NLS-1$ + IPath projectPath = env.addProject( projName, CompilerOptions.getFirstSupportedJavaVersion() ); //$NON-NLS-1$ env.addExternalJars( projectPath, Util.getJavaClassLibs() ); env.removePackageFragmentRoot( projectPath, "" ); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/PerfTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/PerfTests.java index c06a63684a7..95f1aafe978 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/PerfTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/PerfTests.java @@ -37,6 +37,7 @@ import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.tests.builder.BuilderTests; import org.eclipse.jdt.core.tests.builder.Problem; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import junit.framework.Test; import junit.framework.TestSuite; @@ -75,7 +76,7 @@ public void setUp() throws Exception } // project will be deleted by super-class's tearDown() method - projectPath = env.addProject( "org.eclipse.jdt.core", "1.4" ); //$NON-NLS-1$ //$NON-NLS-2$ + projectPath = env.addProject( "org.eclipse.jdt.core", CompilerOptions.getFirstSupportedJavaVersion() ); //$NON-NLS-1$ //$NON-NLS-2$ System.out.println("Performing full build..."); //$NON-NLS-1$ fullBuild( projectPath ); diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/PreferencesTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/PreferencesTests.java index e31dbff9954..6eafb932f79 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/PreferencesTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/PreferencesTests.java @@ -39,6 +39,7 @@ import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public class PreferencesTests extends APTTestBase { @@ -220,10 +221,10 @@ public void testAutomaticOptions() throws Exception { assertTrue(sourcepath.length() > 0); String target = options.get("-target"); - assertEquals(target, "1.5"); + assertEquals(target, CompilerOptions.getFirstSupportedJavaVersion()); String source = options.get("-source"); - assertEquals(source, "1.5"); + assertEquals(source, CompilerOptions.getFirstSupportedJavaVersion()); String bindir = options.get("-d"); assertNotNull(bindir); @@ -264,7 +265,7 @@ public void testGenSrcDir() throws Exception { public void testConfigGenSrcDir() throws Exception { final String projectName = "ConfigTestProj"; - IPath projectPath = env.addProject( projectName, "1.5" ); + IPath projectPath = env.addProject( projectName, CompilerOptions.getFirstSupportedJavaVersion() ); env.addExternalJars( projectPath, Util.getJavaClassLibs() ); final IJavaProject javaProj = env.getJavaProject(projectName); // APT is not enabled diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/ReadAnnotationTests2.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/ReadAnnotationTests2.java index c258fdf4a67..2c3ec1b7210 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/ReadAnnotationTests2.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/ReadAnnotationTests2.java @@ -38,6 +38,7 @@ import org.eclipse.jdt.core.dom.IVariableBinding; import org.eclipse.jdt.core.tests.builder.BuilderTests; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; /** * This test the dom layer of annotation support. No APT involved. @@ -138,7 +139,7 @@ private void addAllSources() private IProject setupTest() throws Exception { // project will be deleted by super-class's tearDown() method - IPath projectPath = env.addProject( getUniqueProjectName(), "1.5" ); //$NON-NLS-1$ + IPath projectPath = env.addProject( getUniqueProjectName(), CompilerOptions.getFirstSupportedJavaVersion() ); //$NON-NLS-1$ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ env.addExternalJars( projectPath, Util.getJavaClassLibs() ); diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/RegressionTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/RegressionTests.java index ca55e037111..f8932317642 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/RegressionTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/RegressionTests.java @@ -28,6 +28,7 @@ import org.eclipse.jdt.apt.core.util.IFactoryPath; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public class RegressionTests extends APTTestBase { @@ -53,7 +54,7 @@ public void testBugzilla104032() throws Exception { // set up project with unique name final String projName = RegressionTests.class.getName() + "104032.Project"; //$NON-NLS-1$ - IPath projectPath = env.addProject( projName, "1.5" ); //$NON-NLS-1$ + IPath projectPath = env.addProject( projName, CompilerOptions.getFirstSupportedJavaVersion() ); //$NON-NLS-1$ env.addExternalJars( projectPath, Util.getJavaClassLibs() ); env.removePackageFragmentRoot( projectPath, "" ); //$NON-NLS-1$ @@ -99,7 +100,7 @@ public void testBugzilla104032() throws Exception public void testBugzilla106541() throws Exception { final String projName = RegressionTests.class.getName() + "104032.Project"; //$NON-NLS-1$ - IPath projectPath = env.addProject( projName, "1.5" ); //$NON-NLS-1$ + IPath projectPath = env.addProject( projName, "1.8" ); //$NON-NLS-1$ env.addExternalJars( projectPath, Util.getJavaClassLibs() ); env.removePackageFragmentRoot( projectPath, "" ); //$NON-NLS-1$ @@ -131,7 +132,7 @@ public void testBugzilla106541() throws Exception // doesn't work because of a jdt.core type system universe problem. public void testBugzilla120255() throws Exception{ final String projName = RegressionTests.class.getName() + "120255.Project"; //$NON-NLS-1$ - IPath projectPath = env.addProject( projName, "1.5" ); //$NON-NLS-1$ + IPath projectPath = env.addProject( projName, "1.8" ); //$NON-NLS-1$ env.addExternalJars( projectPath, Util.getJavaClassLibs() ); env.removePackageFragmentRoot( projectPath, "" ); //$NON-NLS-1$ @@ -175,7 +176,7 @@ public void testBugzilla120255() throws Exception{ */ public void testBugzilla206591A() throws Exception { final String projName = RegressionTests.class.getName() + "206591.Project"; //$NON-NLS-1$ - IPath projectPath = env.addProject( projName, "1.5" ); //$NON-NLS-1$ + IPath projectPath = env.addProject( projName, "1.8" ); //$NON-NLS-1$ env.addExternalJars( projectPath, Util.getJavaClassLibs() ); env.removePackageFragmentRoot( projectPath, "" ); //$NON-NLS-1$ @@ -244,7 +245,7 @@ public void testBugzilla206591A() throws Exception { */ public void testBugzilla206591B() throws Exception { final String projName = RegressionTests.class.getName() + "206591.Project"; //$NON-NLS-1$ - IPath projectPath = env.addProject( projName, "1.5" ); //$NON-NLS-1$ + IPath projectPath = env.addProject( projName, "1.8" ); //$NON-NLS-1$ env.addExternalJars( projectPath, Util.getJavaClassLibs() ); env.removePackageFragmentRoot( projectPath, "" ); //$NON-NLS-1$ @@ -298,7 +299,7 @@ public void testBugzilla206591B() throws Exception { public void testBugzilla423254() throws Exception { final String projName = RegressionTests.class.getName() + "423254.Project"; //$NON-NLS-1$ - IPath projectPath = env.addProject(projName, "1.5"); //$NON-NLS-1$ + IPath projectPath = env.addProject(projName, "1.8"); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/ScalingTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/ScalingTests.java index 56be81408cf..0ae28ec4fb8 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/ScalingTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/ScalingTests.java @@ -26,6 +26,7 @@ import org.eclipse.jdt.apt.core.util.AptConfig; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; /** * @@ -61,7 +62,7 @@ public void testGeneratingLotsOfFiles() throws Exception // set up project with unique name final String projName = ScalingTests.class.getName() + "LotsOfFilesProject"; //$NON-NLS-1$ - IPath projectPath = env.addProject( projName, "1.5" ); //$NON-NLS-1$ + IPath projectPath = env.addProject( projName, CompilerOptions.getFirstSupportedJavaVersion() ); //$NON-NLS-1$ env.addExternalJars( projectPath, Util.getJavaClassLibs() ); env.removePackageFragmentRoot( projectPath, "" ); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/StarProcessorTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/StarProcessorTests.java index b3786a439e3..9c376d74161 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/StarProcessorTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/StarProcessorTests.java @@ -31,6 +31,7 @@ import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; /** * Tests for processors that return '*' from getSupportedAnnotations @@ -57,7 +58,7 @@ public void setUp() throws Exception // project will be deleted by super-class's tearDown() method // create a project with a src directory as the project root directory // - IPath projectPath = env.addProject( getProjectName_ProjectRootAsSrcDir(), "1.5" ); + IPath projectPath = env.addProject( getProjectName_ProjectRootAsSrcDir(), CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars( projectPath, Util.getJavaClassLibs() ); fullBuild( projectPath ); diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/TestAll.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/TestAll.java index 55d16f45062..ec7135c29fb 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/TestAll.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/TestAll.java @@ -54,7 +54,6 @@ public static Test suite() suite.addTest(MirrorDeclarationTests.suite()); suite.addTest(MirrorUtilTests.suite()); suite.addTest(AnnotationValueConversionTests.suite()); - suite.addTest(JavaVersionTests.suite()); suite.addTest(RegressionTests.suite()); suite.addTest(FileGenerationTests.suite()); suite.addTest(MixedModeTesting.suite()); diff --git a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerInvocationTests.java b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerInvocationTests.java index 743ef724222..92f53710d00 100644 --- a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerInvocationTests.java +++ b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerInvocationTests.java @@ -41,9 +41,9 @@ import javax.tools.StandardLocation; import org.eclipse.jdt.internal.compiler.batch.Main; -import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import junit.framework.Test; @@ -57,7 +57,7 @@ public CompilerInvocationTests(String name) { super(name); } public static Test suite() { - return buildUniqueComplianceTestSuite(CompilerInvocationTests.class, ClassFileConstants.JDK1_8); + return buildUniqueComplianceTestSuite(CompilerInvocationTests.class, CompilerOptions.getFirstSupportedJdkLevel()); } public static Class testClass() { return CompilerInvocationTests.class; @@ -81,7 +81,7 @@ protected void checkClassFiles(String[] fileNames) { fail("IO exception for file " + fileNames[i]); } assertNotNull("Could not read " + fileNames[i], reader); - assertEquals("Wrong Java version for " + fileNames[i], ClassFileConstants.JDK1_8, reader.getVersion()); + assertEquals("Wrong Java version for " + fileNames[i], CompilerOptions.getFirstSupportedJdkLevel(), reader.getVersion()); } } void runTest( diff --git a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java index 8c4cbe4d6ba..0b8dac323be 100644 --- a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java +++ b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java @@ -85,20 +85,9 @@ public CompilerToolTests(String name) { "-classNames" }; static final String[] ZERO_ARG_OPTIONS = { - "-1.3", - "-1.4", - "-1.5", - "-1.6", - "-1.7", "-1.8", "-8", "-8.0", - "-7", - "-7.0", - "-6", - "-6.0", - "-5", - "-5.0", "-deprecation", "-nowarn", "-warn:none", @@ -528,7 +517,7 @@ public JavaFileObject getJavaFileForOutput(Location location, List options = new ArrayList<>(); options.add("-d"); options.add(tmpFolder); - options.add("-1.5"); + options.add("-1.8"); CompilationTask task = compiler.getTask(printWriter, forwardingJavaFileManager, null, options, null, units); // check the classpath location assertTrue("Has no location CLASS_OUPUT", forwardingJavaFileManager.hasLocation(StandardLocation.CLASS_OUTPUT)); @@ -550,7 +539,7 @@ public JavaFileObject getJavaFileForOutput(Location location, assertTrue("Should not happen", false); } assertNotNull("No reader", reader); - assertEquals("Not a 1.5 .class file", ClassFileConstants.JDK1_5, reader.getVersion()); + assertEquals("Not a 1.8 .class file", ClassFileConstants.JDK1_8, reader.getVersion()); stringWriter = new StringWriter(); printWriter = new PrintWriter(stringWriter); diff --git a/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF index fde7acdde60..c32ea5e326a 100644 --- a/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF @@ -12,21 +12,143 @@ Bundle-RequiredExecutionEnvironment: JavaSE-17 Export-Package: META-INF.services, org.eclipse.jdt.core.compiler, org.eclipse.jdt.core.compiler.batch, - org.eclipse.jdt.internal.antadapter;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests, org.eclipse.jdt.apt.pluggable.core", - org.eclipse.jdt.internal.compiler.apt.dispatch;x-friends:="org.eclipse.jdt.apt.pluggable.core,org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler.apt.model;x-friends:="org.eclipse.jdt.apt.pluggable.core,org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler.apt.util;x-friends:="org.eclipse.jdt.apt.pluggable.core,org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler.ast;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests, org.eclipse.jdt.apt.pluggable.core", - org.eclipse.jdt.internal.compiler.batch;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler.classfmt;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests, org.eclipse.jdt.apt.pluggable.core", - org.eclipse.jdt.internal.compiler.codegen;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler.env;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests, org.eclipse.jdt.apt.pluggable.core", - org.eclipse.jdt.internal.compiler.flow;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler.impl;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests, org.eclipse.jdt.apt.pluggable.core", - org.eclipse.jdt.internal.compiler.lookup;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests, org.eclipse.jdt.apt.pluggable.core", - org.eclipse.jdt.internal.compiler.parser;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler.parser.diagnose;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler.problem;x-friends:="org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests, org.eclipse.jdt.apt.pluggable.core", - org.eclipse.jdt.internal.compiler.tool;x-friends:="org.eclipse.jdt.compiler.tool.tests,org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", - org.eclipse.jdt.internal.compiler.util;x-friends:="org.eclipse.jdt.core.internal.tools,org.eclipse.jdt.core, org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests, org.eclipse.jdt.apt.core" + org.eclipse.jdt.internal.antadapter; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests, + org.eclipse.jdt.apt.pluggable.core", + org.eclipse.jdt.internal.compiler.apt.dispatch; + x-friends:="org.eclipse.jdt.apt.pluggable.core, + org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler.apt.model; + x-friends:="org.eclipse.jdt.apt.pluggable.core, + org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler.apt.util; + x-friends:="org.eclipse.jdt.apt.pluggable.core, + org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler.ast; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests, + org.eclipse.jdt.apt.pluggable.core", + org.eclipse.jdt.internal.compiler.batch; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler.classfmt; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests, + org.eclipse.jdt.apt.pluggable.core", + org.eclipse.jdt.internal.compiler.codegen; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler.env; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests, + org.eclipse.jdt.apt.pluggable.core", + org.eclipse.jdt.internal.compiler.flow; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler.impl; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests, + org.eclipse.jdt.apt.pluggable.core, + org.eclipse.jdt.apt.tests", + org.eclipse.jdt.internal.compiler.lookup; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests, + org.eclipse.jdt.apt.pluggable.core", + org.eclipse.jdt.internal.compiler.parser; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler.parser.diagnose; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler.problem; + x-friends:="org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests, + org.eclipse.jdt.apt.pluggable.core", + org.eclipse.jdt.internal.compiler.tool; + x-friends:="org.eclipse.jdt.compiler.tool.tests, + org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests", + org.eclipse.jdt.internal.compiler.util; + x-friends:="org.eclipse.jdt.core.internal.tools, + org.eclipse.jdt.core, + org.eclipse.jdt.core.tests.model, + org.eclipse.jdt.core.tests.compiler, + org.eclipse.jdt.core.tests.builder, + org.eclipse.jdt.core.tests.performance, + org.eclipse.jdt.ui.tests, + org.eclipse.jdt.apt.core" diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java index 7e67248b886..f457cfaaacd 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java @@ -811,6 +811,7 @@ public boolean handleOption(String current, Iterator remaining) { } case "-extdirs": //$NON-NLS-1$ if (this.isOnJvm9) { + // XXX this should check -target == 8, not the running JVM version! throw new IllegalArgumentException(); } if (remaining.hasNext()) { diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AbstractMethodTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AbstractMethodTests.java index 2610aa75d8c..d1488b1133f 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AbstractMethodTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AbstractMethodTests.java @@ -25,7 +25,6 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IRegion; @@ -37,6 +36,7 @@ import org.eclipse.jdt.core.tests.util.Util; import org.eclipse.jdt.core.util.IClassFileReader; import org.eclipse.jdt.core.util.IMethodInfo; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; @SuppressWarnings({"rawtypes", "unchecked"}) public class AbstractMethodTests extends BuilderTests { @@ -163,7 +163,7 @@ public void test002() throws JavaModelException { //---------------------------- IPath project1Path = env.addProject("Project1"); //$NON-NLS-1$ env.addExternalJars(project1Path, Util.getJavaClassLibs()); - env.getJavaProject(project1Path).setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_1); // need default abstract method + env.getJavaProject(project1Path).setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.getFirstSupportedJavaVersion()); // need default abstract method // remove old package fragment root so that names don't collide env.removePackageFragmentRoot(project1Path, ""); //$NON-NLS-1$ @@ -241,7 +241,7 @@ public void test002() throws JavaModelException { /** * Check behavior in 1.1 target mode (generated default abstract method) */ - public void test003() throws JavaModelException { + public void test003() throws Exception { //---------------------------- // Step 1 //---------------------------- @@ -250,7 +250,7 @@ public void test003() throws JavaModelException { //---------------------------- IPath project1Path = env.addProject("Project1"); //$NON-NLS-1$ env.addExternalJars(project1Path, Util.getJavaClassLibs()); - env.getJavaProject(project1Path).setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_1); // need default abstract method + env.getJavaProject(project1Path).setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8); // need default abstract method // remove old package fragment root so that names don't collide env.removePackageFragmentRoot(project1Path, ""); //$NON-NLS-1$ @@ -292,8 +292,6 @@ public void test003() throws JavaModelException { try { stream = classFile.getContents(); classFileReader = ToolFactory.createDefaultClassFileReader(stream, IClassFileReader.ALL); - } catch (CoreException e) { - e.printStackTrace(); } finally { if (stream != null) { try { @@ -313,8 +311,7 @@ public void test003() throws JavaModelException { break loop; } } - assertNotNull("No method found", found); - assertTrue("Not a synthetic method", found.isSynthetic()); + assertNull("Should not find a 'foo' method", found); } private String getResourceOuput(IResource[] resources) { diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AnnotationDependencyTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AnnotationDependencyTests.java index 00d77894b75..83fb8ea4502 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AnnotationDependencyTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AnnotationDependencyTests.java @@ -31,6 +31,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.compiler.CategorizedProblem; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.osgi.framework.Bundle; /** @@ -52,7 +53,7 @@ public static Test suite() { public void setUp() throws Exception { super.setUp(); - this.projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ + this.projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(this.projectPath, Util.getJavaClassLibs()); // remove old package fragment root so that names don't collide diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java index db417116ddb..ce5594adc45 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java @@ -28,6 +28,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.compiler.CategorizedProblem; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.core.JavaModelManager; /** @@ -614,7 +615,7 @@ public void testbBug386901() throws JavaModelException { } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=425420 public void testBug425420() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ // don't env.addExternalJars(projectPath, Util.getJavaClassLibs()); // remove old package fragment root so that names don't collide diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java index c5b79bad4f0..ecdc1695a35 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java @@ -35,6 +35,7 @@ import org.eclipse.jdt.core.tests.util.TestVerifier; import org.eclipse.jdt.core.tests.util.Util; import org.eclipse.jdt.internal.compiler.Compiler; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import junit.framework.Test; import junit.framework.TestSuite; @@ -626,7 +627,7 @@ public static Test suite() { static IPath addEmptyInternalJar(IPath projectPath, String jarName) throws IOException, JavaModelException { IProject project = env.getProject(projectPath); String jarFile = project.getLocation().append(jarName).toOSString(); - Util.createEmptyJar(jarFile, JavaCore.VERSION_1_4); + Util.createEmptyJar(jarFile, CompilerOptions.getFirstSupportedJavaVersion()); IPath jarPath = null; try (FileInputStream fis = new FileInputStream(jarFile)) { int length = fis.available(); diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests11.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests11.java index a72ba5afa00..3586462d05c 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests11.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests11.java @@ -40,16 +40,6 @@ public void testBuildWithRelease_1_8() throws JavaModelException, Exception { runTest(compliance); } - public void testBuildWithRelease_1_7() throws JavaModelException, Exception { - String compliance = "1.7"; - runTest(compliance); - } - - public void testBuildWithRelease_1_6() throws JavaModelException, Exception { - String compliance = "1.6"; - runTest(compliance); - } - // TODO: this test fails in 4.25 M1, probably also before. // Cannot find the class file for java.lang.Object public void XtestBuilderWithRelease_9() throws JavaModelException, Exception { diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java index 30854f39544..b42e52d6ff9 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java @@ -367,7 +367,7 @@ public void testChangeZIPArchive1() throws Exception { "}" }, externalLib, - "1.4"); + CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.addExternalJars(projectPath, new String[] {externalLib}); @@ -395,7 +395,7 @@ public void testChangeZIPArchive1() throws Exception { "}" }, externalLib, - "1.4"); + CompilerOptions.getFirstSupportedJavaVersion()); IJavaProject p = env.getJavaProject(projectPath); p.getJavaModel().refreshExternalArchives(new IJavaElement[] {p}, null); @@ -428,7 +428,7 @@ public void testChangeZIPArchive2() throws Exception { "}" }, internalLib, - "1.4"); + CompilerOptions.getFirstSupportedJavaVersion()); env.getProject(projectPath).refreshLocal(IResource.DEPTH_INFINITE, null); env.addEntry(projectPath, JavaCore.newLibraryEntry(new Path("/Project/internalLib.abc"), null, null)); @@ -460,7 +460,7 @@ public void testChangeZIPArchive2() throws Exception { "}" }, internalLib, - "1.4"); + CompilerOptions.getFirstSupportedJavaVersion()); env.getProject(projectPath).refreshLocal(IResource.DEPTH_INFINITE, null); diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java index b858f68c2ee..fd8f4e0dc9c 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java @@ -22,6 +22,7 @@ import org.eclipse.jdt.core.compiler.CategorizedProblem; import org.eclipse.jdt.core.tests.util.AbstractCompilerTest; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; @SuppressWarnings({"rawtypes", "unchecked"}) public class DependencyTests extends BuilderTests { @@ -1147,7 +1148,7 @@ public void testTypeVisibility2() throws JavaModelException { public void testTypeVariable() throws JavaModelException { if ((AbstractCompilerTest.getPossibleComplianceLevels() & AbstractCompilerTest.F_1_8) == 0) return; - IPath projectPath = env.addProject("Project", "1.8"); //$NON-NLS-1$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); // remove old package fragment root so that names don't collide diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/GetResourcesTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/GetResourcesTests.java index 9ddf18f728c..41a22c4da4e 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/GetResourcesTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/GetResourcesTests.java @@ -30,6 +30,7 @@ import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; /** * Basic tests of {@link JavaCore#getGeneratedResources(IRegion, boolean)}. @@ -402,7 +403,7 @@ public void test005() throws JavaModelException { public void test006() throws JavaModelException { IPath projectPath = null; try { - projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ + projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ } catch (RuntimeException e) { // no 1.5 VM or above is available return; diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java index efbcdeab01c..d219c938f67 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java @@ -27,6 +27,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.compiler.CategorizedProblem; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; @SuppressWarnings({"rawtypes", "unchecked"}) public class IncrementalTests extends BuilderTests { @@ -607,10 +608,10 @@ public void testMemberTypeFromClassFile() throws JavaModelException { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=372418 public void testMemberTypeOfOtherProject() throws JavaModelException { - IPath projectPath1 = env.addProject("Project1", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath1 = env.addProject("Project1", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath1, Util.getJavaClassLibs()); - IPath projectPath2 = env.addProject("Project2", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath2 = env.addProject("Project2", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath2, Util.getJavaClassLibs()); // remove old package fragment root so that names don't collide @@ -668,10 +669,10 @@ public void testMemberTypeOfOtherProject() throws JavaModelException { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=377401 public void test$InTypeName() throws JavaModelException { - IPath projectPath1 = env.addProject("Project1", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath1 = env.addProject("Project1", "1.8"); //$NON-NLS-1$ //$NON-NLS-2$ env.addExternalJars(projectPath1, Util.getJavaClassLibs()); - IPath projectPath2 = env.addProject("Project2", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath2 = env.addProject("Project2", "1.8"); //$NON-NLS-1$ //$NON-NLS-2$ env.addExternalJars(projectPath2, Util.getJavaClassLibs()); // remove old package fragment root so that names don't collide diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java index ab7de8b929d..c71b6caaa82 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java @@ -19,6 +19,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.compiler.CategorizedProblem; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public class Java50Tests extends BuilderTests { @@ -31,7 +32,7 @@ public static Test suite() { } public void testAnnotation() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.setOutputFolder(projectPath, ""); @@ -66,7 +67,7 @@ public void testAnnotation() throws JavaModelException { } public void testHierarchyCycle() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.setOutputFolder(projectPath, ""); @@ -86,7 +87,7 @@ public void testHierarchyCycle() throws JavaModelException { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=214237, dupe of // https://bugs.eclipse.org/bugs/show_bug.cgi?id=205235 public void testHierarchyCycleInstanceof() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.setOutputFolder(projectPath, ""); @@ -114,7 +115,7 @@ public void testHierarchyCycleInstanceof() throws JavaModelException { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=231293 public void testMissingRequiredBinaries() throws JavaModelException { - IPath p1 = env.addProject("P1", "1.5"); //$NON-NLS-1$ + IPath p1 = env.addProject("P1", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ IPath p2 = env.addProject("P2"); //$NON-NLS-1$ env.addExternalJars(p1, Util.getJavaClassLibs()); @@ -169,7 +170,7 @@ public void testMissingRequiredBinaries() throws JavaModelException { } public void testParameterizedMemberType() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.setOutputFolder(projectPath, ""); @@ -234,7 +235,7 @@ public void testParameterizedMemberType() throws JavaModelException { } public void testParameterizedType1() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.setOutputFolder(projectPath, ""); @@ -275,7 +276,7 @@ public void testParameterizedType1() throws JavaModelException { } public void testParameterizedType2() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.setOutputFolder(projectPath, ""); @@ -316,7 +317,7 @@ public void testParameterizedType2() throws JavaModelException { } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=294057 public void testHierarchyNonCycle() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.setOutputFolder(projectPath, ""); @@ -350,7 +351,7 @@ public void testHierarchyNonCycle() throws JavaModelException { } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=294057 (variation) public void testHierarchyNonCycle2() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.setOutputFolder(projectPath, ""); diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/LeakTestsBefore9.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/LeakTestsBefore9.java index f3a837f3bd7..05dca1ac94b 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/LeakTestsBefore9.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/LeakTestsBefore9.java @@ -28,7 +28,7 @@ public static Test suite() { } String getCompatibilityLevel() { - return CompilerOptions.VERSION_1_4; + return CompilerOptions.getFirstSupportedJavaVersion(); } @Override diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java index 8babfccacaf..ddbb3f91b3f 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java @@ -25,6 +25,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.compiler.CategorizedProblem; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.test.OrderedTestSuite; import junit.framework.Test; @@ -1928,20 +1929,20 @@ public void test103_missing_required_binaries() throws JavaModelException { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=460993 public void test104_missing_required_binaries() throws CoreException { - IPath p0 = env.addProject("JRE17", "1.7"); + IPath p0 = env.addProject("JRE17", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(p0, Util.getJavaClassLibs()); env.removePackageFragmentRoot(p0, ""); IPath root0 = env.addPackageFragmentRoot(p0, "src"); env.setOutputFolder(p0, "bin"); - IPath p1 = env.addProject("org.eclipse.jgit", "1.7"); + IPath p1 = env.addProject("org.eclipse.jgit", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(p1, Util.getJavaClassLibs()); env.removePackageFragmentRoot(p1, ""); IPath root1 = env.addPackageFragmentRoot(p1, "src"); env.addRequiredProject(p1, p0); env.setOutputFolder(p1, "bin"); - IPath p2 = env.addProject("org.eclipse.releng.tools", "1.5"); + IPath p2 = env.addProject("org.eclipse.releng.tools", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(p2, Util.getJavaClassLibs()); env.removePackageFragmentRoot(p2, ""); IPath root2 = env.addPackageFragmentRoot(p2, "src"); @@ -2093,7 +2094,7 @@ public void test461074() throws JavaModelException { //---------------------------- // Project2 //---------------------------- - IPath p2 = env.addProject("SampleLib", "1.5"); //$NON-NLS-1$ + IPath p2 = env.addProject("SampleLib", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(p2, Util.getJavaClassLibs()); // remove old package fragment root so that names don't collide env.removePackageFragmentRoot(p2, ""); //$NON-NLS-1$ @@ -2118,7 +2119,7 @@ public void test461074() throws JavaModelException { //---------------------------- // Project3 //---------------------------- - IPath p3 = env.addProject("SampleTest", "1.5"); //$NON-NLS-1$ + IPath p3 = env.addProject("SampleTest", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(p3, Util.getJavaClassLibs()); // remove old package fragment root so that names don't collide env.removePackageFragmentRoot(p3, ""); //$NON-NLS-1$ @@ -2164,7 +2165,7 @@ public void test461074_error() throws JavaModelException { //---------------------------- // Project2 //---------------------------- - IPath p2 = env.addProject("SampleLib", "1.5"); //$NON-NLS-1$ + IPath p2 = env.addProject("SampleLib", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(p2, Util.getJavaClassLibs()); // remove old package fragment root so that names don't collide env.removePackageFragmentRoot(p2, ""); //$NON-NLS-1$ @@ -2189,7 +2190,7 @@ public void test461074_error() throws JavaModelException { //---------------------------- // Project3 //---------------------------- - IPath p3 = env.addProject("SampleTest", "1.5"); //$NON-NLS-1$ + IPath p3 = env.addProject("SampleTest", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(p3, Util.getJavaClassLibs()); // remove old package fragment root so that names don't collide env.removePackageFragmentRoot(p3, ""); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageInfoTest.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageInfoTest.java index 8576b6856aa..76af70f3eef 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageInfoTest.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageInfoTest.java @@ -34,6 +34,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.compiler.CategorizedProblem; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; @SuppressWarnings("rawtypes") public class PackageInfoTest extends BuilderTests { @@ -52,7 +53,7 @@ public static Test suite() { return buildTestSuite(PackageInfoTest.class); } public void test001() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -95,7 +96,7 @@ public void test001() throws JavaModelException { assertSourceEquals("Different messages", expectedOutput, stringWriter.toString()); } public void test002() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -147,7 +148,7 @@ public void test002() throws JavaModelException { executeClass(projectPath, "testcase.Main", "@testcase.TestAnnotation()@testcase.TestAnnotation()", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } public void test003() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -170,7 +171,7 @@ public void test003() throws JavaModelException { // test for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=252555 : NPE // on duplicate package-info public void test004() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -209,7 +210,7 @@ public void test004() throws JavaModelException { // test for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=258145 : JME // on duplicate package-info public void test258145() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -251,7 +252,7 @@ public void test258145() throws JavaModelException { // (NPE upon creation/deletion of package-info.java in default package) public void test323785 () throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -273,7 +274,7 @@ public void test323785 () throws JavaModelException { // verify that changes to package info containing secondary types do trigger incremental build. public void test323785a () throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -301,7 +302,7 @@ public void test323785a () throws JavaModelException { // test when the package-info is added with the default annotation, the problem disappears public void testBug372012() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -358,7 +359,7 @@ public void testBug372012() throws JavaModelException { // test when the the default annotations are added to all top level types, the problem stays public void testBug372012a() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -417,7 +418,7 @@ public void testBug372012a() throws JavaModelException { // test when the the default annotations is added to only 1 top level type, the problem stays public void testBug372012b() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -475,7 +476,7 @@ public void testBug372012b() throws JavaModelException { // test when the the default annotation is removed from package-info, the problem comes back public void testBug372012c() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -551,7 +552,7 @@ public void testBug367836() throws JavaModelException { // verify that markers are created on the correct resource public void testBug374063() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -595,7 +596,7 @@ public void testBug374063() throws JavaModelException { } // 382960 public void testBug382960() throws JavaModelException, CoreException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -647,7 +648,7 @@ public void testBug382960() throws JavaModelException, CoreException { // package fragments in all source folders are removed. public void testBug525469() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); fullBuild(projectPath); @@ -710,7 +711,7 @@ public void testBug525469() throws JavaModelException { // [BUG] Syntax error, modifiers are not allowed here on a @deprecated javadoc tag in package-info.java // https://bugs.eclipse.org/bugs/show_bug.cgi?id=569780 public void testIssue803() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath src = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -736,7 +737,7 @@ public void testIssue803() throws JavaModelException { // [BUG] Syntax error, modifiers are not allowed here on a @deprecated javadoc tag in package-info.java // https://bugs.eclipse.org/bugs/show_bug.cgi?id=569780 public void testIssue803_2() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath src = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -761,7 +762,7 @@ public void testIssue803_2() throws JavaModelException { // [BUG] Syntax error, modifiers are not allowed here on a @deprecated javadoc tag in package-info.java // https://bugs.eclipse.org/bugs/show_bug.cgi?id=569780 public void testIssue803_3() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath src = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -784,7 +785,7 @@ public void testIssue803_3() throws JavaModelException { // [BUG] Syntax error, modifiers are not allowed here on a @deprecated javadoc tag in package-info.java // https://bugs.eclipse.org/bugs/show_bug.cgi?id=569780 public void testIssue803_4() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath src = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -810,7 +811,7 @@ public void testIssue803_4() throws JavaModelException { // [BUG] Syntax error, modifiers are not allowed here on a @deprecated javadoc tag in package-info.java // https://bugs.eclipse.org/bugs/show_bug.cgi?id=569780 public void testIssue803_5() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath src = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java index 1077a7773fb..5997a66e641 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java @@ -29,6 +29,7 @@ import org.eclipse.jdt.core.tests.builder.participants.TestCompilationParticipant2; import org.eclipse.jdt.core.tests.builder.participants.TestCompilationParticipant3; import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; @SuppressWarnings({"rawtypes", "unchecked"}) public class ParticipantBuildTests extends BuilderTests { @@ -154,7 +155,7 @@ public void buildStarting(BuildContext[] files, boolean isBatchBuild) { } public void testDefaultValue() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -248,7 +249,7 @@ public void processAnnotations(BuildContext[] files) { * (regression test for bug 134345 Problems from CompilationParticipants do not get cleaned up unless there are Java errors) */ public void testParticipantProblems() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); IPath root = env.addPackageFragmentRoot(projectPath, "src"); @@ -283,7 +284,7 @@ public void buildStarting(BuildContext[] files, boolean isBatch) { } public void testProcessAnnotationDeclarations() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -335,7 +336,7 @@ public void processAnnotations(BuildContext[] files) { } public void testProcessAnnotationQualifiedReferences() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -382,7 +383,7 @@ public void processAnnotations(BuildContext[] files) { * Test that a build participant can inspect the declared annotations by name */ public void testProcessAnnotationHasAnnotation() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -417,7 +418,7 @@ public void processAnnotations(BuildContext[] files) { } public void testProcessAnnotationReferences() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -703,7 +704,7 @@ public Optional postProcess(BuildContext file, ByteArrayInputStream byte } public void testResolvedMethod() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); //$NON-NLS-1$ env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ @@ -766,7 +767,7 @@ public void processAnnotations(BuildContext[] files) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158611 // Checking the GENERATED_BY attribute public void test1001() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); IPath root = env.addPackageFragmentRoot(projectPath, "src"); @@ -796,7 +797,7 @@ public void buildStarting(BuildContext[] files, boolean isBatch) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158611 // Checking the GENERATED_BY attribute public void test1002() throws JavaModelException { - IPath projectPath = env.addProject("Project", "1.5"); + IPath projectPath = env.addProject("Project", CompilerOptions.getFirstSupportedJavaVersion()); env.addExternalJars(projectPath, Util.getJavaClassLibs()); env.removePackageFragmentRoot(projectPath, ""); IPath root = env.addPackageFragmentRoot(projectPath, "src"); diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java index 231a73317f1..baaf7238113 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java @@ -185,7 +185,7 @@ public void addProject(IProject project){ } public IPath addProject(String projectName){ - return addProject(projectName, "1.8"); + return addProject(projectName, CompilerOptions.getFirstSupportedJavaVersion()); } public IPath addProject(String projectName, String compliance){ diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java index 87cdbdc0c12..7328c914485 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java @@ -26,7 +26,6 @@ import org.eclipse.jdt.internal.compiler.SourceElementParser; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.batch.CompilationUnit; -import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.parser.Parser; @@ -40,7 +39,7 @@ public class AnnotationDietRecoveryTest extends AbstractCompilerTest { private static final boolean CHECK_ALL_PARSE = true; public static boolean optimizeStringLiterals = false; - public static long sourceLevel = ClassFileConstants.JDK1_8; //$NON-NLS-1$ + public static long sourceLevel = CompilerOptions.getFirstSupportedJdkLevel(); //$NON-NLS-1$ public AnnotationDietRecoveryTest(String testName){ super(testName); @@ -57,9 +56,9 @@ public static Class testClass() { @Override protected Map getCompilerOptions() { Map options = super.getCompilerOptions(); - options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8); - options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8); - options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.getFirstSupportedJavaVersion()); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.getFirstSupportedJavaVersion()); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.getFirstSupportedJavaVersion()); return options; } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java index 383c50b4111..a1f1c1e1fd3 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java @@ -22,13 +22,13 @@ import java.io.StringReader; import java.util.ArrayList; -import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.compiler.CompilationProgress; import org.eclipse.jdt.core.compiler.batch.BatchCompiler; import org.eclipse.jdt.core.tests.util.Util; import org.eclipse.jdt.internal.compiler.batch.ClasspathLocation; import org.eclipse.jdt.internal.compiler.batch.FileSystem; import org.eclipse.jdt.internal.compiler.batch.Main; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public abstract class AbstractBatchCompilerTest extends AbstractRegressionTest { @@ -184,7 +184,7 @@ protected void createCascadedJars() { "}", }, LIB_DIR + "/lib1.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/B.java", @@ -204,7 +204,7 @@ protected void createCascadedJars() { "}", }, LIB_DIR + "/lib2.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/C.java", @@ -224,7 +224,7 @@ protected void createCascadedJars() { "Class-Path: lib4.jar\n", }, LIB_DIR + "/lib3.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/D.java", @@ -239,7 +239,7 @@ protected void createCascadedJars() { "Class-Path: lib1.jar lib3.jar\n", }, LIB_DIR + "/lib4.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/C.java", @@ -259,7 +259,7 @@ protected void createCascadedJars() { "Class-Path: s/lib6.jar\n", }, LIB_DIR + "/lib5.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); new File(LIB_DIR + "/s").mkdir(); Util.createJar( new String[] { @@ -275,7 +275,7 @@ protected void createCascadedJars() { "Class-Path: ../lib7.jar\n", }, LIB_DIR + "/s/lib6.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/A.java", @@ -290,7 +290,7 @@ protected void createCascadedJars() { "Class-Path: lib2.jar\n", }, LIB_DIR + "/lib7.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/F.java", @@ -305,7 +305,7 @@ protected void createCascadedJars() { "Class-Path: " + LIB_DIR + "/lib3.jar lib1.jar\n", }, LIB_DIR + "/lib8.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/G.java", @@ -321,7 +321,7 @@ protected void createCascadedJars() { "Class-Path: lib3.jar\n", }, LIB_DIR + "/lib9.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/A.java", @@ -337,7 +337,7 @@ protected void createCascadedJars() { "Class-Path: lib2.jar\n", }, LIB_DIR + "/lib10.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/A.java", @@ -352,7 +352,7 @@ protected void createCascadedJars() { "Class-Path:\n", }, LIB_DIR + "/lib11.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( null, new String[] { @@ -362,7 +362,7 @@ protected void createCascadedJars() { "Class-Path:lib1.jar\n", // missing space }, LIB_DIR + "/lib12.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( null, new String[] { @@ -372,7 +372,7 @@ protected void createCascadedJars() { "Class-Path:lib1.jar lib1.jar\n", // missing space }, LIB_DIR + "/lib13.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( null, new String[] { @@ -382,7 +382,7 @@ protected void createCascadedJars() { " Class-Path: lib1.jar\n", // extra space at line start }, LIB_DIR + "/lib14.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( null, new String[] { @@ -392,7 +392,7 @@ protected void createCascadedJars() { "Class-Path: lib1.jar", // missing newline at end }, LIB_DIR + "/lib15.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); Util.createJar( new String[] { "p/A.java", @@ -412,7 +412,7 @@ protected void createCascadedJars() { "}", }, LIB_DIR + "/lib16.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); new File(LIB_DIR + "/dir").mkdir(); Util.createJar( new String[] { @@ -428,7 +428,7 @@ protected void createCascadedJars() { "Class-Path: ../lib2.jar\n", }, LIB_DIR + "/dir/lib17.jar", - JavaCore.VERSION_1_4); + CompilerOptions.getFirstSupportedJavaVersion()); CASCADED_JARS_CREATED = true; } catch (IOException e) { // ignore diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java index b3a78278db8..e32175ba73b 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java @@ -80,7 +80,7 @@ public BatchCompilerTest(String name) { } /** * This test suite only needs to be run on one compliance. - * As it includes some specific 1.5 tests, it must be used with a least a 1.5 VM + * As it includes some specific 1.8 tests, it must be used with a least a 1.8 VM * and not be duplicated in general test suite. * @see TestAll */ @@ -309,8 +309,8 @@ else if (currentChar == '\n') public void test001() { - String commandLine = "-classpath \"D:/a folder\";d:/jdk1.4/jre/lib/rt.jar -1.4 -preserveAllLocals -g -verbose d:/eclipse/workspaces/development2.0/plugins/Bar/src2/ -d d:/test"; - String expected = " <-classpath> <-1.4> <-preserveAllLocals> <-g> <-verbose> <-d> "; + String commandLine = "-classpath \"D:/a folder\";d:/jdk1.8/jre/lib/rt.jar -1.8 -preserveAllLocals -g -verbose d:/eclipse/workspaces/development2.0/plugins/Bar/src2/ -d d:/test"; + String expected = " <-classpath> <-1.8> <-preserveAllLocals> <-g> <-verbose> <-d> "; String[] args = Main.tokenize(commandLine); StringBuilder buffer = new StringBuilder(30); @@ -423,7 +423,7 @@ public void test007(){ "}" }, "\"" + OUTPUT_DIR + File.separator + "X.java\"" - + " -1.5 -g -preserveAllLocals" + + " -1.8 -g -preserveAllLocals" + " -bootclasspath " + getLibraryClassesAsQuotedString() + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" + " -verbose -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", @@ -461,7 +461,7 @@ public void test008(){ "}" }, "\"" + OUTPUT_DIR + File.separator + "X.java\"" - + " -1.5 -g -preserveAllLocals" + + " -1.8 -g -preserveAllLocals" + " -bootclasspath " + getLibraryClassesAsQuotedString() + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", @@ -511,7 +511,7 @@ public void test009(){ "}", }, "\"" + OUTPUT_DIR + File.separator + "X.java\"" - + " -1.5 -g -preserveAllLocals" + + " -1.8 -g -preserveAllLocals" + " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" + File.pathSeparator + "-KO]\"" + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" @@ -556,7 +556,7 @@ public void test010(){ "}" }, "\"" + OUTPUT_DIR + File.separator + "X.java\"" - + " -1.5 -g -preserveAllLocals" + + " -1.8 -g -preserveAllLocals" + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", "[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + @@ -582,7 +582,7 @@ public void test011_classpath(){ "}", }, "\"" + OUTPUT_DIR + File.separator + "X.java\"" - + " -1.5 -g -preserveAllLocals" + + " -1.8 -g -preserveAllLocals" + " -cp \"" + OUTPUT_DIR + "[+**/OK2;~**/Warn;-KO]" + "\"" + File.pathSeparator + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", @@ -673,11 +673,6 @@ public void test012(){ " --release compile for a specific VM version\n" + " \n" + " Compliance options:\n" + - " -1.3 use 1.3 compliance (-source 1.3 -target 1.1)\n" + - " -1.4 + use 1.4 compliance (-source 1.3 -target 1.2)\n" + - " -1.5 -5 -5.0 use 1.5 compliance (-source 1.5 -target 1.5)\n" + - " -1.6 -6 -6.0 use 1.6 compliance (-source 1.6 -target 1.6)\n" + - " -1.7 -7 -7.0 use 1.7 compliance (-source 1.7 -target 1.7)\n" + " -1.8 -8 -8.0 use 1.8 compliance (-source 1.8 -target 1.8)\n" + " -1.9 -9 -9.0 use 1.9 compliance (-source 1.9 -target 1.9)\n" + " -10 -10.0 use 10 compliance (-source 10 -target 10)\n" + @@ -686,12 +681,10 @@ public void test012(){ " -13 -13.0 use 13 compliance (-source 13 -target 13)\n" + " -14 -14.0 use 14 compliance (-source 14 -target 14)\n" + getVersionOptions() + - " -source set source level: 1.3 to 1.9, 10 to "+ CompilerOptions.getLatestVersion() +"\n" + - " (or 6, 6.0, etc)\n" + - " -target set classfile target: 1.3 to 1.9, 10 to "+ CompilerOptions.getLatestVersion() +"\n" + - " (or 6, 6.0, etc)\n" + - " cldc1.1 can also be used to generate the StackMap\n" + - " attribute\n" + + " -source set source level: 1.8, 9 to "+ CompilerOptions.getLatestVersion() +"\n" + + " (or 8.0, 9.0, etc)\n" + + " -target set classfile target: 1.8, 9 to "+ CompilerOptions.getLatestVersion() +"\n" + + " (or 8.0, 9.0, etc)\n" + " --enable-preview enable support for preview features of the\n" + " latest Java release\n" + " \n" + @@ -734,7 +727,7 @@ public void test012(){ " -preserveAllLocals preserve unused local vars for debug purpose\n" + " \n" + " Annotation processing options:\n" + - " These options are meaningful only in a 1.6 environment.\n" + + " These options are meaningful only in a 1.8 environment.\n" + " -Akey[=value] options that are passed to annotation processors\n" + " -processorpath \n" + " specify locations where to find annotation processors.\n" + @@ -771,7 +764,7 @@ public void test012(){ " -noExit do not call System.exit(n) at end of compilation (n==0\n" + " if no error)\n" + " -repeat repeat compilation process times for perf analysis\n" + - " -inlineJSR inline JSR bytecode (implicit if target >= 1.5)\n" + + " -inlineJSR inline JSR bytecode (implicit if target >= 1.8)\n" + " -enableJavadoc consider references in javadoc\n" + " -parameters generate method parameters attribute (for target >= 1.8)\n" + " -genericsignature generate generic signature for lambda expressions\n" + @@ -1003,7 +996,7 @@ public void test013() { " Zork z;\n" + "}", }, "\"" + OUTPUT_DIR + File.separator + "X.java\"" - + " -1.5 -proceedOnError" + + " -1.8 -proceedOnError" + " -log \"" + logFileName + "\" -d \"" + OUTPUT_DIR + "\"", "", "----------\n" + @@ -1021,7 +1014,7 @@ public void test013() { "\n" + " \n" + " \n" + - " \n" + + " \n" + " \n" + " \n" + " \n" + @@ -1045,11 +1038,11 @@ public void test013() { "