From c500d9949448452fe65c038bf51b5aa8ba8e3de9 Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Tue, 18 Jun 2024 09:17:57 +0200 Subject: [PATCH] Remove old 1.x Java compiler versions support from PDE tests Basically moves tests that used various old 1.x JDK compiler settings to use 1.8 target (only supported 1.x Java compiler target in the future). See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2536 --- .../META-INF/MANIFEST.MF | 2 +- .../org.eclipse.pde.api.tools.tests/pom.xml | 2 +- .../tools/builder/tests/ApiBuilderTest.java | 2 +- .../builder/tests/ApiTestingEnvironment.java | 16 +----- .../tests/annotations/AnnotationTest.java | 2 +- .../builder/tests/leak/ClassExtendsLeak.java | 2 +- .../EnumIncrementalBuildTests.java | 2 +- .../tags/InvalidAnnotationFieldTagTests.java | 2 +- .../tags/InvalidAnnotationMethodTagTests.java | 2 +- .../tests/tags/InvalidAnnotationTagTests.java | 2 +- .../tests/tags/InvalidDuplicateTagsTests.java | 2 +- .../tags/InvalidEnumConstantTagTests.java | 2 +- .../tests/tags/InvalidEnumFieldTagTests.java | 2 +- .../tests/tags/InvalidEnumMethodTagTests.java | 2 +- .../tests/tags/InvalidEnumTagTests.java | 2 +- .../tests/tags/ValidAnnotationTagTests.java | 2 +- .../tests/tags/ValidEnumFieldTagTests.java | 2 +- .../tests/tags/ValidEnumMethodTagTests.java | 2 +- .../tests/usage/AnnotationUsageTests.java | 2 +- .../builder/tests/usage/EnumUsageTests.java | 2 +- .../tests/usage/FragmentUsageTests.java | 2 +- .../tests/usage/Java5ClassUsageTests.java | 2 +- .../tests/usage/Java5FieldUsageTests.java | 2 +- .../tests/usage/Java5MethodUsageTests.java | 2 +- .../builder/tests/usage/Java7UsageTest.java | 2 +- .../tools/model/tests/TagScannerTests.java | 6 +- .../api/tools/tests/util/ProjectUtils.java | 2 +- .../META-INF/MANIFEST.MF | 2 +- ui/org.eclipse.pde.ui.tests/plugin.xml | 6 +- ui/org.eclipse.pde.ui.tests/pom.xml | 2 +- ...OUND.profile => J2SE-1.8-NO-SOUND.profile} | 10 ++-- .../tests/ee/EnvironmentAnalyzerDelegate.java | 2 +- .../tests/ee/ExecutionEnvironmentTests.java | 55 ++++++++++--------- .../pde/ui/tests/ee/ExportBundleTests.java | 11 ++-- 34 files changed, 75 insertions(+), 85 deletions(-) rename ui/org.eclipse.pde.ui.tests/profiles/{J2SE-1.3-NO-SOUND.profile => J2SE-1.8-NO-SOUND.profile} (89%) diff --git a/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF b/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF index 6b6abc18ac6..92bed429d65 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF +++ b/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.pde.api.tools.tests -Bundle-Version: 1.3.500.qualifier +Bundle-Version: 1.3.600.qualifier Bundle-Vendor: %Bundle-Vendor Require-Bundle: org.eclipse.core.runtime, org.eclipse.pde.api.tools;bundle-version="1.0.600", diff --git a/apitools/org.eclipse.pde.api.tools.tests/pom.xml b/apitools/org.eclipse.pde.api.tools.tests/pom.xml index 7fd81f2d89f..f51797f67f1 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/pom.xml +++ b/apitools/org.eclipse.pde.api.tools.tests/pom.xml @@ -18,7 +18,7 @@ ../../ org.eclipse.pde.api.tools.tests - 1.3.500-SNAPSHOT + 1.3.600-SNAPSHOT eclipse-test-plugin true diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiBuilderTest.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiBuilderTest.java index 5e21b1b5e99..0938327d960 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiBuilderTest.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiBuilderTest.java @@ -419,7 +419,7 @@ protected void createExistingProject(File projectDir, boolean importfiles, boole * @return the default compiler compliance to use for the test */ protected String getTestCompliance() { - return JavaCore.VERSION_1_4; + return JavaCore.VERSION_1_8; } /** diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiTestingEnvironment.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiTestingEnvironment.java index b7d4cdda5f9..a70bbc4e448 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiTestingEnvironment.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiTestingEnvironment.java @@ -100,22 +100,10 @@ public IPath addProject(String projectName, String compliance) throws Unsupporte public void setProjectCompliance(IJavaProject project, String compliance) { int requiredComplianceFlag = 0; String compilerVersion = null; - if (JavaCore.VERSION_1_4.equals(compliance)) { - requiredComplianceFlag = AbstractCompilerTest.F_1_4; - compilerVersion = JavaCore.VERSION_1_4; - } else if (JavaCore.VERSION_1_5.equals(compliance)) { - requiredComplianceFlag = AbstractCompilerTest.F_1_5; - compilerVersion = JavaCore.VERSION_1_5; - } else if (JavaCore.VERSION_1_6.equals(compliance)) { - requiredComplianceFlag = AbstractCompilerTest.F_1_6; - compilerVersion = JavaCore.VERSION_1_6; - } else if (JavaCore.VERSION_1_7.equals(compliance)) { - requiredComplianceFlag = AbstractCompilerTest.F_1_7; - compilerVersion = JavaCore.VERSION_1_7; - } else if (JavaCore.VERSION_1_8.equals(compliance)) { + if (JavaCore.VERSION_1_8.equals(compliance)) { requiredComplianceFlag = AbstractCompilerTest.F_1_8; compilerVersion = JavaCore.VERSION_1_8; - } else if (!JavaCore.VERSION_1_4.equals(compliance) && !JavaCore.VERSION_1_3.equals(compliance)) { + } else { throw new UnsupportedOperationException("Test framework doesn't support compliance level: " + compliance); //$NON-NLS-1$ } if (requiredComplianceFlag != 0) { diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/annotations/AnnotationTest.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/annotations/AnnotationTest.java index 0fa53353581..32fecb2c65c 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/annotations/AnnotationTest.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/annotations/AnnotationTest.java @@ -134,7 +134,7 @@ public static Test suite() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } @Override diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/leak/ClassExtendsLeak.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/leak/ClassExtendsLeak.java index 37045365d92..9f849d254e2 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/leak/ClassExtendsLeak.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/leak/ClassExtendsLeak.java @@ -59,7 +59,7 @@ public static Test suite() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } /** diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/performance/EnumIncrementalBuildTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/performance/EnumIncrementalBuildTests.java index f24f8419d51..d8e2b85c145 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/performance/EnumIncrementalBuildTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/performance/EnumIncrementalBuildTests.java @@ -41,7 +41,7 @@ public EnumIncrementalBuildTests(String name) { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } /** diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationFieldTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationFieldTagTests.java index 6f4743a188a..39af3ab812f 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationFieldTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationFieldTagTests.java @@ -44,7 +44,7 @@ public static Test suite() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } public void testInvalidAnnotationFieldTag1I() { diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationMethodTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationMethodTagTests.java index 1791804aa81..e2156320705 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationMethodTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationMethodTagTests.java @@ -32,7 +32,7 @@ public InvalidAnnotationMethodTagTests(String name) { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } @Override diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationTagTests.java index 34f693759a8..fc7046f743b 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationTagTests.java @@ -52,7 +52,7 @@ protected int getDefaultProblemId() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } public void testInvalidAnnotationTag3I() { diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidDuplicateTagsTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidDuplicateTagsTests.java index 2b60d1ebf2d..3945648fcac 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidDuplicateTagsTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidDuplicateTagsTests.java @@ -60,7 +60,7 @@ protected IPath getTestSourcePath() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } /** diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumConstantTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumConstantTagTests.java index 1d46926cec9..6ce59bbb333 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumConstantTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumConstantTagTests.java @@ -44,7 +44,7 @@ public static Test suite() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } public void testInvalidEnumConstantTag1I() { diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumFieldTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumFieldTagTests.java index b22720ad594..f35cbf5be17 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumFieldTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumFieldTagTests.java @@ -44,7 +44,7 @@ public static Test suite() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } public void testInvalidEnumFieldTag1I() { diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumMethodTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumMethodTagTests.java index 3a5d503afb1..569e897fea2 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumMethodTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumMethodTagTests.java @@ -32,7 +32,7 @@ public InvalidEnumMethodTagTests(String name) { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } @Override diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumTagTests.java index 494077801ca..6ae4b420e52 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumTagTests.java @@ -52,7 +52,7 @@ protected int getDefaultProblemId() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } public void testInvalidEnumTag1I() { diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidAnnotationTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidAnnotationTagTests.java index b1a85adf79d..bc415f9e65c 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidAnnotationTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidAnnotationTagTests.java @@ -41,7 +41,7 @@ protected IPath getTestSourcePath() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumFieldTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumFieldTagTests.java index ad024724d75..8647819ba68 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumFieldTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumFieldTagTests.java @@ -43,7 +43,7 @@ public static Test suite() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } /** diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumMethodTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumMethodTagTests.java index f935ad33bfa..a96264efe9d 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumMethodTagTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumMethodTagTests.java @@ -31,7 +31,7 @@ public ValidEnumMethodTagTests(String name) { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } @Override diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/AnnotationUsageTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/AnnotationUsageTests.java index f6185f00256..3d9b32a63f0 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/AnnotationUsageTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/AnnotationUsageTests.java @@ -46,7 +46,7 @@ protected IPath getTestSourcePath() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } public static Test suite() { diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/EnumUsageTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/EnumUsageTests.java index cb4f62b9b45..49cdc8f1653 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/EnumUsageTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/EnumUsageTests.java @@ -41,7 +41,7 @@ protected IPath getTestSourcePath() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } public static Test suite() { diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/FragmentUsageTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/FragmentUsageTests.java index aa20ac18b72..50ddb9bfeb9 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/FragmentUsageTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/FragmentUsageTests.java @@ -36,7 +36,7 @@ protected int getDefaultProblemId() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } /** diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5ClassUsageTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5ClassUsageTests.java index 7239561b01e..9f53229420e 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5ClassUsageTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5ClassUsageTests.java @@ -33,7 +33,7 @@ public Java5ClassUsageTests(String name) { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } /** diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5FieldUsageTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5FieldUsageTests.java index 6400f397351..e914174325a 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5FieldUsageTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5FieldUsageTests.java @@ -39,7 +39,7 @@ public static Test suite() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } @Override diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5MethodUsageTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5MethodUsageTests.java index 2aea6a9279d..92983c8c505 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5MethodUsageTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5MethodUsageTests.java @@ -42,7 +42,7 @@ public static Test suite() { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_5; + return JavaCore.VERSION_1_8; } @Override diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java7UsageTest.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java7UsageTest.java index 19005591c6f..a68f125c264 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java7UsageTest.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java7UsageTest.java @@ -42,7 +42,7 @@ public Java7UsageTest(String name) { @Override protected String getTestCompliance() { - return JavaCore.VERSION_1_7; + return JavaCore.VERSION_1_8; } @Override diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java index 138448cf76c..cd38de77a8b 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java @@ -1117,9 +1117,9 @@ public void testMethodInheritInvalidRestrictionInterface() { public void testEnumMethodWithNoReference() { IApiDescription manifest = newDescription(); Map options = JavaCore.getDefaultOptions(); - options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5); - options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); - options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); + options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8); + options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8); + options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); doScan("a/b/c/TestMethod21.java", manifest, options); //$NON-NLS-1$ } diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/util/ProjectUtils.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/util/ProjectUtils.java index ee3d65622cb..20acc89db92 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/util/ProjectUtils.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/util/ProjectUtils.java @@ -186,7 +186,7 @@ public static IJavaProject createPluginProject(String projectName, String[] addi description.setExtensionRegistry(true); description.setEquinox(true); description.setBundleVersion(new Version("1.0.0")); //$NON-NLS-1$ - description.setExecutionEnvironments(new String[] { "J2SE-1.5" }); //$NON-NLS-1$ + description.setExecutionEnvironments(new String[] { "JavaSE-1.8" }); //$NON-NLS-1$ description.apply(null); AbstractApiTest.waitForAutoBuild(); return JavaCore.create(project); diff --git a/ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF index 7b6b867c18e..8eee1e5ff99 100644 --- a/ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF +++ b/ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: PDE JUnit Tests Bundle-SymbolicName: org.eclipse.pde.ui.tests; singleton:=true -Bundle-Version: 3.12.500.qualifier +Bundle-Version: 3.12.600.qualifier Bundle-ClassPath: tests.jar Bundle-Vendor: Eclipse.org Require-Bundle: org.eclipse.pde.ui, diff --git a/ui/org.eclipse.pde.ui.tests/plugin.xml b/ui/org.eclipse.pde.ui.tests/plugin.xml index ae538c830f1..5ec3966ca83 100644 --- a/ui/org.eclipse.pde.ui.tests/plugin.xml +++ b/ui/org.eclipse.pde.ui.tests/plugin.xml @@ -19,9 +19,9 @@ + description="Java 1.8 without sound APIs (PDE test suite)" + id="J2SE-1.8-NO-SOUND" + profileProperties="profiles/J2SE-1.8-NO-SOUND.profile"> ../../ org.eclipse.pde.ui.tests - 3.12.500-SNAPSHOT + 3.12.600-SNAPSHOT eclipse-test-plugin diff --git a/ui/org.eclipse.pde.ui.tests/profiles/J2SE-1.3-NO-SOUND.profile b/ui/org.eclipse.pde.ui.tests/profiles/J2SE-1.8-NO-SOUND.profile similarity index 89% rename from ui/org.eclipse.pde.ui.tests/profiles/J2SE-1.3-NO-SOUND.profile rename to ui/org.eclipse.pde.ui.tests/profiles/J2SE-1.8-NO-SOUND.profile index 75a8504a42b..c5e94af3e5f 100644 --- a/ui/org.eclipse.pde.ui.tests/profiles/J2SE-1.3-NO-SOUND.profile +++ b/ui/org.eclipse.pde.ui.tests/profiles/J2SE-1.8-NO-SOUND.profile @@ -58,10 +58,10 @@ org.osgi.framework.executionenvironment = \ OSGi/Minimum-1.1,\ JRE-1.1,\ J2SE-1.2,\ - J2SE-1.3-NO-SOUND -osgi.java.profile.name = J2SE-1.3-NO-SOUND -org.eclipse.jdt.core.compiler.compliance=1.3 -org.eclipse.jdt.core.compiler.source=1.3 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.3 + J2SE-1.8-NO-SOUND +osgi.java.profile.name = J2SE-1.8-NO-SOUND +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/EnvironmentAnalyzerDelegate.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/EnvironmentAnalyzerDelegate.java index 004186ca6d1..8eb3b68f189 100644 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/EnvironmentAnalyzerDelegate.java +++ b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/EnvironmentAnalyzerDelegate.java @@ -34,7 +34,7 @@ public class EnvironmentAnalyzerDelegate implements IExecutionEnvironmentAnalyze /** * Environment identifier */ - public static final String EE_NO_SOUND = "J2SE-1.3-NO-SOUND"; + public static final String EE_NO_SOUND = "J2SE-1.8-NO-SOUND"; @Override public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException { diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/ExecutionEnvironmentTests.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/ExecutionEnvironmentTests.java index 8dbe328016c..97520e62934 100644 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/ExecutionEnvironmentTests.java +++ b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/ExecutionEnvironmentTests.java @@ -36,6 +36,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.ToolFactory; import org.eclipse.jdt.core.util.IClassFileReader; +import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.launching.environments.IExecutionEnvironment; import org.eclipse.pde.core.plugin.IPluginModelBase; @@ -134,9 +135,9 @@ public void testCustomEnvironment() throws Exception { IJavaProject project = ProjectUtils.createPluginProject("no.sound", env); assertTrue("Project was not created", project.exists()); - validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_3); - validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); - validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_3); + validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8); validateOption(project, JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR); validateOption(project, JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR); @@ -147,27 +148,27 @@ public void testCustomEnvironment() throws Exception { waitForBuild(); IFile file = project.getProject().getFile("/bin/no/sound/Activator.class"); assertTrue("Activator class missing", file.exists()); - validateTargetLevel(file.getLocation().toOSString(), 47); + validateTargetLevel(file.getLocation().toOSString(), ClassFileConstants.MAJOR_VERSION_1_8); } finally { deleteProject("no.sound"); } } /** - * Creates a plug-in project with a J2SE-1.4 execution environment. + * Creates a plug-in project with a JavaSE-17 execution environment. * Validates that compiler compliance settings and build path are correct * and that class files are generated with correct target level. */ @Test - public void testJava4Environment() throws Exception { + public void testJava8Environment() throws Exception { try { - IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment("J2SE-1.4"); + IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment("JavaSE-1.8"); IJavaProject project = ProjectUtils.createPluginProject("j2se14.plug", env); assertTrue("Project was not created", project.exists()); - validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2); - validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); - validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4); + validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8); validateOption(project, JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.WARNING); validateOption(project, JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING); @@ -177,7 +178,7 @@ public void testJava4Environment() throws Exception { waitForBuild(); IFile file = project.getProject().getFile("/bin/j2se14/plug/Activator.class"); assertTrue("Activator class missing", file.exists()); - validateTargetLevel(file.getLocation().toOSString(), 46); + validateTargetLevel(file.getLocation().toOSString(), ClassFileConstants.MAJOR_VERSION_1_8); } finally { deleteProject("j2se14.plug"); } @@ -211,7 +212,7 @@ public void testNoEnvironment() throws Exception { } /** - * Creates a plug-in project with a J2SE-1.4 execution environment. + * Creates a plug-in project with a JavaSE-1.8 execution environment. * Validates that compiler compliance settings and build path are correct. * Modifies the compliance options and then updates the class path again. * Ensures that the enum and assert identifier options get overwritten with @@ -220,13 +221,13 @@ public void testNoEnvironment() throws Exception { @Test public void testMinimumComplianceOverwrite() throws Exception { try { - IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment("J2SE-1.4"); + IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment("JavaSE-1.8"); IJavaProject project = ProjectUtils.createPluginProject("j2se14.ignore", env); assertTrue("Project was not created", project.exists()); - validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2); - validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); - validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4); + validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8); validateOption(project, JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.WARNING); validateOption(project, JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING); @@ -242,9 +243,9 @@ public void testMinimumComplianceOverwrite() throws Exception { IPluginModelBase model = PluginRegistry.findModel(project.getProject()); UpdateClasspathJob.scheduleFor(List.of(model), false).join(); // re-validate options - validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2); - validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); - validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4); + validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8); validateOption(project, JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.WARNING); validateOption(project, JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING); @@ -254,7 +255,7 @@ public void testMinimumComplianceOverwrite() throws Exception { } /** - * Creates a plug-in project with a J2SE-1.4 execution environment. + * Creates a plug-in project with a JavaSE-1.8 execution environment. * Validates that compiler compliance settings and build path are correct. * Modifies the compliance options and then updates the class path again. * Ensures that the enum and assert identifier options do not overwrite @@ -263,13 +264,13 @@ public void testMinimumComplianceOverwrite() throws Exception { @Test public void testMinimumComplianceNoOverwrite() throws Exception { try { - IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment("J2SE-1.4"); + IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment("JavaSE-1.8"); IJavaProject project = ProjectUtils.createPluginProject("j2se14.error", env); assertTrue("Project was not created", project.exists()); - validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2); - validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); - validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4); + validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8); validateOption(project, JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.WARNING); validateOption(project, JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING); @@ -286,9 +287,9 @@ public void testMinimumComplianceNoOverwrite() throws Exception { UpdateClasspathJob.scheduleFor(List.of(model), false).join(); // re-validate options - validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2); - validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); - validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4); + validateOption(project, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); + validateOption(project, JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8); validateOption(project, JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR); validateOption(project, JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR); diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/ExportBundleTests.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/ExportBundleTests.java index dc84fd79de3..3c5a9cb2e52 100644 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/ExportBundleTests.java +++ b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/ee/ExportBundleTests.java @@ -29,6 +29,7 @@ import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.ToolFactory; import org.eclipse.jdt.core.util.IClassFileReader; +import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.launching.environments.IExecutionEnvironment; import org.eclipse.pde.core.plugin.PluginRegistry; @@ -130,7 +131,7 @@ public void testExportCustomEnvironment() throws Exception { } assertTrue("Missing exported bundle", Files.exists(path)); - validateTargetLevel(path.toString(), "no/sound/export/Activator.class", 47); + validateTargetLevel(path.toString(), "no/sound/export/Activator.class", ClassFileConstants.MAJOR_VERSION_1_8); } finally { TestUtils.waitForJobs(name.getMethodName(), 10, 5000); deleteProject("no.sound.export"); @@ -139,13 +140,13 @@ public void testExportCustomEnvironment() throws Exception { } /** - * Exports a plug-in project with a J2SE-1.4 execution environment and + * Exports a plug-in project with a JavaSE-1.8 execution environment and * validates class file target level. */ @Test - public void testExport14Environment() throws Exception { + public void testExport18Environment() throws Exception { try { - IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment("J2SE-1.4"); + IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment("JavaSE-1.8"); IJavaProject project = ProjectUtils.createPluginProject("j2se14.export", env); assertTrue("Project was not created", project.exists()); @@ -231,7 +232,7 @@ public void testExport14Environment() throws Exception { System.out.println("================================\nEnd of BUG 424597"); assertTrue("Missing exported bundle", Files.exists(path)); - validateTargetLevel(path.toString(), "j2se14/export/Activator.class", 46); + validateTargetLevel(path.toString(), "j2se14/export/Activator.class", ClassFileConstants.MAJOR_VERSION_1_8); } finally { TestUtils.waitForJobs(name.getMethodName(), 10, 5000); deleteProject("j2se14.export");