Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2021-10-29 02:24:14 -0400
committerJay Arthanareeswaran2021-11-12 00:05:24 -0500
commit66115de462f67f145f71fbe530cd8bad0265eaf5 (patch)
tree33468879ecd43236b0254b57a337b37f3e072c48
parentb99d598e02cd716886ec9fef1b2d05a7e5fe8618 (diff)
downloadeclipse.jdt.core-BETA_JAVA18.tar.gz
eclipse.jdt.core-BETA_JAVA18.tar.xz
eclipse.jdt.core-BETA_JAVA18.zip
Bug 576948 - [18] Create Java 18 version and supporting code in testsBETA_JAVA18
Change-Id: Ic485c927b21f4e5ab730ed9a87aa7c069a284830 Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com> Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/187571 Tested-by: JDT Bot <jdt-bot@eclipse.org>
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jarbin312089 -> 311759 bytes
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/RecordElementProcessor.java6
-rw-r--r--org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java7
-rw-r--r--org.eclipse.jdt.core.tests.compiler/pom.xml30
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java159
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java5
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests18.java (renamed from org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests17.java)16
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching16Test.java6
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java22
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SealedTypesTests.java300
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchPatternTest.java14
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java29
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java28
-rw-r--r--org.eclipse.jdt.core.tests.model/pom.xml30
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter_PreviewTest.java31
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java9
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java18
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchPatternTest.java18
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java7
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties13
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java7
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java29
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java19
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/GuardedPattern.java14
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypePattern.java12
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java12
33 files changed, 571 insertions, 324 deletions
diff --git a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
index f7a109b23f..7f607e1f78 100644
--- a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
+++ b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
Binary files differ
diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/RecordElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/RecordElementProcessor.java
index 6509d6eba1..b33921d19d 100644
--- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/RecordElementProcessor.java
+++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/RecordElementProcessor.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -142,7 +146,7 @@ public class RecordElementProcessor extends BaseElementProcessor {
assertTrue("Preview flag not seen as enabled", preview);
}
SourceVersion sourceVersion = this.processingEnv.getSourceVersion();
- assertNotSame("Should support the latest compliance", sourceVersion, SourceVersion.RELEASE_6);
+ assertEquals("Should support the latest compliance", sourceVersion, SourceVersion.RELEASE_6);
}
/*
* Basic test for record element and kind
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 1153d16ee4..a5d01964fc 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
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -239,6 +243,9 @@ public void addClassFolder(IPath projectPath, IPath classFolderPath, boolean isE
} else if ("17".equals(compliance)) {
requiredComplianceFlag = AbstractCompilerTest.F_17;
compilerVersion = CompilerOptions.VERSION_17;
+ } else if ("18".equals(compliance)) {
+ requiredComplianceFlag = AbstractCompilerTest.F_18;
+ compilerVersion = CompilerOptions.VERSION_18;
} else if (!"1.4".equals(compliance) && !"1.3".equals(compliance)) {
throw new UnsupportedOperationException("Test framework doesn't support compliance level: " + compliance);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/pom.xml b/org.eclipse.jdt.core.tests.compiler/pom.xml
index 771c2b6f31..5a3243d75f 100644
--- a/org.eclipse.jdt.core.tests.compiler/pom.xml
+++ b/org.eclipse.jdt.core.tests.compiler/pom.xml
@@ -256,6 +256,36 @@
<tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,14,17</tycho.surefire.argLine>
</properties>
</profile>
+ <profile>
+ <id>test-on-javase-18</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-toolchains-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>toolchain</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <toolchains>
+ <jdk>
+ <id>JavaSE-18</id>
+ </jdk>
+ </toolchains>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,15,18</tycho.surefire.argLine>
+ </properties>
+ </profile>
</profiles>
</project>
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java
index 84a0b6abdc..d54ef0166e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Jesper Steen Møller <jesper@selskabet.org> - Contributions for
@@ -115,26 +119,14 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
if ((possibleComplianceLevels & AbstractCompilerTest.F_1_8) != 0) {
ArrayList tests_1_8 = (ArrayList)testClasses.clone();
tests_1_8.addAll(TEST_CLASSES_1_5);
- tests_1_8.add(ParserTest1_7.class);
- tests_1_8.add(LambdaExpressionSyntaxTest.class);
- tests_1_8.add(ReferenceExpressionSyntaxTest.class);
- tests_1_8.add(TypeAnnotationSyntaxTest.class);
- tests_1_8.add(CompletionParserTest18.class);
- tests_1_8.add(SelectionParserTest18.class);
+ addJava1_8Tests(tests_1_8);
TestCase.resetForgottenFilters(tests_1_8);
all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.JDK1_8, tests_1_8));
}
if ((possibleComplianceLevels & AbstractCompilerTest.F_9) != 0) {
ArrayList tests_9 = (ArrayList)testClasses.clone();
tests_9.addAll(TEST_CLASSES_1_5);
- tests_9.add(ParserTest1_7.class);
- tests_9.add(LambdaExpressionSyntaxTest.class);
- tests_9.add(ReferenceExpressionSyntaxTest.class);
- tests_9.add(TypeAnnotationSyntaxTest.class);
- tests_9.add(CompletionParserTest18.class);
- tests_9.add(SelectionParserTest18.class);
- tests_9.add(SelectionParserTest9.class);
- tests_9.add(ModuleDeclarationSyntaxTest.class);
+ addJava9Tests(tests_9);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
@@ -146,16 +138,7 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
if ((possibleComplianceLevels & AbstractCompilerTest.F_10) != 0) {
ArrayList tests_10 = (ArrayList)testClasses.clone();
tests_10.addAll(TEST_CLASSES_1_5);
- tests_10.add(ParserTest1_7.class);
- tests_10.add(LambdaExpressionSyntaxTest.class);
- tests_10.add(ReferenceExpressionSyntaxTest.class);
- tests_10.add(TypeAnnotationSyntaxTest.class);
- tests_10.add(CompletionParserTest18.class);
- tests_10.add(SelectionParserTest18.class);
- tests_10.add(SelectionParserTest9.class);
- tests_10.add(SelectionParserTest10.class);
- tests_10.add(ModuleDeclarationSyntaxTest.class);
- tests_10.add(JEP286ReservedWordTest.class);
+ addJava10Tests(tests_10);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
@@ -167,16 +150,7 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
if ((possibleComplianceLevels & AbstractCompilerTest.F_11) != 0) {
ArrayList tests_11 = (ArrayList)testClasses.clone();
tests_11.addAll(TEST_CLASSES_1_5);
- tests_11.add(ParserTest1_7.class);
- tests_11.add(LambdaExpressionSyntaxTest.class);
- tests_11.add(ReferenceExpressionSyntaxTest.class);
- tests_11.add(TypeAnnotationSyntaxTest.class);
- tests_11.add(CompletionParserTest18.class);
- tests_11.add(SelectionParserTest18.class);
- tests_11.add(SelectionParserTest9.class);
- tests_11.add(SelectionParserTest10.class);
- tests_11.add(ModuleDeclarationSyntaxTest.class);
- tests_11.add(JEP286ReservedWordTest.class);
+ addJava10Tests(tests_11);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
@@ -188,17 +162,7 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
if ((possibleComplianceLevels & AbstractCompilerTest.F_12) != 0) {
ArrayList tests_12 = (ArrayList)testClasses.clone();
tests_12.addAll(TEST_CLASSES_1_5);
- tests_12.add(ParserTest1_7.class);
- tests_12.add(LambdaExpressionSyntaxTest.class);
- tests_12.add(ReferenceExpressionSyntaxTest.class);
- tests_12.add(TypeAnnotationSyntaxTest.class);
- tests_12.add(CompletionParserTest18.class);
- tests_12.add(SelectionParserTest18.class);
- tests_12.add(SelectionParserTest9.class);
- tests_12.add(SelectionParserTest10.class);
- tests_12.add(SelectionParserTest12.class);
- tests_12.add(ModuleDeclarationSyntaxTest.class);
- tests_12.add(JEP286ReservedWordTest.class);
+ addJava12Tests(tests_12);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
@@ -210,17 +174,7 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
if ((possibleComplianceLevels & AbstractCompilerTest.F_13) != 0) {
ArrayList tests_13 = (ArrayList)testClasses.clone();
tests_13.addAll(TEST_CLASSES_1_5);
- tests_13.add(ParserTest1_7.class);
- tests_13.add(LambdaExpressionSyntaxTest.class);
- tests_13.add(ReferenceExpressionSyntaxTest.class);
- tests_13.add(TypeAnnotationSyntaxTest.class);
- tests_13.add(CompletionParserTest18.class);
- tests_13.add(SelectionParserTest18.class);
- tests_13.add(SelectionParserTest9.class);
- tests_13.add(SelectionParserTest10.class);
- tests_13.add(SelectionParserTest12.class);
- tests_13.add(ModuleDeclarationSyntaxTest.class);
- tests_13.add(JEP286ReservedWordTest.class);
+ addJava12Tests(tests_13);
//TODO:To add SwitchExpressionYieldTests here as well as master
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
@@ -233,17 +187,7 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
if ((possibleComplianceLevels & AbstractCompilerTest.F_14) != 0) {
ArrayList tests_14 = (ArrayList)testClasses.clone();
tests_14.addAll(TEST_CLASSES_1_5);
- tests_14.add(ParserTest1_7.class);
- tests_14.add(LambdaExpressionSyntaxTest.class);
- tests_14.add(ReferenceExpressionSyntaxTest.class);
- tests_14.add(TypeAnnotationSyntaxTest.class);
- tests_14.add(CompletionParserTest18.class);
- tests_14.add(SelectionParserTest18.class);
- tests_14.add(SelectionParserTest9.class);
- tests_14.add(SelectionParserTest10.class);
- tests_14.add(SelectionParserTest12.class);
- tests_14.add(ModuleDeclarationSyntaxTest.class);
- tests_14.add(JEP286ReservedWordTest.class);
+ addJava12Tests(tests_14);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
@@ -255,17 +199,7 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
if ((possibleComplianceLevels & AbstractCompilerTest.F_15) != 0) {
ArrayList tests_15 = (ArrayList)testClasses.clone();
tests_15.addAll(TEST_CLASSES_1_5);
- tests_15.add(ParserTest1_7.class);
- tests_15.add(LambdaExpressionSyntaxTest.class);
- tests_15.add(ReferenceExpressionSyntaxTest.class);
- tests_15.add(TypeAnnotationSyntaxTest.class);
- tests_15.add(CompletionParserTest18.class);
- tests_15.add(SelectionParserTest18.class);
- tests_15.add(SelectionParserTest9.class);
- tests_15.add(SelectionParserTest10.class);
- tests_15.add(SelectionParserTest12.class);
- tests_15.add(ModuleDeclarationSyntaxTest.class);
- tests_15.add(JEP286ReservedWordTest.class);
+ addJava12Tests(tests_15);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
@@ -277,18 +211,7 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
if ((possibleComplianceLevels & AbstractCompilerTest.F_16) != 0) {
ArrayList tests_16 = (ArrayList)testClasses.clone();
tests_16.addAll(TEST_CLASSES_1_5);
- tests_16.add(ParserTest1_7.class);
- tests_16.add(LambdaExpressionSyntaxTest.class);
- tests_16.add(ReferenceExpressionSyntaxTest.class);
- tests_16.add(TypeAnnotationSyntaxTest.class);
- tests_16.add(CompletionParserTest18.class);
- tests_16.add(SelectionParserTest18.class);
- tests_16.add(SelectionParserTest9.class);
- tests_16.add(SelectionParserTest10.class);
- tests_16.add(SelectionParserTest12.class);
- tests_16.add(ModuleDeclarationSyntaxTest.class);
- tests_16.add(JEP286ReservedWordTest.class);
- tests_16.add(PatternMatchingSelectionTest.class);
+ addJava16Tests(tests_16);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
@@ -301,18 +224,7 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
if ((possibleComplianceLevels & AbstractCompilerTest.F_17) != 0) {
ArrayList tests_17 = (ArrayList)testClasses.clone();
tests_17.addAll(TEST_CLASSES_1_5);
- tests_17.add(ParserTest1_7.class);
- tests_17.add(LambdaExpressionSyntaxTest.class);
- tests_17.add(ReferenceExpressionSyntaxTest.class);
- tests_17.add(TypeAnnotationSyntaxTest.class);
- tests_17.add(CompletionParserTest18.class);
- tests_17.add(SelectionParserTest18.class);
- tests_17.add(SelectionParserTest9.class);
- tests_17.add(SelectionParserTest10.class);
- tests_17.add(SelectionParserTest12.class);
- tests_17.add(ModuleDeclarationSyntaxTest.class);
- tests_17.add(JEP286ReservedWordTest.class);
- tests_17.add(PatternMatchingSelectionTest.class);
+ addJava16Tests(tests_17);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
@@ -321,8 +233,51 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
TestCase.RUN_ONLY_ID = null;
all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_17), tests_17));
}
+ if ((possibleComplianceLevels & AbstractCompilerTest.F_18) != 0) {
+ ArrayList tests_18 = (ArrayList)testClasses.clone();
+ tests_18.addAll(TEST_CLASSES_1_5);
+ addJava16Tests(tests_18);
+ // Reset forgotten subsets tests
+ TestCase.TESTS_PREFIX = null;
+ TestCase.TESTS_NAMES = null;
+ TestCase.TESTS_NUMBERS= null;
+ TestCase.TESTS_RANGE = null;
+ TestCase.RUN_ONLY_ID = null;
+ all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_18), tests_18));
+ }
return all;
}
+
+private static void addJava16Tests(ArrayList tests_16) {
+ addJava1_8Tests(tests_16);
+ tests_16.add(PatternMatchingSelectionTest.class);
+}
+
+private static void addJava12Tests(ArrayList tests_12) {
+ addJava10Tests(tests_12);
+ tests_12.add(SelectionParserTest12.class);
+}
+
+private static void addJava10Tests(ArrayList tests_10) {
+ addJava9Tests(tests_10);
+ tests_10.add(SelectionParserTest10.class);
+ tests_10.add(JEP286ReservedWordTest.class);
+}
+
+private static void addJava9Tests(ArrayList tests_9) {
+ addJava1_8Tests(tests_9);
+ tests_9.add(SelectionParserTest9.class);
+ tests_9.add(ModuleDeclarationSyntaxTest.class);
+}
+
+private static void addJava1_8Tests(ArrayList tests_1_8) {
+ tests_1_8.add(ParserTest1_7.class);
+ tests_1_8.add(LambdaExpressionSyntaxTest.class);
+ tests_1_8.add(ReferenceExpressionSyntaxTest.class);
+ tests_1_8.add(TypeAnnotationSyntaxTest.class);
+ tests_1_8.add(CompletionParserTest18.class);
+ tests_1_8.add(SelectionParserTest18.class);
+}
public static Test suite() {
return getTestSuite(true);
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
index 5300470149..4854543d31 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
@@ -5406,7 +5410,6 @@ public class GenericTypeTest extends AbstractComparableTest {
if (this.complianceLevel < ClassFileConstants.JDK17)
return;
Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
customOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
this.runNegativeTest(
new String[] {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests17.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests18.java
index 95e3ea4274..3017994b4a 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests17.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests18.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* Stephan Herrmann - initial API and implementation
*******************************************************************************/
@@ -24,9 +28,9 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import junit.framework.Test;
-public class NullAnnotationTests17 extends AbstractNullAnnotationTest {
+public class NullAnnotationTests18 extends AbstractNullAnnotationTest {
- public NullAnnotationTests17(String name) {
+ public NullAnnotationTests18(String name) {
super(name);
}
@@ -37,11 +41,11 @@ public class NullAnnotationTests17 extends AbstractNullAnnotationTest {
}
public static Test suite() {
- return buildMinimalComplianceTestSuite(testClass(), F_17);
+ return buildMinimalComplianceTestSuite(testClass(), F_18);
}
public static Class<?> testClass() {
- return NullAnnotationTests17.class;
+ return NullAnnotationTests18.class;
}
@Deprecated // super method is deprecated
@@ -118,7 +122,7 @@ public class NullAnnotationTests17 extends AbstractNullAnnotationTest {
null,
jarFileName,
jcl17Path != null ? new String[] { jcl17Path } : null,
- "17");
+ "18");
return jarFileName;
}
@@ -128,7 +132,7 @@ public class NullAnnotationTests17 extends AbstractNullAnnotationTest {
Runner runner = new Runner();
runner.classLibraries = this.LIBS;
Map<String,String> opts = getCompilerOptions();
- opts.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_17);
+ opts.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_18);
opts.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
opts.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
runner.customOptions = opts;
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching16Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching16Test.java
index 4188240bb9..a7b109d8bb 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching16Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching16Test.java
@@ -7,6 +7,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -120,7 +124,7 @@ public class PatternMatching16Test extends AbstractRegressionTest {
"1. ERROR in X1.java (at line 0)\n" +
" public class X1 {\n" +
" ^\n" +
- "Preview features enabled at an invalid source release level 14, preview can be enabled only at source level 17\n" +
+ "Preview features enabled at an invalid source release level 14, preview can be enabled only at source level "+PREVIEW_ALLOWED_LEVEL+"\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java
index 6b635ffbef..567b840d0b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java
@@ -7,6 +7,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -54,14 +58,14 @@ public class RecordsRestrictedClassTest extends AbstractRegressionTest {
return defaultOptions;
}
// Enables the tests to run individually
- protected Map<String, String> getCompilerOptionsWithPreview() {
+ protected Map<String, String> getCompilerOptionsWithPreviewIfApplicable() {
Map<String, String> defaultOptions = super.getCompilerOptions();
defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_17);
defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_17);
defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_17);
defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
defaultOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
- defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+ defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED);
return defaultOptions;
}
@@ -7266,7 +7270,7 @@ public void testBug564672b_049() {
}
public void testBug565388_001() {
if (this.complianceLevel < ClassFileConstants.JDK17) return;
- Map<String, String> options = getCompilerOptionsWithPreview();
+ Map<String, String> options = getCompilerOptionsWithPreviewIfApplicable();
this.runNegativeTest(
new String[] {
"X.java",
@@ -7286,7 +7290,7 @@ public void testBug565388_001() {
}
public void testBug565388_002() {
if (this.complianceLevel < ClassFileConstants.JDK17) return;
- Map<String, String> options = getCompilerOptionsWithPreview();
+ Map<String, String> options = getCompilerOptionsWithPreviewIfApplicable();
this.runNegativeTest(
new String[] {
"X.java",
@@ -7748,7 +7752,7 @@ public void testBug563182_07() {
}
public void testBug566063_001() {
if (this.complianceLevel < ClassFileConstants.JDK17) return;
- Map<String, String> options = getCompilerOptionsWithPreview();
+ Map<String, String> options = getCompilerOptionsWithPreviewIfApplicable();
runConformTest(
new String[] {
"X.java",
@@ -7775,7 +7779,7 @@ public void testBug566063_001() {
}
public void testBug566063_002() {
if (this.complianceLevel < ClassFileConstants.JDK17) return;
- Map<String, String> options = getCompilerOptionsWithPreview();
+ Map<String, String> options = getCompilerOptionsWithPreviewIfApplicable();
runNegativeTest(
new String[] {
"X.java",
@@ -7809,7 +7813,7 @@ public void testBug566063_002() {
}
public void testBug566063_003() {
if (this.complianceLevel < ClassFileConstants.JDK17) return;
- Map<String, String> options = getCompilerOptionsWithPreview();
+ Map<String, String> options = getCompilerOptionsWithPreviewIfApplicable();
runNegativeTest(
new String[] {
"X.java",
@@ -8031,7 +8035,7 @@ public void testBug566554_04() {
}
public void testBug567731_001() {
if (this.complianceLevel < ClassFileConstants.JDK17) return;
- Map<String, String> options = getCompilerOptionsWithPreview();
+ Map<String, String> options = getCompilerOptionsWithPreviewIfApplicable();
this.runNegativeTest(
new String[] {
"X.java",
@@ -8061,7 +8065,7 @@ public void testBug567731_001() {
}
public void testBug567731_002() {
if (this.complianceLevel < ClassFileConstants.JDK17) return;
- Map<String, String> options = getCompilerOptionsWithPreview();
+ Map<String, String> options = getCompilerOptionsWithPreviewIfApplicable();
this.runNegativeTest(
new String[] {
"X.java",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SealedTypesTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SealedTypesTests.java
index ffc9d7e7f5..7a70919e66 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SealedTypesTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SealedTypesTests.java
@@ -7,6 +7,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -31,7 +35,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
static {
// TESTS_NUMBERS = new int [] { 40 };
// TESTS_RANGE = new int[] { 1, -1 };
-// TESTS_NAMES = new String[] { "testBug573450"};
+// TESTS_NAMES = new String[] { "testBug564638_056"};
}
public static Class<?> testClass() {
@@ -1378,7 +1382,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
},
lib1Path,
JavaCore.VERSION_17,
- true);
+ false);
String[] libs = getDefaultClassPaths();
int len = libs.length;
System.arraycopy(libs, 0, libs = new String[len+1], 0, len);
@@ -1688,7 +1692,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -1714,7 +1718,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -1744,7 +1748,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" permits p;\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -1755,7 +1759,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in permits.java (at line 1)\n" +
" public class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -1780,7 +1784,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" permits p;\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -1791,7 +1795,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in permits.java (at line 1)\n" +
" public class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -1811,7 +1815,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X<permits> {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -1837,7 +1841,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X<permits> {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -1861,7 +1865,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X extends permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -1871,7 +1875,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -1893,7 +1897,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X extends permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -1903,7 +1907,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -1926,7 +1930,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X implements permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -1936,7 +1940,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" interface permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -1958,7 +1962,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X implements permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -1968,7 +1972,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" interface permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -1991,7 +1995,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" interface X extends permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -2001,7 +2005,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" interface permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2023,7 +2027,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" interface X extends permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -2033,7 +2037,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" interface permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -2060,7 +2064,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 2)\n" +
" permits foo() {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -2086,7 +2090,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" permits foo() {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -2112,7 +2116,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" void foo() throws permits{\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -2137,7 +2141,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" void foo() throws permits{\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -2163,7 +2167,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X <T extends permits> {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 1)\n" +
" class X <T extends permits> {\n" +
@@ -2203,7 +2207,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X <T extends permits>{\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 1)\n" +
" class X <T extends permits>{\n" +
@@ -2246,7 +2250,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" private final permits p;\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 5)\n" +
" Zork();\n" +
@@ -2273,7 +2277,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" private final permits p;\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 5)\n" +
" Zork();\n" +
@@ -2308,7 +2312,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 3)\n" +
" I i = (permits p)-> {};\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2337,7 +2341,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 3)\n" +
" I i = (permits p)-> {};\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"4. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -2361,7 +2365,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public void foo(permits this) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2379,7 +2383,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public void foo(permits this) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -2398,7 +2402,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public void foo(permits this) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2416,7 +2420,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public void foo(permits this) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -2437,12 +2441,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" public void foo(permits this) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2462,12 +2466,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" public void foo(permits this) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -2489,7 +2493,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" permits p;\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -2515,7 +2519,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" permits p;\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -2544,7 +2548,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" for (permits i = 0; i < 10; ++i) {} \n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 6)\n" +
" Zork();\n" +
@@ -2572,7 +2576,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" for (permits i = 0; i < 10; ++i) {} \n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 6)\n" +
" Zork();\n" +
@@ -2598,12 +2602,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public static void main(permits[] args) {\n" +
" ^^^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" for (permits p : args) {} \n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2623,12 +2627,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public static void main(permits[] args) {\n" +
" ^^^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 3)\n" +
" for (permits p : args) {} \n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -2659,7 +2663,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" try (permits y = new Y()) {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2689,7 +2693,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" try (permits y = new Y()) {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -2720,7 +2724,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" } catch (permits e) {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2750,7 +2754,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" } catch (permits e) {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -2773,7 +2777,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 1)\n" +
" record X(permits p) {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2818,7 +2822,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" <permits>this(t);\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 5)\n" +
" <permits>this(t);\n" +
@@ -2845,7 +2849,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" <permits>this(t);\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 5)\n" +
" <permits>this(t);\n" +
@@ -2879,7 +2883,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 5)\n" +
" new <permits>X(t).foo();\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -2907,7 +2911,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 5)\n" +
" new <permits>X(t).foo();\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -2931,7 +2935,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 6)\n" +
" x.<permits>foo(0);\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 6)\n" +
" x.<permits>foo(0);\n" +
@@ -2959,7 +2963,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 6)\n" +
" x.<permits>foo(0);\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 6)\n" +
" x.<permits>foo(0);\n" +
@@ -2987,7 +2991,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" X x = new permits();\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3009,7 +3013,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" X x = new permits();\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3036,12 +3040,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" new permits() {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 9)\n" +
" abstract class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3069,7 +3073,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" new permits() {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 6)\n" +
" Zork();\n" +
@@ -3079,7 +3083,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 11)\n" +
" abstract class permits {\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3100,7 +3104,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" Object[] p = new permits[10];\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3120,7 +3124,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" Object[] p = new permits[10];\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3147,12 +3151,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 3)\n" +
" new X().foo((permits) null);\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 5)\n" +
" private void foo(permits o) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3178,12 +3182,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 3)\n" +
" new X().foo((permits) null);\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"4. ERROR in X.java (at line 5)\n" +
" private void foo(permits o) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3204,7 +3208,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" if (o instanceof permits) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3224,7 +3228,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" if (o instanceof permits) {}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3256,7 +3260,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 8)\n" +
" class permits{}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3287,7 +3291,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 8)\n" +
" class permits{}\n" +
" ^^^^^^^\n" +
- "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'permits\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3311,7 +3315,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3337,7 +3341,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3367,7 +3371,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" sealed p;\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -3378,7 +3382,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in sealed.java (at line 1)\n" +
" public class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3403,7 +3407,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" sealed p;\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -3414,7 +3418,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in sealed.java (at line 1)\n" +
" public class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3434,7 +3438,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X<sealed> {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3460,7 +3464,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X<sealed> {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3484,7 +3488,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X extends sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3494,7 +3498,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3516,7 +3520,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X extends sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3526,7 +3530,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3549,7 +3553,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X implements sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3559,7 +3563,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" interface sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3581,7 +3585,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X implements sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3591,7 +3595,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" interface sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3614,7 +3618,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" interface X extends sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3624,7 +3628,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" interface sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3646,7 +3650,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" interface X extends sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3656,7 +3660,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 6)\n" +
" interface sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -3683,7 +3687,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 2)\n" +
" sealed foo() {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3709,7 +3713,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" sealed foo() {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3735,7 +3739,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" void foo() throws sealed{\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3760,7 +3764,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" void foo() throws sealed{\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 3)\n" +
" Zork();\n" +
@@ -3786,7 +3790,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X <T extends sealed> {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 1)\n" +
" class X <T extends sealed> {\n" +
@@ -3826,7 +3830,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 1)\n" +
" class X <T extends sealed>{\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 1)\n" +
" class X <T extends sealed>{\n" +
@@ -3869,7 +3873,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" private final sealed p;\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 5)\n" +
" Zork();\n" +
@@ -3896,7 +3900,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" private final sealed p;\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 5)\n" +
" Zork();\n" +
@@ -3931,7 +3935,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 3)\n" +
" I i = (sealed p)-> {};\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -3960,7 +3964,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 3)\n" +
" I i = (sealed p)-> {};\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"4. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -3984,7 +3988,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public void foo(sealed this) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4002,7 +4006,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public void foo(sealed this) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4021,7 +4025,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public void foo(sealed this) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4039,7 +4043,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public void foo(sealed this) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4060,12 +4064,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" public void foo(sealed this) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4085,12 +4089,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" public void foo(sealed this) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4112,7 +4116,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" sealed p;\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -4138,7 +4142,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" sealed p;\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 4)\n" +
" Zork();\n" +
@@ -4167,7 +4171,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" for (sealed i = 0; i < 10; ++i) {} \n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 6)\n" +
" Zork();\n" +
@@ -4195,7 +4199,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" for (sealed i = 0; i < 10; ++i) {} \n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 6)\n" +
" Zork();\n" +
@@ -4221,12 +4225,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public static void main(sealed[] args) {\n" +
" ^^^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 3)\n" +
" for (sealed p : args) {} \n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4246,12 +4250,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 2)\n" +
" public static void main(sealed[] args) {\n" +
" ^^^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 3)\n" +
" for (sealed p : args) {} \n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4282,7 +4286,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" try (sealed y = new Y()) {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4312,7 +4316,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" try (sealed y = new Y()) {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4343,7 +4347,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" } catch (sealed e) {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4373,7 +4377,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" } catch (sealed e) {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4396,7 +4400,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 1)\n" +
" record X(sealed p) {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4441,7 +4445,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" <sealed>this(t);\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 5)\n" +
" <sealed>this(t);\n" +
@@ -4468,7 +4472,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" <sealed>this(t);\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 5)\n" +
" <sealed>this(t);\n" +
@@ -4502,7 +4506,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 5)\n" +
" new <sealed>X(t).foo();\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4530,7 +4534,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 5)\n" +
" new <sealed>X(t).foo();\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4554,7 +4558,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 6)\n" +
" x.<sealed>foo(0);\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 6)\n" +
" x.<sealed>foo(0);\n" +
@@ -4582,7 +4586,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 6)\n" +
" x.<sealed>foo(0);\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 6)\n" +
" x.<sealed>foo(0);\n" +
@@ -4610,7 +4614,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" X x = new sealed();\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4632,7 +4636,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 5)\n" +
" X x = new sealed();\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4659,12 +4663,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" new sealed() {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 9)\n" +
" abstract class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4692,7 +4696,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" new sealed() {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"2. ERROR in X.java (at line 6)\n" +
" Zork();\n" +
@@ -4702,7 +4706,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"3. ERROR in X.java (at line 11)\n" +
" abstract class sealed {\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4723,7 +4727,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" Object[] p = new sealed[10];\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4743,7 +4747,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" Object[] p = new sealed[10];\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4770,12 +4774,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 3)\n" +
" new X().foo((sealed) null);\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"3. ERROR in X.java (at line 5)\n" +
" private void foo(sealed o) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4801,12 +4805,12 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 3)\n" +
" new X().foo((sealed) null);\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n" +
"4. ERROR in X.java (at line 5)\n" +
" private void foo(sealed o) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4827,7 +4831,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" if (o instanceof sealed) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4847,7 +4851,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"1. ERROR in X.java (at line 3)\n" +
" if (o instanceof sealed) {}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
@@ -4879,7 +4883,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 8)\n" +
" class sealed{}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4910,7 +4914,7 @@ public class SealedTypesTests extends AbstractRegressionTest9 {
"2. ERROR in X.java (at line 8)\n" +
" class sealed{}\n" +
" ^^^^^^\n" +
- "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java "+ AbstractRegressionTest.PREVIEW_ALLOWED_LEVEL +"\n" +
+ "\'sealed\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 17\n" +
"----------\n",
null,
true,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchPatternTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchPatternTest.java
index d35f62f9da..3a7442ba41 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchPatternTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchPatternTest.java
@@ -7,6 +7,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -32,13 +36,13 @@ public class SwitchPatternTest extends AbstractRegressionTest9 {
// TESTS_NAMES = new String[] { "testBug575737"};
}
- private static String previewLevel = "17";
+ private static String previewLevel = "18";
public static Class<?> testClass() {
return SwitchPatternTest.class;
}
public static Test suite() {
- return buildMinimalComplianceTestSuite(testClass(), F_17);
+ return buildMinimalComplianceTestSuite(testClass(), F_18);
}
public SwitchPatternTest(String testName){
super(testName);
@@ -47,9 +51,9 @@ public class SwitchPatternTest extends AbstractRegressionTest9 {
// Enables the tests to run individually
protected Map<String, String> getCompilerOptions() {
Map<String, String> defaultOptions = super.getCompilerOptions();
- defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_17); // FIXME
- defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_17);
- defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_17);
+ defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_18);
+ defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_18);
+ defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_18);
defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
defaultOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
index 26ce171052..c8759cacec 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contributions for
@@ -218,7 +222,10 @@ public static Test suite() {
since_17.add(SealedTypesTests.class);
since_17.add(SwitchPatternTest.class);
since_17.add(InstanceofPrimaryPatternTest.class);
- since_17.add(NullAnnotationTests17.class);
+ since_17.add(NullAnnotationTests18.class);
+
+ // add 18 specific test here (check duplicates)
+ ArrayList since_18 = new ArrayList();
// Build final test suite
TestSuite all = new TestSuite(TestAll.class.getName());
@@ -416,6 +423,26 @@ public static Test suite() {
TestCase.resetForgottenFilters(tests_17);
all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_17), tests_17));
}
+ if ((possibleComplianceLevels & AbstractCompilerTest.F_18) != 0) {
+ ArrayList tests_18 = (ArrayList)standardTests.clone();
+ tests_18.addAll(since_1_4);
+ tests_18.addAll(since_1_5);
+ tests_18.addAll(since_1_6);
+ tests_18.addAll(since_1_7);
+ tests_18.addAll(since_1_8);
+ tests_18.addAll(since_9);
+ tests_18.addAll(since_10);
+ tests_18.addAll(since_11);
+ tests_18.addAll(since_12);
+ tests_18.addAll(since_13);
+ tests_18.addAll(since_14);
+ tests_18.addAll(since_15);
+ tests_18.addAll(since_16);
+ tests_18.addAll(since_17);
+ tests_18.addAll(since_18);
+ TestCase.resetForgottenFilters(tests_18);
+ all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_18), tests_18));
+ }
all.addTest(new TestSuite(Jsr14Test.class));
return all;
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
index 74a0c470cb..db53254641 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -49,6 +53,7 @@ public class AbstractCompilerTest extends TestCase {
public static final int F_15 = 0x1000;
public static final int F_16 = 0x2000;
public static final int F_17 = 0x4000;
+ public static final int F_18 = 0x8000;
public static final boolean RUN_JAVAC = CompilerOptions.ENABLED.equals(System.getProperty("run.javac"));
public static final boolean PERFORMANCE_ASSERTS = !CompilerOptions.DISABLED.equals(System.getProperty("jdt.performance.asserts"));
@@ -68,6 +73,7 @@ public class AbstractCompilerTest extends TestCase {
protected static boolean isJRE15Plus = false;
protected static boolean isJRE16Plus = false;
protected static boolean isJRE17Plus = false;
+ protected static boolean isJRE18Plus = false;
protected static boolean reflectNestedClassUseDollar;
public static int[][] complianceTestLevelMapping = new int[][] {
@@ -86,6 +92,7 @@ public class AbstractCompilerTest extends TestCase {
new int[] {F_15, ClassFileConstants.MAJOR_VERSION_15},
new int[] {F_16, ClassFileConstants.MAJOR_VERSION_16},
new int[] {F_17, ClassFileConstants.MAJOR_VERSION_17},
+ new int[] {F_18, ClassFileConstants.MAJOR_VERSION_18},
};
/**
@@ -315,7 +322,8 @@ public class AbstractCompilerTest extends TestCase {
public static int getPossibleComplianceLevels() {
if (possibleComplianceLevels == UNINITIALIZED) {
String specVersion = System.getProperty("java.specification.version");
- isJRE17Plus = CompilerOptions.VERSION_17.equals(specVersion);
+ isJRE18Plus = CompilerOptions.VERSION_18.equals(specVersion);
+ isJRE17Plus = isJRE18Plus || CompilerOptions.VERSION_17.equals(specVersion);
isJRE16Plus = isJRE17Plus || CompilerOptions.VERSION_16.equals(specVersion);
isJRE15Plus = isJRE16Plus || CompilerOptions.VERSION_15.equals(specVersion);
isJRE14Plus = isJRE15Plus || CompilerOptions.VERSION_14.equals(specVersion);
@@ -372,6 +380,9 @@ public class AbstractCompilerTest extends TestCase {
} else if (CompilerOptions.VERSION_17.equals(compliance)) {
if (isJRE17Plus)
possibleComplianceLevels |= F_17;
+ } else if (CompilerOptions.VERSION_18.equals(compliance)) {
+ if (isJRE18Plus)
+ possibleComplianceLevels |= F_18;
} else {
System.out.println("Ignoring invalid compliance (" + compliance + ")");
System.out.print("Use one of ");
@@ -389,7 +400,9 @@ public class AbstractCompilerTest extends TestCase {
System.out.print(CompilerOptions.VERSION_13 + ", ");
System.out.println(CompilerOptions.VERSION_14 + ", ");
System.out.println(CompilerOptions.VERSION_15 + ", ");
- System.out.println(CompilerOptions.VERSION_16);
+ System.out.println(CompilerOptions.VERSION_16 + ", ");
+ System.out.println(CompilerOptions.VERSION_17 + ", ");
+ System.out.println(CompilerOptions.VERSION_18);
}
}
if (possibleComplianceLevels == 0) {
@@ -459,6 +472,10 @@ public class AbstractCompilerTest extends TestCase {
if (canRun17) {
possibleComplianceLevels |= F_17;
}
+ boolean canRun18 = canRun17 && !CompilerOptions.VERSION_17.equals(specVersion);
+ if (canRun18) {
+ possibleComplianceLevels |= F_18;
+ }
} else if ("1.0".equals(specVersion)
|| CompilerOptions.VERSION_1_1.equals(specVersion)
|| CompilerOptions.VERSION_1_2.equals(specVersion)
@@ -491,6 +508,9 @@ public class AbstractCompilerTest extends TestCase {
possibleComplianceLevels |= F_16;
if (!CompilerOptions.VERSION_16.equals(specVersion)) {
possibleComplianceLevels |= F_17;
+ if (!CompilerOptions.VERSION_17.equals(specVersion)) {
+ possibleComplianceLevels |= F_18;
+ }
}
}
}
@@ -671,7 +691,7 @@ public class AbstractCompilerTest extends TestCase {
}
protected static String getVersionString(long compliance) {
- String version = "version 16 : 60.0";
+ String version = "version 17 : 61.0";
if (compliance < ClassFileConstants.JDK9) return "version 1.8 : 52.0";
if (compliance == ClassFileConstants.JDK9) return "version 9 : 53.0";
if (compliance == ClassFileConstants.JDK10) return "version 10 : 54.0";
@@ -680,7 +700,7 @@ public class AbstractCompilerTest extends TestCase {
int major = Integer.parseInt(ver) + ClassFileConstants.MAJOR_VERSION_0;
return "version " + ver + " : " + major + ".0";
}
- if (compliance >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_17)) return version; // keep this stmt for search for next bump up
+ if (compliance >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_18)) return version; // keep this stmt for search for next bump up
return version;
}
diff --git a/org.eclipse.jdt.core.tests.model/pom.xml b/org.eclipse.jdt.core.tests.model/pom.xml
index 2a9fcdb690..199ddbac48 100644
--- a/org.eclipse.jdt.core.tests.model/pom.xml
+++ b/org.eclipse.jdt.core.tests.model/pom.xml
@@ -266,6 +266,36 @@
<tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,14,17</tycho.surefire.argLine>
</properties>
</profile>
+ <profile>
+ <id>test-on-javase-18</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-toolchains-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>toolchain</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <toolchains>
+ <jdk>
+ <id>JavaSE-18</id>
+ </jdk>
+ </toolchains>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,15,18</tycho.surefire.argLine>
+ </properties>
+ </profile>
</profiles>
</project>
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter_PreviewTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter_PreviewTest.java
index 11b93edd78..fa5ea1d130 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter_PreviewTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter_PreviewTest.java
@@ -8,6 +8,11 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.core.tests.dom;
@@ -45,10 +50,10 @@ public class ASTConverter_PreviewTest extends ConverterTestSetup {
super.setUpSuite();
this.ast = AST.newAST(getASTLatest(), false);
this.currentProject = getJavaProject("Converter_17");
- if (this.ast.apiLevel() == AST.JLS17) {
- this.currentProject.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_17);
- this.currentProject.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_17);
- this.currentProject.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_17);
+ if (this.ast.apiLevel() == AST.JLS18) {
+ this.currentProject.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_18);
+ this.currentProject.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_18);
+ this.currentProject.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_18);
this.currentProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
this.currentProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
@@ -64,7 +69,7 @@ public class ASTConverter_PreviewTest extends ConverterTestSetup {
}
static int getASTLatest() {
- return AST.JLS17;
+ return AST.getJLSLatest();
}
protected void tearDown() throws Exception {
super.tearDown();
@@ -75,12 +80,12 @@ public class ASTConverter_PreviewTest extends ConverterTestSetup {
}
private void printJREError() {
- System.err.println("Test "+getName()+" requires a JRE 17");
+ System.err.println("Test "+getName()+" requires a JRE 18");
}
@SuppressWarnings("rawtypes")
public void testTypePattern() throws CoreException {
- if (!isJRE17) {
+ if (!isJRE18) {
printJREError();
return;
}
@@ -128,7 +133,7 @@ public class ASTConverter_PreviewTest extends ConverterTestSetup {
@SuppressWarnings("rawtypes")
public void testGuardedPattern() throws CoreException {
- if (!isJRE17) {
+ if (!isJRE18) {
printJREError();
return;
}
@@ -184,7 +189,7 @@ public class ASTConverter_PreviewTest extends ConverterTestSetup {
@SuppressWarnings("rawtypes")
public void testParenthesizedExpressionPattern() throws CoreException {
- if (!isJRE17) {
+ if (!isJRE18) {
printJREError();
return;
}
@@ -225,7 +230,7 @@ public class ASTConverter_PreviewTest extends ConverterTestSetup {
@SuppressWarnings("rawtypes")
public void testNullPattern() throws CoreException {
- if (!isJRE17) {
+ if (!isJRE18) {
printJREError();
return;
}
@@ -258,7 +263,7 @@ public class ASTConverter_PreviewTest extends ConverterTestSetup {
@SuppressWarnings("rawtypes")
public void testCaseDefaultExpressionPattern() throws CoreException {
- if (!isJRE17) {
+ if (!isJRE18) {
printJREError();
return;
}
@@ -290,8 +295,8 @@ public class ASTConverter_PreviewTest extends ConverterTestSetup {
}
public void testBug575250() throws CoreException {
- if (!isJRE17) {
- System.err.println("Test "+getName()+" requires a JRE 17");
+ if (!isJRE18) {
+ System.err.println("Test "+getName()+" requires a JRE 18");
return;
}
String contents = "public class X {\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java
index 44107f79f2..9628f5441e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java
@@ -7,6 +7,11 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -493,7 +498,9 @@ public class AbstractASTTests extends ModifyingResourceTests implements DefaultM
String option = cu.getJavaProject().getOption(JavaCore.COMPILER_COMPLIANCE, true);
long jdkLevel = CompilerOptions.versionToJdkLevel(option);
int JLSLevel = AST_INTERNAL_JLS3;
- if (jdkLevel >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_17)) {
+ if (jdkLevel >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_18)) {
+ JLSLevel = AST_INTERNAL_JLS18;
+ } else if (jdkLevel >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_17)) {
JLSLevel = AST_INTERNAL_JLS17;
} else if (jdkLevel >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_16)) {
JLSLevel = AST_INTERNAL_JLS16;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
index 0973f7d600..0b9d86e904 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Brock Janiczak - Contribution for bug 150741
@@ -15946,7 +15950,7 @@ public void testBug567016() {
* https://bugs.eclipse.org/573949 - [17][switch pattern][formatter] JEP 406 changes
*/
public void testBug573949() {
- setComplianceLevel(CompilerOptions.VERSION_17);
+ setComplianceLevel(CompilerOptions.VERSION_18);
String source =
"public class X {\n" +
" private static void foo(Object o) {\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
index 40b9217207..4b1cd5a75c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
@@ -7,6 +7,15 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -158,6 +167,7 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
protected static boolean isJRE15 = false;
protected static boolean isJRE16 = false;
protected static boolean isJRE17 = false;
+ protected static boolean isJRE18 = false;
static {
String javaVersion = System.getProperty("java.version");
String vmName = System.getProperty("java.vm.name");
@@ -170,6 +180,9 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
}
}
long jdkLevel = CompilerOptions.versionToJdkLevel(javaVersion.length() > 3 ? javaVersion.substring(0, 3) : javaVersion);
+ if (jdkLevel >= ClassFileConstants.JDK18) {
+ isJRE18 = true;
+ }
if (jdkLevel >= ClassFileConstants.JDK17) {
isJRE17 = true;
}
@@ -256,7 +269,10 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
* Internal synonym for constant AST.JSL17
*/
protected static final int AST_INTERNAL_JLS17 = AST.JLS17;
-
+ /**
+ * Internal synonym for constant AST.JSL18
+ */
+ protected static final int AST_INTERNAL_JLS18 = AST.JLS18;
/**
* Internal synonym for the latest AST level.
*
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchPatternTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchPatternTest.java
index c61b680479..4103fa6383 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchPatternTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchPatternTest.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.core.tests.rewrite.describing;
@@ -53,23 +57,23 @@ public class ASTRewritingSwitchPatternTest extends ASTRewritingTest {
}
public static Test suite() {
- return createSuite(ASTRewritingSwitchPatternTest.class, 17);
+ return createSuite(ASTRewritingSwitchPatternTest.class, 18);
}
@Override
protected void setUp() throws Exception {
super.setUp();
- if (this.apiLevel == AST.JLS17 ) { // Remove this after it is a standard feature
- this.project1.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_17);
- this.project1.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_17);
- this.project1.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_17);
+ if (this.apiLevel == AST.JLS18 ) { // Remove this after it is a standard feature
+ this.project1.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_18);
+ this.project1.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_18);
+ this.project1.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_18);
this.project1.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
}
}
private boolean checkAPILevel() {
- if (this.apiLevel < 17) {
- System.err.println("Test "+getName()+" requires a JRE 17");
+ if (this.apiLevel < 18) {
+ System.err.println("Test "+getName()+" requires a JRE 18");
return true;
}
return false;
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
index 80fa6adca1..a617c443a8 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Tom Tromey - Contribution for bug 125961
@@ -3189,6 +3193,9 @@ private String optionStringToVersion(String currentArg) {
case "17": //$NON-NLS-1$
case "17.0": //$NON-NLS-1$
return CompilerOptions.VERSION_17;
+ case "18": //$NON-NLS-1$
+ case "18.0": //$NON-NLS-1$
+ return CompilerOptions.VERSION_18;
default:
return null;
}
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
index 6c0343fe92..b0031386a9 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -8,6 +8,10 @@
#
# SPDX-License-Identifier: EPL-2.0
#
+# This is an implementation of an early-draft specification developed under the Java
+# Community Process (JCP) and is made available for testing and evaluation purposes
+# only. The code is not compatible with any specification of the JCP.
+#
# Contributors:
# IBM Corporation - initial API and implementation
# Benjamin Muskalla - Contribution for bug 239066
@@ -67,7 +71,7 @@ configure.duplicateTarget = duplicate target compliance setting specification: {
configure.unsupportedReleaseOption = option --release is supported only when run with JDK 9 or above
configure.unsupportedWithRelease = option {0} is not supported when --release is used
configure.unsupportedReleaseVersion = release version {0} is not supported
-configure.source = source level should be in ''1.1''...''1.8'',''9''...''17'' (or ''5.0''..''17.0''): {0}
+configure.source = source level should be in ''1.1''...''1.8'',''9''...''18'' (or ''5.0''..''18.0''): {0}
configure.invalidSystem = invalid location for system libraries: {0}
configure.unsupportedOption = option {0} not supported at compliance level 9 and above
configure.duplicateOutputPath = duplicate output path specification: {0}
@@ -84,7 +88,7 @@ configure.invalidDebugOption = invalid debug option: {0}
configure.invalidWarningConfiguration = invalid warning configuration: ''{0}''
configure.invalidWarning = invalid warning token: ''{0}''. Ignoring warning and compiling
configure.invalidWarningOption = invalid warning option: ''{0}''. Must specify a warning token
-configure.targetJDK = target level should be in ''1.1''...''1.8'',''9''...''17'' (or ''5.0''..''17.0'') or cldc1.1: {0}
+configure.targetJDK = target level should be in ''1.1''...''1.8'',''9''...''18'' (or ''5.0''..''18.0'') or cldc1.1: {0}
configure.incompatibleTargetForSource = Target level ''{0}'' is incompatible with source level ''{1}''. A target level ''{1}'' or better is required
configure.incompatibleTargetForGenericSource = Target level ''{0}'' is incompatible with source level ''{1}''. A source level ''1.5'' or better is required
configure.incompatibleComplianceForSource = Compliance level ''{0}'' is incompatible with source level ''{1}''. A compliance level ''{1}'' or better is required
@@ -252,9 +256,10 @@ misc.usage = {1} {2}\n\
\ -15 -15.0 use 15 compliance (-source 15 -target 15)\n\
\ -16 -16.0 use 16 compliance (-source 16 -target 16)\n\
\ -17 -17.0 use 17 compliance (-source 17 -target 17)\n\
-\ -source <version> set source level: 1.3 to 1.9, 10 to 17\n\
+\ -18 -18.0 use 18 compliance (-source 18 -target 18)\n\
+\ -source <version> set source level: 1.3 to 1.9, 10 to 18\n\
\ (or 6, 6.0, etc)\n\
-\ -target <version> set classfile target: 1.3 to 1.9, 10 to 17\n\
+\ -target <version> set classfile target: 1.3 to 1.9, 10 to 18\n\
\ (or 6, 6.0, etc)\n\
\ cldc1.1 can also be used to generate the StackMap\n\
\ attribute\n\
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
index bd8202006a..7e5edf7101 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Jesper S Moller - Contributions for
@@ -134,9 +138,10 @@ public interface ClassFileConstants {
int MAJOR_VERSION_15 = 59;
int MAJOR_VERSION_16 = 60;
int MAJOR_VERSION_17 = 61;
+ int MAJOR_VERSION_18 = 62;
int MAJOR_VERSION_0 = 44;
- int MAJOR_LATEST_VERSION = MAJOR_VERSION_17;
+ int MAJOR_LATEST_VERSION = MAJOR_VERSION_18;
int MINOR_VERSION_0 = 0;
int MINOR_VERSION_1 = 1;
@@ -164,6 +169,7 @@ public interface ClassFileConstants {
long JDK15 = ((long)ClassFileConstants.MAJOR_VERSION_15 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK16 = ((long)ClassFileConstants.MAJOR_VERSION_16 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK17 = ((long)ClassFileConstants.MAJOR_VERSION_17 << 16) + ClassFileConstants.MINOR_VERSION_0;
+ long JDK18 = ((long)ClassFileConstants.MAJOR_VERSION_18 << 16) + ClassFileConstants.MINOR_VERSION_0;
public static long getLatestJDKLevel() {
return ((long)ClassFileConstants.MAJOR_LATEST_VERSION << 16) + ClassFileConstants.MINOR_VERSION_0;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index 9cd3c78116..c8a9bc0340 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Benjamin Muskalla - Contribution for bug 239066
@@ -237,6 +241,7 @@ public class CompilerOptions {
public static final String VERSION_15 = "15"; //$NON-NLS-1$
public static final String VERSION_16 = "16"; //$NON-NLS-1$
public static final String VERSION_17 = "17"; //$NON-NLS-1$
+ public static final String VERSION_18 = "18"; //$NON-NLS-1$
/*
* Note: Whenever a new version is added, make sure getLatestVersion()
* is updated with it.
@@ -607,7 +612,7 @@ public class CompilerOptions {
* Return the latest Java language version supported by the Eclipse compiler
*/
public static String getLatestVersion() {
- return VERSION_17;
+ return VERSION_18;
}
/**
* Return the most specific option key controlling this irritant. Note that in some case, some irritant is controlled by
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java
index f0ad92a253..2b0f2c10a6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java
@@ -7,6 +7,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -57,7 +61,7 @@ public enum JavaFeature {
Messages.bind(Messages.sealed_types),
new char[][] {TypeConstants.SEALED, TypeConstants.PERMITS},
false),
- PATTERN_MATCHING_IN_SWITCH(ClassFileConstants.JDK17,
+ PATTERN_MATCHING_IN_SWITCH(ClassFileConstants.JDK18,
Messages.bind(Messages.pattern_matching_switch),
new char[][] {},
true),
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
index 782858583a..99f858d6ca 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2020 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -205,6 +209,8 @@ public interface JavadocTagConstants {
{},
// since 17
{},
+ // since 18
+ {},
};
public static final char[][][] INLINE_TAGS = {
// since 1.0
@@ -242,6 +248,8 @@ public interface JavadocTagConstants {
//since 16
{},
//since 17
+ {},
+ //since 18
{}
};
public final static int INLINE_TAGS_LENGTH = INLINE_TAGS.length;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index 5b2ac4e938..4f9e94fb46 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Tom Tromey - patch for readTable(String) as described in http://bugs.eclipse.org/bugs/show_bug.cgi?id=32196
@@ -245,6 +249,8 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
compliance = ClassFileConstants.JDK16;
} else if("17".equals(token)) { //$NON-NLS-1$
compliance = ClassFileConstants.JDK17;
+ } else if("18".equals(token)) { //$NON-NLS-1$
+ compliance = ClassFileConstants.JDK18;
} else if("recovery".equals(token)) { //$NON-NLS-1$
compliance = ClassFileConstants.JDK_DEFERRED;
}
@@ -984,6 +990,7 @@ protected boolean parsingJava9Plus;
protected boolean parsingJava14Plus;
protected boolean parsingJava15Plus;
protected boolean parsingJava17Plus;
+protected boolean parsingJava18Plus;
protected boolean previewEnabled;
protected boolean parsingJava11Plus;
protected int unstackedAct = ERROR_ACTION;
@@ -1012,6 +1019,7 @@ public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals) {
this.parsingJava14Plus = this.options.sourceLevel >= ClassFileConstants.JDK14;
this.parsingJava15Plus = this.options.sourceLevel >= ClassFileConstants.JDK15;
this.parsingJava17Plus = this.options.sourceLevel >= ClassFileConstants.JDK17;
+ this.parsingJava18Plus = this.options.sourceLevel >= ClassFileConstants.JDK18;
this.previewEnabled = this.options.sourceLevel == ClassFileConstants.getLatestJDKLevel() && this.options.enablePreviewFeatures;
this.astLengthStack = new int[50];
this.patternLengthStack = new int[20];
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
index a3e9af1686..cadce45854 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for bug 186342 - [compiler][null] Using annotations for null checking
@@ -4995,7 +4999,7 @@ private VanguardScanner getNewVanguardScanner() {
return vs;
}
protected final boolean mayBeAtCasePattern(int token) {
- return (this.complianceLevel == ClassFileConstants.JDK17 && this.previewEnabled)
+ return (JavaFeature.PATTERN_MATCHING_IN_SWITCH.isSupported(this.complianceLevel, this.previewEnabled))
&& (token == TokenNamecase || this.multiCaseLabelComma);
}
protected final boolean mayBeAtBreakPreview() {
@@ -5429,7 +5433,7 @@ private boolean mayBeAtCaseLabelExpr() {
if (this.caseStartPosition <= 0)
return false;
if (this.lookBack[1] == TokenNamedefault) {
- return this.complianceLevel == ClassFileConstants.JDK17 && this.previewEnabled ?
+ return JavaFeature.PATTERN_MATCHING_IN_SWITCH.isSupported(this.complianceLevel, this.previewEnabled) ?
(this.lookBack[0] == TerminalTokens.TokenNamecase || this.lookBack[0] == TerminalTokens.TokenNameCOMMA)
: false;
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java
index 937aec0ced..8d4befdcb2 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -390,6 +394,21 @@ public final class AST {
* @since 3.28
*/
public static final int JLS17 = 17;
+ /**
+ * Constant for indicating the AST API that handles JLS17.
+ * <p>
+ * This API is capable of handling all constructs in the
+ * Java language as described in the Java Language
+ * Specification, Java SE 18 Edition (JLS18).
+ * JLS18 is a superset of all earlier versions of the
+ * Java language, and the JLS18 API can be used to manipulate
+ * programs written in all versions of the Java language
+ * up to and including Java SE 18(aka JDK 18).
+ * </p>
+ *
+ * @since 3.28 BETA_JAVA 18
+ */
+ public static final int JLS18 = 18;
/**
* Internal synonym for {@link #JLS15}. Use to alleviate
@@ -406,12 +425,16 @@ public final class AST {
* deprecation warnings once JLS17 is deprecated
*/
static final int JLS17_INTERNAL = JLS17;
-
+ /**
+ * Internal synonym for {@link #JLS18}. Use to alleviate
+ * deprecation warnings once JLS18 is deprecated
+ */
+ static final int JLS18_INTERNAL = JLS18;
/**
* Internal property for latest supported JLS level
* This provides the latest JLS level.
*/
- private static final int JLS_INTERNAL_Latest = JLS17;
+ private static final int JLS_INTERNAL_Latest = JLS18;
/**
* @since 3.26
@@ -1153,6 +1176,7 @@ public final class AST {
t.put(JavaCore.VERSION_15, ClassFileConstants.JDK15);
t.put(JavaCore.VERSION_16, ClassFileConstants.JDK16);
t.put(JavaCore.VERSION_17, ClassFileConstants.JDK17);
+ t.put(JavaCore.VERSION_18, ClassFileConstants.JDK18);
return Collections.unmodifiableMap(t);
}
private static Map<String, Integer> getApiLevelMapTable() {
@@ -1174,6 +1198,7 @@ public final class AST {
t.put(JavaCore.VERSION_15, JLS15_INTERNAL);
t.put(JavaCore.VERSION_16, JLS16_INTERNAL);
t.put(JavaCore.VERSION_17, JLS17_INTERNAL);
+ t.put(JavaCore.VERSION_18, JLS18_INTERNAL);
return Collections.unmodifiableMap(t);
}
/**
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
index 9a5a839db1..0e8ef9c4d2 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -2420,6 +2424,21 @@ public abstract class ASTNode {
throw new UnsupportedOperationException("Operation only supported in JLS17 AST"); //$NON-NLS-1$
}
}
+ /**
+ * Checks that this AST operation is only used when
+ * building JLS18 level ASTs.
+ * <p>
+ * Use this method to prevent access to new properties available only in JLS18.
+ * </p>
+ *
+ * @exception UnsupportedOperationException if this operation is not used in JLS18
+ * @since 3.28 BETA_JAVA 18
+ */
+ final void supportedOnlyIn18() {
+ if (this.ast.apiLevel != AST.JLS18_INTERNAL) {
+ throw new UnsupportedOperationException("Operation only supported in JLS17 AST"); //$NON-NLS-1$
+ }
+ }
/**
* Sets or clears this node's parent node and location.
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/GuardedPattern.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/GuardedPattern.java
index dd0837fb61..1c92ef14b5 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/GuardedPattern.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/GuardedPattern.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -36,7 +40,7 @@ public class GuardedPattern extends Pattern{
GuardedPattern(AST ast) {
super(ast);
- supportedOnlyIn17();
+ supportedOnlyIn18();
unsupportedWithoutPreviewError();
}
@@ -198,7 +202,7 @@ public class GuardedPattern extends Pattern{
* @return the expression node, or <code>null</code> if there is none
*/
public Expression getExpression() {
- supportedOnlyIn17();
+ supportedOnlyIn18();
unsupportedWithoutPreviewError();
return this.conditonalExpression;
}
@@ -213,7 +217,7 @@ public class GuardedPattern extends Pattern{
* @noreference This method is not intended to be referenced by clients as it is a part of Java preview feature.
*/
public Pattern getPattern() {
- supportedOnlyIn17();
+ supportedOnlyIn18();
unsupportedWithoutPreviewError();
return this.pattern;
}
@@ -232,7 +236,7 @@ public class GuardedPattern extends Pattern{
* </ul>
*/
public void setExpression(Expression expression) {
- supportedOnlyIn17();
+ supportedOnlyIn18();
unsupportedWithoutPreviewError();
ASTNode oldChild = this.conditonalExpression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
@@ -248,7 +252,7 @@ public class GuardedPattern extends Pattern{
* @exception UnsupportedOperationException if this operation is used without previewEnabled
*/
public void setPattern(Pattern pattern) {
- supportedOnlyIn17();
+ supportedOnlyIn18();
unsupportedWithoutPreviewError();
ASTNode oldChild = this.pattern;
preReplaceChild(oldChild, pattern, PATTERN_PROPERTY);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypePattern.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypePattern.java
index 7990584fbf..f86030863c 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypePattern.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypePattern.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -60,7 +64,7 @@ public class TypePattern extends Pattern {
TypePattern(AST ast) {
super(ast);
- supportedOnlyIn17();
+ supportedOnlyIn18();
unsupportedWithoutPreviewError();
}
@@ -123,7 +127,7 @@ public class TypePattern extends Pattern {
@Override
public List<SingleVariableDeclaration> patternVariables() {
- supportedOnlyIn17();
+ supportedOnlyIn18();
unsupportedWithoutPreviewError();
return new ArrayList<SingleVariableDeclaration>(Arrays.asList(getPatternVariable()));
}
@@ -143,7 +147,7 @@ public class TypePattern extends Pattern {
* @noreference This method is not intended to be referenced by clients as it is a part of Java preview feature.
*/
public void setPatternVariable(SingleVariableDeclaration patternVariable) {
- supportedOnlyIn17();
+ supportedOnlyIn18();
unsupportedWithoutPreviewError();
if (patternVariable == null) {
throw new IllegalArgumentException();
@@ -163,7 +167,7 @@ public class TypePattern extends Pattern {
* @noreference This method is not intended to be referenced by clients as it is a part of Java preview feature.
*/
public SingleVariableDeclaration getPatternVariable() {
- supportedOnlyIn17();
+ supportedOnlyIn18();
unsupportedWithoutPreviewError();
if (this.patternVariable == null) {
// lazy init must be thread-safe for readers
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
index eae4c9c70f..f70bcdd33f 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
@@ -7,6 +7,12 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * Contributors:
* IBM Corporation - initial API and implementation
* Jesper Steen Moller - Contributions for
* bug 404146 - [1.7][compiler] nested try-catch-finally-blocks leads to unrunnable Java byte code
@@ -331,7 +337,7 @@ public class DefaultCodeFormatter extends CodeFormatter {
}
private ASTParser createParser(int kind) {
- ASTParser parser = ASTParser.newParser(AST.JLS17);
+ ASTParser parser = ASTParser.newParser(AST.JLS18);
if (kind == K_MODULE_INFO) {
parser.setSource(createDummyModuleInfoCompilationUnit());
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
index 80056a5e32..13a5f2e9cf 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* IBM Corporation - added the following constants:
@@ -3151,12 +3155,18 @@ public final class JavaCore extends Plugin {
public static final String VERSION_17 = "17"; //$NON-NLS-1$
/**
* Configurable option value: {@value}.
+ * @since 3.28 BETA_JAVA 18
+ * @category OptionValue
+ */
+ public static final String VERSION_18 = "18"; //$NON-NLS-1$
+ /**
+ * Configurable option value: {@value}.
* @since 3.4
* @category OptionValue
*/
public static final String VERSION_CLDC_1_1 = "cldc1.1"; //$NON-NLS-1$
private static List<String> allVersions = Collections.unmodifiableList(Arrays.asList(VERSION_CLDC_1_1, VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5,
- VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11, VERSION_12, VERSION_13, VERSION_14, VERSION_15, VERSION_16, VERSION_17));
+ VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11, VERSION_12, VERSION_13, VERSION_14, VERSION_15, VERSION_16, VERSION_17, VERSION_18));
/**
* Returns all {@link JavaCore}{@code #VERSION_*} levels in the order of their

Back to the top