diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java index f887e4d9975..384cd8fb7f9 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java @@ -518,9 +518,9 @@ public TypeBinding resolveType(BlockScope scope) { return null; } else { if (this.originalValueIfTrueType.kind() == Binding.POLY_TYPE) - this.originalValueIfTrueType = this.valueIfTrue.resolveType(scope); + this.originalValueIfTrueType = this.valueIfTrue.resolveTypeWithBindings(this.condition.bindingsWhenTrue(), scope); if (this.originalValueIfFalseType.kind() == Binding.POLY_TYPE) - this.originalValueIfFalseType = this.valueIfFalse.resolveType(scope); + this.originalValueIfFalseType = this.valueIfFalse.resolveTypeWithBindings(this.condition.bindingsWhenFalse(), scope); if (this.originalValueIfTrueType == null || !this.originalValueIfTrueType.isValidBinding()) return this.resolvedType = null; @@ -814,8 +814,27 @@ public boolean isPolyExpression() throws UnsupportedOperationException { @Override public boolean isCompatibleWith(TypeBinding left, Scope scope) { - return isPolyExpression() ? this.valueIfTrue.isCompatibleWith(left, scope) && this.valueIfFalse.isCompatibleWith(left, scope) : + if (!isPolyExpression()) super.isCompatibleWith(left, scope); + + scope.include(this.condition.bindingsWhenTrue()); + try { + if (!this.valueIfTrue.isCompatibleWith(left, scope)) + return false; + } finally { + scope.exclude(this.condition.bindingsWhenTrue()); + } + + scope.include(this.condition.bindingsWhenFalse()); + try { + if (!this.valueIfFalse.isCompatibleWith(left, scope)) + return false; + } finally { + scope.exclude(this.condition.bindingsWhenFalse()); + } + + return true; + } @Override diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IGenerateTypeCheck.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IGenerateTypeCheck.java index 5565d8a5fb1..7d42dc22559 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IGenerateTypeCheck.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IGenerateTypeCheck.java @@ -14,7 +14,6 @@ package org.eclipse.jdt.internal.compiler.ast; import org.eclipse.jdt.internal.compiler.ast.Pattern.PrimitiveConversionRoute; -import org.eclipse.jdt.internal.compiler.codegen.BranchLabel; import org.eclipse.jdt.internal.compiler.codegen.CodeStream; import org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; @@ -25,7 +24,7 @@ */ interface IGenerateTypeCheck { - default void generateTypeCheck(TypeBinding providedType, TypeReference expectedTypeRef, BlockScope scope, CodeStream codeStream, BranchLabel falseLabel, PrimitiveConversionRoute route) { + default void generateTypeCheck(TypeBinding providedType, TypeReference expectedTypeRef, BlockScope scope, CodeStream codeStream, PrimitiveConversionRoute route) { switch (route) { case IDENTITY_CONVERSION -> { consumeProvidedValue(providedType, codeStream); @@ -46,8 +45,7 @@ default void generateTypeCheck(TypeBinding providedType, TypeReference expectedT } case WIDENING_REFERENCE_AND_UNBOXING_COVERSION, WIDENING_REFERENCE_AND_UNBOXING_COVERSION_AND_WIDENING_PRIMITIVE_CONVERSION -> { - codeStream.ifnull(falseLabel); - codeStream.iconst_1(); + codeStream.instance_of(scope.getJavaLangObject()); setPatternIsTotalType(); } case NARROWING_AND_UNBOXING_CONVERSION -> { @@ -56,8 +54,7 @@ default void generateTypeCheck(TypeBinding providedType, TypeReference expectedT } case UNBOXING_CONVERSION, UNBOXING_AND_WIDENING_PRIMITIVE_CONVERSION -> { - codeStream.ifnull(falseLabel); - codeStream.iconst_1(); + codeStream.instance_of(scope.getJavaLangObject()); setPatternIsTotalType(); } case NO_CONVERSION_ROUTE -> { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java index 1972bd87b09..352210da4d3 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java @@ -179,7 +179,7 @@ public void generateOptimizedBoolean(BlockScope currentScope, CodeStream codeStr route = this.testContextRecord.route(); providedType = this.testContextRecord.right(); } - generateTypeCheck(providedType, this.type, currentScope, codeStream, internalFalseLabel, route); + generateTypeCheck(providedType, this.type, currentScope, codeStream, route); if (this.pattern != null) { codeStream.ifeq(internalFalseLabel); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordPattern.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordPattern.java index bc26d4f3489..883202e4099 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordPattern.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordPattern.java @@ -251,7 +251,7 @@ original record instance as receiver - leaving the stack drained. if (!p.isUnnamed()) codeStream.dup(componentType); // lastComponent ? named ? ([C, C] : [R, C, C]) : ([C] : [R, C]) if (p instanceof TypePattern) { - ((TypePattern) p).generateTypeCheck(currentScope, codeStream, matchFailLabel); + ((TypePattern) p).generateTypeCheck(currentScope, codeStream); } else { codeStream.instance_of(p.resolvedType); // lastComponent ? named ? ([C, boolean] : [R, C, boolean]) : ([boolean] : [R, boolean]) } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java index 163998c7aad..c0c5931677f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java @@ -1372,9 +1372,9 @@ public void resolve() { } } - if ((this.bits & ASTNode.UndocumentedEmptyBlock) != 0 && this.nRecordComponents == 0) { - this.scope.problemReporter().undocumentedEmptyBlock(this.bodyStart-1, this.bodyEnd); - } + if (!sourceType.isRecord() && (this.bits & ASTNode.UndocumentedEmptyBlock) != 0) + this.scope.problemReporter().undocumentedEmptyBlock(this.bodyStart - 1, this.bodyEnd); + boolean needSerialVersion = this.scope.compilerOptions().getSeverity(CompilerOptions.MissingSerialVersion) != ProblemSeverities.Ignore && sourceType.isClass() diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypePattern.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypePattern.java index 4716fde7211..dfbb068495f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypePattern.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypePattern.java @@ -110,8 +110,8 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, BranchL } } - public void generateTypeCheck(BlockScope scope, CodeStream codeStream, BranchLabel internalFalseLabel) { - generateTypeCheck(this.outerExpressionType, getType(), scope, codeStream, internalFalseLabel, + public void generateTypeCheck(BlockScope scope, CodeStream codeStream) { + generateTypeCheck(this.outerExpressionType, getType(), scope, codeStream, Pattern.findPrimitiveConversionRoute(this.resolvedType, this.accessorMethod.returnType, scope)); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java index 761b1b9fa04..63d7841b6aa 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java @@ -1460,23 +1460,4 @@ public void reportClashingDeclarations(LocalVariableBinding [] left, LocalVariab public boolean resolvingGuardExpression() { return this.resolvingGuardExpression; } - -public void include(LocalVariableBinding[] bindings) { - // `this` is assumed to be populated with bindings. - if (bindings != null) { - for (LocalVariableBinding binding : bindings) { - binding.modifiers &= ~ExtraCompilerModifiers.AccOutOfFlowScope; - } - } -} - -public void exclude(LocalVariableBinding[] bindings) { - // `this` is assumed to be populated with bindings. - if (bindings != null) { - for (LocalVariableBinding binding : bindings) { - binding.modifiers |= ExtraCompilerModifiers.AccOutOfFlowScope; - } - } -} - } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/Scope.java index 383b0b116d1..fe5bbebe33b 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/Scope.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/Scope.java @@ -5797,4 +5797,21 @@ public List collectClassesBeingInitialized() { return list; } + public void include(LocalVariableBinding[] bindings) { + // `this` is assumed to be populated with bindings. + if (bindings != null) { + for (LocalVariableBinding binding : bindings) { + binding.modifiers &= ~ExtraCompilerModifiers.AccOutOfFlowScope; + } + } + } + + public void exclude(LocalVariableBinding[] bindings) { + // `this` is assumed to be populated with bindings. + if (bindings != null) { + for (LocalVariableBinding binding : bindings) { + binding.modifiers |= ExtraCompilerModifiers.AccOutOfFlowScope; + } + } + } } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InstanceofPrimaryPatternTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InstanceofPrimaryPatternTest.java index 2e1d5eeaaae..97553036bd2 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InstanceofPrimaryPatternTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InstanceofPrimaryPatternTest.java @@ -15,7 +15,6 @@ import java.util.Map; import junit.framework.Test; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; -import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public class InstanceofPrimaryPatternTest extends AbstractRegressionTest { @@ -35,26 +34,7 @@ public static Test suite() { public InstanceofPrimaryPatternTest(String testName){ super(testName); } - // Enables the tests to run individually - protected Map getCompilerOptions(boolean preview) { - Map defaultOptions = super.getCompilerOptions(); - if (this.complianceLevel >= ClassFileConstants.getLatestJDKLevel() - && preview) { - defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED); - } - return defaultOptions; - } - - protected Map getCompilerOptions() { - return getCompilerOptions(true); - } - @Override - protected void runConformTest(String[] testFiles, String expectedOutput, Map customOptions) { - if(!isJRE17Plus) - return; - runConformTest(testFiles, expectedOutput, customOptions, new String[] {"--enable-preview"}, JAVAC_OPTIONS); - } protected void runNegativeTest( String[] testFiles, String expectedCompilerLog, @@ -71,7 +51,6 @@ protected void runNegativeTest( runner.runNegativeTest(); } public void test001() { - Map options = getCompilerOptions(true); runConformTest( new String[] { "X.java", @@ -86,8 +65,7 @@ public void test001() { " }\n" + "}\n", }, - "Hello World!", - options); + "Hello World!"); } public void test002() { String expectedDiagnostics = this.complianceLevel < ClassFileConstants.JDK20 ? @@ -670,4 +648,89 @@ private void foo(String x) { ---------- """); } + + // https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3222 + // [Patterns][Ternary] Pattern binding variable not recognized in poly conditional operator expression + public void testIssue3222() { + runConformTest( + new String[] { + "X.java", + """ + public class X { + + interface I { + int foo(); + } + + static void foo(I i) { + System.out.println(i.foo()); + } + + public static void main(String[] args) { + foo(args instanceof String [] argv ? () -> argv.length + 13 : () -> 42); + } + + } + """ + }, + "13"); + } + + // https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3222 + // [Patterns][Ternary] Pattern binding variable not recognized in poly conditional operator expression + public void testIssue3222_2() { + runConformTest( + new String[] { + "X.java", + """ + public class X { + + interface I { + int foo(); + } + + static void foo(I i) { + System.out.println(i.foo()); + } + + public static void main(String[] args) { + foo(!(args instanceof String [] argv) ? () -> 42 : () -> argv.length + 13); + } + + } + """ + }, + "13"); + } + + // https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3222 + // [Patterns][Ternary] Pattern binding variable not recognized in poly conditional operator expression + public void testIssue3222_3() { + runConformTest( + new String[] { + "X.java", + """ + import java.util.function.Supplier; + + public class X { + interface I { + int foo(Supplier arg); + default int foo(Object arg) { + return 13; + } + } + public X() { + super(); + } + public static void main(String[] argv) { + int i = ((I) (x) -> { + return x.get(); + }).foo((argv instanceof String [] args ? () -> args.length + 42 : (Supplier) null)); + System.out.println(i); + } + } + """ + }, + "42"); + } } \ No newline at end of file diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PrimitiveInPatternsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PrimitiveInPatternsTest.java index 7c782c38245..93c368e72d9 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PrimitiveInPatternsTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PrimitiveInPatternsTest.java @@ -7281,6 +7281,56 @@ public static void main(String[] args) { }, "int:30"); } + + // https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3181 + // VerifyError during conversion between T extends Long and double + public void testGH3181() { + runConformTest(new String[] { + "X.java", + """ + record Record(T t) { + } + + public class X { + public static double foo(Record s) { + return switch (s) { + case Record(double s1) -> s1 + 1.0; + default -> 0; + }; + } + + public static void main(String[] args) { + System.out.println(foo(new Record<>(42L))); + } + } + """ + }, + "43.0"); + } + + // https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3129 + // VerifyError with instanceof record patterns with conversion from double to Long + public void testGH3129() { + runConformTest(new String[] { + "X.java", + """ + record Record(Long i) { + } + + public class X { + public static double convert(Record r) { + return r instanceof Record(double d) ? d + 1.0 : 0; + } + + public static void main(String[] args) { + System.out.println(convert(new Record(42L))); + } + } + """ + }, + "43.0"); + } + public void _testSpec00X() { runNegativeTest(new String[] { "X.java", 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 a9ddcac12e9..4b7e8210a31 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 @@ -44,24 +44,9 @@ public RecordsRestrictedClassTest(String testName){ // Enables the tests to run individually protected Map getCompilerOptions() { Map defaultOptions = super.getCompilerOptions(); - defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_16); - defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_16); - defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_16); - defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE); defaultOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED); return defaultOptions; } - // Enables the tests to run individually - protected Map getCompilerOptionsWithPreviewIfApplicable() { - Map 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.DISABLED); - return defaultOptions; - } @Override protected void runConformTest(String[] testFiles, String expectedOutput) { @@ -2158,6 +2143,8 @@ public void testBug560496_001() throws Exception { RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "R.class", ClassFileBytesDisassembler.SYSTEM); } public void testBug560496_002() throws Exception { + if (this.complianceLevel < ClassFileConstants.JDK17) + return; // strictfp = nop runConformTest( new String[] { "X.java", @@ -2170,10 +2157,12 @@ public void testBug560496_002() throws Exception { }, "0"); String expectedOutput = - "public final strictfp int hashCode();\n"; + "public final int hashCode();\n"; RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "R.class", ClassFileBytesDisassembler.SYSTEM); } public void testBug560797_001() throws Exception { + if (this.complianceLevel < ClassFileConstants.JDK17) + return; // strictfp = nop runConformTest( new String[] { "X.java", @@ -2186,10 +2175,12 @@ public void testBug560797_001() throws Exception { }, "true"); String expectedOutput = - "public strictfp int x();\n"; + "public int x();\n"; RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "R.class", ClassFileBytesDisassembler.SYSTEM); } public void testBug560797_002() throws Exception { + if (this.complianceLevel < ClassFileConstants.JDK17) + return; // strictfp = nop runConformTest( new String[] { "X.java", @@ -2204,7 +2195,7 @@ public void testBug560797_002() throws Exception { }, "true"); String expectedOutput = - "public strictfp int x();\n"; + "public int x();\n"; RecordsRestrictedClassTest.verifyClassFile(expectedOutput, "R.class", ClassFileBytesDisassembler.SYSTEM); } public void testBug560798_001() throws Exception { @@ -2669,7 +2660,6 @@ public void testBug562219_001() { " public static void main(String[] args) {\n"+ " @SuppressWarnings(\"unused\")\n"+ " class Y {\n"+ - " @SuppressWarnings(\"preview\")\n"+ " class Z {\n"+ " record R() {\n"+ " \n"+ @@ -4686,13 +4676,12 @@ public void testBug564146_006() { "X.java", "public record X() {\n"+ " public X() {\n"+ - " System.out.println(10);\n"+ " this(10);\n"+ " }\n"+ "}", }, "----------\n" + - "1. ERROR in X.java (at line 4)\n" + + "1. ERROR in X.java (at line 3)\n" + " this(10);\n" + " ^^^^^^^^^\n" + "The body of a canonical constructor must not contain an explicit constructor call\n" + @@ -5961,7 +5950,6 @@ public void testBug564672b_001() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -5976,10 +5964,7 @@ public void testBug564672b_001() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_002() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -5996,9 +5981,7 @@ public void testBug564672b_002() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_003() { @@ -6006,7 +5989,6 @@ public void testBug564672b_003() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6021,10 +6003,7 @@ public void testBug564672b_003() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_004() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6041,9 +6020,7 @@ public void testBug564672b_004() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_005() { @@ -6051,7 +6028,6 @@ public void testBug564672b_005() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6068,10 +6044,7 @@ public void testBug564672b_005() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_006() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6090,9 +6063,7 @@ public void testBug564672b_006() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_007() { @@ -6100,7 +6071,6 @@ public void testBug564672b_007() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6117,10 +6087,7 @@ public void testBug564672b_007() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_008() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6139,9 +6106,7 @@ public void testBug564672b_008() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_009() { @@ -6149,7 +6114,6 @@ public void testBug564672b_009() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6166,10 +6130,7 @@ public void testBug564672b_009() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_010() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6188,9 +6149,7 @@ public void testBug564672b_010() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_011() { @@ -6198,7 +6157,6 @@ public void testBug564672b_011() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6215,10 +6173,7 @@ public void testBug564672b_011() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_012() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6237,9 +6192,7 @@ public void testBug564672b_012() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_013() { @@ -6247,7 +6200,6 @@ public void testBug564672b_013() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6266,10 +6218,7 @@ public void testBug564672b_013() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_014() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6285,9 +6234,7 @@ public void testBug564672b_014() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_015() { @@ -6295,7 +6242,6 @@ public void testBug564672b_015() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6314,10 +6260,7 @@ public void testBug564672b_015() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_016() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6333,9 +6276,7 @@ public void testBug564672b_016() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_017() { @@ -6343,7 +6284,6 @@ public void testBug564672b_017() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6362,10 +6302,7 @@ public void testBug564672b_017() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_018() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6381,14 +6318,9 @@ public void testBug564672b_018() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_019() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6419,9 +6351,7 @@ public void testBug564672b_019() { "Syntax error on token \"return\", byte expected\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_020() { @@ -6429,7 +6359,6 @@ public void testBug564672b_020() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6456,7 +6385,6 @@ public void testBug564672b_021() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6481,7 +6409,6 @@ public void testBug564672b_022() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6509,7 +6436,6 @@ public void testBug564672b_023() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6533,7 +6459,6 @@ public void testBug564672b_024() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6563,7 +6488,6 @@ public void testBug564672b_025() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6586,7 +6510,6 @@ public void testBug564672b_026() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6609,7 +6532,6 @@ public void testBug564672b_027() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6631,7 +6553,6 @@ public void testBug564672b_028() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6660,7 +6581,6 @@ public void testBug564672b_029() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6685,7 +6605,6 @@ public void testBug564672b_030() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6708,7 +6627,6 @@ public void testBug564672b_031() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6726,10 +6644,7 @@ public void testBug564672b_031() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_032() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6745,9 +6660,7 @@ public void testBug564672b_032() { " }\n" + "}\n", }, - "Hello, World!", - options - ); + "Hello, World!"); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_033() { @@ -6755,7 +6668,6 @@ public void testBug564672b_033() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6775,10 +6687,7 @@ public void testBug564672b_033() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_034() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6790,9 +6699,7 @@ public void testBug564672b_034() { "}\n" + "class Rec {}\n" }, - "0", - options - ); + "0"); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_035() { @@ -6800,7 +6707,6 @@ public void testBug564672b_035() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6843,7 +6749,6 @@ public void testBug564672b_036() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6885,7 +6790,6 @@ public void testBug564672b_037() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6917,7 +6821,6 @@ public void testBug564672b_038() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -6939,10 +6842,7 @@ public void testBug564672b_038() { options ); } -@SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_039() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -6966,9 +6866,7 @@ public void testBug564672b_039() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - options - ); + true); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void testBug564672b_040() { @@ -6976,7 +6874,6 @@ public void testBug564672b_040() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7004,7 +6901,6 @@ public void testBug564672b_041() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7034,7 +6930,6 @@ public void testBug564672b_042() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7061,7 +6956,6 @@ public void testBug564672b_043() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7088,7 +6982,6 @@ public void testBug564672b_044() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7122,7 +7015,6 @@ public void testBug564672b_045() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7152,7 +7044,6 @@ public void testBug564672b_046() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7174,7 +7065,6 @@ public void testBug564672b_047() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7207,7 +7097,6 @@ public void testBug564672b_048() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7239,7 +7128,6 @@ public void testBug564672b_049() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runConformTest( new String[] { "X.java", @@ -7267,7 +7155,6 @@ public void testBug564672b_049() { } public void testBug565388_001() { if (this.complianceLevel < ClassFileConstants.JDK17) return; - Map options = getCompilerOptionsWithPreviewIfApplicable(); this.runNegativeTest( new String[] { "X.java", @@ -7280,14 +7167,10 @@ public void testBug565388_001() { "Illegal modifier for the record X; only public, final and strictfp are permitted\n" + "----------\n", null, - true, - options - ); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); + true); } public void testBug565388_002() { if (this.complianceLevel < ClassFileConstants.JDK17) return; - Map options = getCompilerOptionsWithPreviewIfApplicable(); this.runNegativeTest( new String[] { "X.java", @@ -7300,10 +7183,7 @@ public void testBug565388_002() { "Illegal modifier for the record X; only public, final and strictfp are permitted\n" + "----------\n", null, - true, - options - ); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); + true); } public void testBug565786_001() throws IOException, ClassFormatException { runConformTest( @@ -7573,9 +7453,7 @@ public void testBug563186_03() { "The method myInt(int) of type X.Point must override or implement a supertype method\n" + "----------\n", null, - true, - new String[] {"--enable-preview"}, - getCompilerOptions()); + true); } public void testBug563186_04() { runConformTest( @@ -7608,9 +7486,7 @@ public void testBug565732_01() { "Syntax error, insert \"RecordHeader\" to complete RecordHeaderPart\n" + "----------\n", null, - true, - new String[] {"--enable-preview"}, - getCompilerOptions()); + true); } public void testBug565732_02() { runNegativeTest( @@ -7626,9 +7502,7 @@ public void testBug565732_02() { "Syntax error, insert \"RecordHeader\" to complete RecordHeaderPart\n" + "----------\n", null, - true, - new String[] {"--enable-preview"}, - getCompilerOptions()); + true); } // Test that a record without any record components was indeed compiled // to be a record at runtime @@ -7709,9 +7583,7 @@ public void testBug565732_07() { "Syntax error, insert \"RecordHeader\" to complete RecordHeaderPart\n" + "----------\n", null, - true, - new String[] {"--enable-preview"}, - getCompilerOptions()); + true); } public void testBug565732_08() { runConformTest( @@ -7751,8 +7623,6 @@ public void testBug565830_01() { "private final int X$1Bar.x"); } public void testBug566063_001() { - if (this.complianceLevel < ClassFileConstants.JDK17) return; - Map options = getCompilerOptionsWithPreviewIfApplicable(); runConformTest( new String[] { "X.java", @@ -7772,14 +7642,9 @@ public void testBug566063_001() { " }\n"+ "}" }, - "ONE", - options - ); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); + "ONE"); } public void testBug566063_002() { - if (this.complianceLevel < ClassFileConstants.JDK17) return; - Map options = getCompilerOptionsWithPreviewIfApplicable(); runNegativeTest( new String[] { "X.java", @@ -7806,14 +7671,9 @@ public void testBug566063_002() { "Illegal modifier for local enum E; no explicit modifier is permitted\n" + "----------\n", null, - true, - options - ); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); + true); } public void testBug566063_003() { - if (this.complianceLevel < ClassFileConstants.JDK17) return; - Map options = getCompilerOptionsWithPreviewIfApplicable(); runNegativeTest( new String[] { "X.java", @@ -7850,14 +7710,9 @@ public void testBug566063_003() { "A local class or interface Bar is implicitly static; cannot have explicit static declaration\n" + "----------\n", null, - true, - options - ); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); + true); } public void testBug566063_004() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED); this.runConformTest( new String[] { "X.java", @@ -7878,7 +7733,6 @@ public void testBug566063_004() { "}" }, "ONE"); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); } @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug566418_001() { @@ -7938,7 +7792,6 @@ public void testBug566554_01() { runConformTest( new String[] { "Main.java", - "@SuppressWarnings(\"preview\")\n" + "public class Main {\n" + " public static void main(String[] args) {\n" + " final Margin margins = new Margin(0);\n" + @@ -7960,7 +7813,6 @@ public void testBug566554_02() { runConformTest( new String[] { "Main.java", - "@SuppressWarnings(\"preview\")\n" + "public class Main {\n" + " public static void main(String[] args) {\n" + " final Margin margins = new Margin(0);\n" + @@ -7985,7 +7837,6 @@ public void testBug566554_03() { runConformTest( new String[] { "Main.java", - "@SuppressWarnings(\"preview\")\n" + "public class Main {\n" + " public static void main(String[] args) {\n" + " final Margin margins = new Margin(0);\n" + @@ -8010,7 +7861,6 @@ public void testBug566554_04() { runNegativeTest( new String[] { "Main.java", - "@SuppressWarnings(\"preview\")\n" + "public class Main {\n" + " public static void main(String[] args) {\n" + " final Margin margins = new Margin(0);\n" + @@ -8027,15 +7877,15 @@ public void testBug566554_04() { "}", }, "----------\n" + - "1. ERROR in Main.java (at line 5)\n" + + "1. ERROR in Main.java (at line 4)\n" + " int l = margins.left(0); \n" + " ^^^^^^^^^^^^^^^\n" + "Type mismatch: cannot convert from Margin to int\n" + "----------\n"); } public void testBug567731_001() { - if (this.complianceLevel < ClassFileConstants.JDK17) return; - Map options = getCompilerOptionsWithPreviewIfApplicable(); + if (this.complianceLevel < ClassFileConstants.JDK17) + return; this.runNegativeTest( new String[] { "X.java", @@ -8058,14 +7908,11 @@ public void testBug567731_001() { "Illegal modifier for the local record B; only final and strictfp are permitted\n" + "----------\n", null, - true, - options - ); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); + true); } public void testBug567731_002() { - if (this.complianceLevel < ClassFileConstants.JDK17) return; - Map options = getCompilerOptionsWithPreviewIfApplicable(); + if (this.complianceLevel < ClassFileConstants.JDK17) + return; this.runNegativeTest( new String[] { "X.java", @@ -8088,12 +7935,11 @@ public void testBug567731_002() { "Illegal modifier for the local record R2; only final and strictfp are permitted\n" + "----------\n", null, - true, - options - ); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); + true); } public void testBug566846_1() { + if (this.complianceLevel < ClassFileConstants.JDK23) + return; runNegativeTest( new String[] { "X.java", @@ -8103,7 +7949,7 @@ public void testBug566846_1() { "1. ERROR in X.java (at line 1)\n" + " public record X;\n" + " ^\n" + - "The preview feature Implicitly Declared Classes and Instance Main Methods is only available with source level 23 and above\n" + + "Implicitly Declared Classes and Instance Main Methods is a preview feature and disabled by default. Use --enable-preview to enable\n" + "----------\n" + "2. ERROR in X.java (at line 1)\n" + " public record X;\n" + @@ -8116,11 +7962,11 @@ public void testBug566846_1() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - new String[] {"--enable-preview"}, - getCompilerOptions()); + true); } public void testBug566846_2() { + if (this.complianceLevel < ClassFileConstants.JDK23) + return; runNegativeTest( new String[] { "X.java", @@ -8132,7 +7978,7 @@ public void testBug566846_2() { "1. ERROR in X.java (at line 1)\n" + " public class X {\n" + " ^\n" + - "The preview feature Implicitly Declared Classes and Instance Main Methods is only available with source level 23 and above\n" + + "Implicitly Declared Classes and Instance Main Methods is a preview feature and disabled by default. Use --enable-preview to enable\n" + "----------\n" + "2. ERROR in X.java (at line 1)\n" + " public class X {\n" + @@ -8145,9 +7991,7 @@ public void testBug566846_2() { "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, - true, - new String[] {"--enable-preview"}, - getCompilerOptions()); + true); } public void testBug561199_001() { Map options = getCompilerOptions(); @@ -8176,7 +8020,6 @@ public void testBug568922_001() { "X.java", "public class X {\n"+ " public static void main(String[] args) {\n"+ - " @SuppressWarnings(\"preview\")\n"+ " record R() {\n"+ " R {\n"+ " super();\n"+ @@ -8188,15 +8031,13 @@ public void testBug568922_001() { "}" }, "----------\n" + - "1. ERROR in X.java (at line 6)\n" + + "1. ERROR in X.java (at line 5)\n" + " super();\n" + " ^^^^^^^^\n" + "The body of a compact constructor must not contain an explicit constructor call\n" + "----------\n", null, - true, - new String[] {"--enable-preview"}, - getCompilerOptions()); + true); } public void testBug568922_002() { runConformTest( @@ -8204,7 +8045,6 @@ public void testBug568922_002() { "X.java", "public class X {\n"+ " public static void main(String[] args) {\n"+ - " @SuppressWarnings(\"preview\")\n"+ " record R() {\n"+ " R {\n"+ " System.out.println(\"helo\");\n"+ @@ -8634,7 +8474,8 @@ public void testBugLazyCanon_006() throws IOException, ClassFormatException { }, "100"); } -public void testBug571765_001() { +// Disabled waiting for https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3347 +public void _testBug571765_001() { this.runNegativeTest( new String[] { "module-info.java", @@ -8644,7 +8485,7 @@ public void testBug571765_001() { "1. ERROR in module-info.java (at line 1)\n" + " public record R() {}\n" + " ^\n" + - "The preview feature Implicitly Declared Classes and Instance Main Methods is only available with source level 23 and above\n" + + "Implicitly Declared Classes and Instance Main Methods is a preview feature and disabled by default. Use --enable-preview to enable\n" + "----------\n" + "2. ERROR in module-info.java (at line 1)\n" + " public record R() {}\n" + @@ -9158,7 +8999,8 @@ public void testBug577251_001() { "Erasure incompatibility in argument X.Entry of canonical constructor in record\n" + "----------\n"); } -public void testBug576806_001() { + +public void testBug576806_001() { // behavior amended for https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3316 Map options = getCompilerOptions(); options.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( @@ -9168,7 +9010,6 @@ public void testBug576806_001() { "X.java", "public class X {\n"+ " public static void main(String[] args){\n"+ - " System.out.println(0);\n" + " }\n"+ "}\n"+ "record Empty(){\n"+ @@ -9180,10 +9021,10 @@ public void testBug576806_001() { "}" }, "----------\n" + - "1. ERROR in X.java (at line 6)\n" + - " record Empty(){\n" + - "}\n" + - " ^^^^\n" + + "1. ERROR in X.java (at line 2)\n" + + " public static void main(String[] args){\n" + + " }\n" + + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n", null, 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 b05afd1e176..e284b736908 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 @@ -60,10 +60,6 @@ protected void tearDown() throws Exception { // Enables the tests to run individually protected Map getCompilerOptions() { Map 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); return defaultOptions; } @@ -1716,10 +1712,7 @@ public void testBug564613_002() { "Syntax error on token \"permits\", delete this token\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_001() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -1741,9 +1734,7 @@ public void testBug564638_001() { "The method Zork() is undefined for the type permits\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_002() { runNegativeTest( @@ -1767,10 +1758,7 @@ public void testBug564638_002() { "The method Zork() is undefined for the type permits\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_003() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -1803,9 +1791,7 @@ public void testBug564638_003() { "\'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, - options - ); + true); } public void testBug564638_004() { runNegativeTest( @@ -1839,10 +1825,7 @@ public void testBug564638_004() { "\'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" }) public void testBug564638_005() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -1864,9 +1847,7 @@ public void testBug564638_005() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_006() { runNegativeTest( @@ -1919,10 +1900,7 @@ public void testBug564638_007() { "\'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" }) public void testBug564638_008() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -1951,9 +1929,7 @@ public void testBug564638_008() { "\'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, - options - ); + true); } public void testBug564638_009() { runNegativeTest( @@ -1984,10 +1960,7 @@ public void testBug564638_009() { "\'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" }) public void testBug564638_010() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2016,9 +1989,7 @@ public void testBug564638_010() { "\'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, - options - ); + true); } public void testBug564638_011() { runNegativeTest( @@ -2049,10 +2020,7 @@ public void testBug564638_011() { "\'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" }) public void testBug564638_012() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2081,9 +2049,7 @@ public void testBug564638_012() { "\'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, - options - ); + true); } public void testBug564638_013() { runNegativeTest( @@ -2113,10 +2079,7 @@ public void testBug564638_013() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_014() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2139,9 +2102,7 @@ public void testBug564638_014() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_015() { runNegativeTest( @@ -2165,10 +2126,7 @@ public void testBug564638_015() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_016() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2190,9 +2148,7 @@ public void testBug564638_016() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_017() { runNegativeTest( @@ -2231,10 +2187,7 @@ public void testBug564638_017() { "Syntax error on token \"}\", delete this token\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_018() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2271,9 +2224,7 @@ public void testBug564638_018() { "Syntax error on token \"}\", delete this token\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_019() { runNegativeTest( @@ -2299,10 +2250,7 @@ public void testBug564638_019() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_020() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2326,9 +2274,7 @@ public void testBug564638_020() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_021() { runNegativeTest( @@ -2356,10 +2302,7 @@ public void testBug564638_021() { "\'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" }) public void testBug564638_022() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2390,9 +2333,7 @@ public void testBug564638_022() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_023() { runNegativeTest( @@ -2409,10 +2350,7 @@ public void testBug564638_023() { "\'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" }) public void testBug564638_024() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2427,9 +2365,7 @@ public void testBug564638_024() { "\'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, - options - ); + true); } public void testBug564638_025() { runNegativeTest( @@ -2446,10 +2382,7 @@ public void testBug564638_025() { "\'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" }) public void testBug564638_026() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2464,9 +2397,7 @@ public void testBug564638_026() { "\'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, - options - ); + true); } public void testBug564638_027() { runNegativeTest( @@ -2490,10 +2421,7 @@ public void testBug564638_027() { "\'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" }) public void testBug564638_028() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2515,9 +2443,7 @@ public void testBug564638_028() { "\'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, - options - ); + true); } public void testBug564638_029() { runNegativeTest( @@ -2542,10 +2468,7 @@ public void testBug564638_029() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_030() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2568,9 +2491,7 @@ public void testBug564638_030() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_031() { runNegativeTest( @@ -2597,10 +2518,7 @@ public void testBug564638_031() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_032() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2625,9 +2543,7 @@ public void testBug564638_032() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_033() { runNegativeTest( @@ -2651,10 +2567,7 @@ public void testBug564638_033() { "\'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" }) public void testBug564638_034() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2676,9 +2589,7 @@ public void testBug564638_034() { "\'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, - options - ); + true); } public void testBug564638_035() { runNegativeTest( @@ -2707,10 +2618,7 @@ public void testBug564638_035() { "\'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" }) public void testBug564638_036() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2737,9 +2645,7 @@ public void testBug564638_036() { "\'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, - options - ); + true); } public void testBug564638_037() { runNegativeTest( @@ -2768,10 +2674,7 @@ public void testBug564638_037() { "\'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" }) public void testBug564638_038() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2798,9 +2701,7 @@ public void testBug564638_038() { "\'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, - options - ); + true); } public void testBug564638_039() { runNegativeTest( @@ -2821,10 +2722,7 @@ public void testBug564638_039() { "\'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" }) public void testBug564638_040() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2843,9 +2741,7 @@ public void testBug564638_040() { "\'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, - options - ); + true); } public void testBug564638_041() { runNegativeTest( @@ -2871,10 +2767,7 @@ public void testBug564638_041() { "The constructor X(permits) refers to the missing type permits\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_042() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2898,9 +2791,7 @@ public void testBug564638_042() { "The constructor X(permits) refers to the missing type permits\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_043() { runNegativeTest( @@ -2927,10 +2818,7 @@ public void testBug564638_043() { "\'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" }) public void testBug564638_044() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -2955,9 +2843,7 @@ public void testBug564638_044() { "\'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, - options - ); + true); } public void testBug564638_045() { runNegativeTest( @@ -2984,10 +2870,7 @@ public void testBug564638_045() { "The method foo(permits) from the type X refers to the missing type permits\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638_046() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3012,9 +2895,7 @@ public void testBug564638_046() { "The method foo(permits) from the type X refers to the missing type permits\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638_047() { runNegativeTest( @@ -3035,10 +2916,7 @@ public void testBug564638_047() { "\'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" }) public void testBug564638_048() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3057,9 +2935,7 @@ public void testBug564638_048() { "\'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, - options - ); + true); } public void testBug564638_049() { runNegativeTest( @@ -3089,10 +2965,7 @@ public void testBug564638_049() { "\'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" }) public void testBug564638_050() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3127,9 +3000,7 @@ public void testBug564638_050() { "\'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, - options - ); + true); } public void testBug564638_051() { runNegativeTest( @@ -3148,10 +3019,7 @@ public void testBug564638_051() { "\'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" }) public void testBug564638_052() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3168,9 +3036,7 @@ public void testBug564638_052() { "\'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, - options - ); + true); } public void testBug564638_053() { runNegativeTest( @@ -3200,10 +3066,7 @@ public void testBug564638_053() { "\'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" }) public void testBug564638_054() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3231,9 +3094,7 @@ public void testBug564638_054() { "\'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, - options - ); + true); } public void testBug564638_055() { runNegativeTest( @@ -3252,10 +3113,7 @@ public void testBug564638_055() { "\'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" }) public void testBug564638_056() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3272,9 +3130,7 @@ public void testBug564638_056() { "\'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, - options - ); + true); } public void testBug564638_057() { runNegativeTest( @@ -3304,10 +3160,7 @@ public void testBug564638_057() { "\'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" }) public void testBug564638_058() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3335,14 +3188,9 @@ public void testBug564638_058() { "\'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, - options - ); + true); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void testBug564638b_001() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3364,9 +3212,7 @@ public void testBug564638b_001() { "The method Zork() is undefined for the type sealed\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638b_002() { runNegativeTest( @@ -3390,10 +3236,8 @@ public void testBug564638b_002() { "The method Zork() is undefined for the type sealed\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug564638b_003() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3426,9 +3270,7 @@ public void testBug564638b_003() { "\'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, - options - ); + true); } public void testBug564638b_004() { runNegativeTest( @@ -3462,10 +3304,8 @@ public void testBug564638b_004() { "\'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" }) + public void testBug564638b_005() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3487,9 +3327,7 @@ public void testBug564638b_005() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638b_006() { runNegativeTest( @@ -3542,10 +3380,7 @@ public void testBug564638b_007() { "\'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" }) public void testBug564638b_008() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3574,9 +3409,7 @@ public void testBug564638b_008() { "\'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, - options - ); + true); } public void testBug564638b_009() { runNegativeTest( @@ -3607,10 +3440,7 @@ public void testBug564638b_009() { "\'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" }) public void testBug564638b_010() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3639,9 +3469,7 @@ public void testBug564638b_010() { "\'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, - options - ); + true); } public void testBug564638b_011() { runNegativeTest( @@ -3672,10 +3500,8 @@ public void testBug564638b_011() { "\'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" }) + public void testBug564638b_012() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3704,9 +3530,7 @@ public void testBug564638b_012() { "\'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, - options - ); + true); } public void testBug564638b_013() { runNegativeTest( @@ -3736,10 +3560,8 @@ public void testBug564638b_013() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug564638b_014() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3762,9 +3584,7 @@ public void testBug564638b_014() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638b_015() { runNegativeTest( @@ -3788,10 +3608,8 @@ public void testBug564638b_015() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug564638b_016() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3813,9 +3631,7 @@ public void testBug564638b_016() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638b_017() { runNegativeTest( @@ -3854,10 +3670,8 @@ public void testBug564638b_017() { "Syntax error on token \"}\", delete this token\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug564638b_018() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3894,9 +3708,7 @@ public void testBug564638b_018() { "Syntax error on token \"}\", delete this token\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638b_019() { runNegativeTest( @@ -3922,10 +3734,8 @@ public void testBug564638b_019() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug564638b_020() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -3949,9 +3759,7 @@ public void testBug564638b_020() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638b_021() { runNegativeTest( @@ -3979,10 +3787,8 @@ public void testBug564638b_021() { "\'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" }) + public void testBug564638b_022() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4013,9 +3819,7 @@ public void testBug564638b_022() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options - ); + true); } public void testBug564638b_023() { runNegativeTest( @@ -4032,10 +3836,8 @@ public void testBug564638b_023() { "\'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" }) + public void testBug564638b_024() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4050,8 +3852,7 @@ public void testBug564638b_024() { "\'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, - options + true ); } public void testBug564638b_025() { @@ -4069,10 +3870,8 @@ public void testBug564638b_025() { "\'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" }) + public void testBug564638b_026() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4087,8 +3886,7 @@ public void testBug564638b_026() { "\'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, - options + true ); } public void testBug564638b_027() { @@ -4113,10 +3911,8 @@ public void testBug564638b_027() { "\'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" }) + public void testBug564638b_028() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4138,8 +3934,7 @@ public void testBug564638b_028() { "\'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, - options + true ); } public void testBug564638b_029() { @@ -4165,10 +3960,8 @@ public void testBug564638b_029() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug564638b_030() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4191,8 +3984,7 @@ public void testBug564638b_030() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options + true ); } public void testBug564638b_031() { @@ -4220,10 +4012,8 @@ public void testBug564638b_031() { "The method Zork() is undefined for the type X\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug564638b_032() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4248,8 +4038,7 @@ public void testBug564638b_032() { "The method Zork() is undefined for the type X\n" + "----------\n", null, - true, - options + true ); } public void testBug564638b_033() { @@ -4274,10 +4063,8 @@ public void testBug564638b_033() { "\'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" }) + public void testBug564638b_034() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4299,8 +4086,7 @@ public void testBug564638b_034() { "\'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, - options + true ); } public void testBug564638b_035() { @@ -4330,10 +4116,8 @@ public void testBug564638b_035() { "\'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" }) + public void testBug564638b_036() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4360,8 +4144,7 @@ public void testBug564638b_036() { "\'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, - options + true ); } public void testBug564638b_037() { @@ -4391,10 +4174,8 @@ public void testBug564638b_037() { "\'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" }) + public void testBug564638b_038() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4421,8 +4202,7 @@ public void testBug564638b_038() { "\'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, - options + true ); } public void testBug564638b_039() { @@ -4444,10 +4224,8 @@ public void testBug564638b_039() { "\'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" }) + public void testBug564638b_040() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4466,8 +4244,7 @@ public void testBug564638b_040() { "\'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, - options + true ); } public void testBug564638b_041() { @@ -4494,10 +4271,8 @@ public void testBug564638b_041() { "The constructor X(sealed) refers to the missing type sealed\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug564638b_042() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4521,8 +4296,7 @@ public void testBug564638b_042() { "The constructor X(sealed) refers to the missing type sealed\n" + "----------\n", null, - true, - options + true ); } public void testBug564638b_043() { @@ -4550,10 +4324,8 @@ public void testBug564638b_043() { "\'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" }) + public void testBug564638b_044() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4578,8 +4350,7 @@ public void testBug564638b_044() { "\'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, - options + true ); } public void testBug564638b_045() { @@ -4607,10 +4378,8 @@ public void testBug564638b_045() { "The method foo(sealed) from the type X refers to the missing type sealed\n" + "----------\n"); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug564638b_046() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4635,8 +4404,7 @@ public void testBug564638b_046() { "The method foo(sealed) from the type X refers to the missing type sealed\n" + "----------\n", null, - true, - options + true ); } public void testBug564638b_047() { @@ -4658,10 +4426,8 @@ public void testBug564638b_047() { "\'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" }) + public void testBug564638b_048() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4680,8 +4446,7 @@ public void testBug564638b_048() { "\'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, - options + true ); } public void testBug564638b_049() { @@ -4712,10 +4477,8 @@ public void testBug564638b_049() { "\'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" }) + public void testBug564638b_050() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4750,8 +4513,7 @@ public void testBug564638b_050() { "\'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, - options + true ); } public void testBug564638b_051() { @@ -4771,10 +4533,8 @@ public void testBug564638b_051() { "\'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" }) + public void testBug564638b_052() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4791,8 +4551,7 @@ public void testBug564638b_052() { "\'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, - options + true ); } public void testBug564638b_053() { @@ -4823,10 +4582,8 @@ public void testBug564638b_053() { "\'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" }) + public void testBug564638b_054() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4854,8 +4611,7 @@ public void testBug564638b_054() { "\'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, - options + true ); } public void testBug564638b_055() { @@ -4875,10 +4631,8 @@ public void testBug564638b_055() { "\'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" }) + public void testBug564638b_056() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4895,8 +4649,7 @@ public void testBug564638b_056() { "\'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, - options + true ); } public void testBug564638b_057() { @@ -4927,10 +4680,8 @@ public void testBug564638b_057() { "\'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" }) + public void testBug564638b_058() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -4958,8 +4709,7 @@ public void testBug564638b_058() { "\'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, - options + true ); } public void testBug565561_001() throws IOException, ClassFormatException { @@ -5114,9 +4864,6 @@ public void testBug565782_005() throws IOException, ClassFormatException { verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM); } public void testBug565847_001() { - Map options =getCompilerOptions(); - options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING); - this.runNegativeTest( new String[] { "X.java", @@ -5139,13 +4886,10 @@ public void testBug565847_001() { "This method requires a body instead of a semicolon\n" + "----------\n", null, - true, - options + true ); } - @SuppressWarnings({ "rawtypes" }) public void testBug566979_001() { - Map options = getCompilerOptions(); this.runNegativeTest( new String[] { "X.java", @@ -5160,14 +4904,11 @@ public void testBug566979_001() { "Syntax error on token \"sealed\", static expected\n" + "----------\n", null, - true, - options + true ); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug566979_002() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -5182,13 +4923,10 @@ public void testBug566979_002() { "Syntax error on token \"sealed\", static expected\n" + "----------\n", null, - true, - options + true ); } - @SuppressWarnings({ "rawtypes" }) public void testBug566980_001() { - Map options = getCompilerOptions(); this.runNegativeTest( new String[] { "X.java", @@ -5203,14 +4941,11 @@ public void testBug566980_001() { "Syntax error on token \"void\", delete this token\n" + "----------\n", null, - true, - options + true ); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + public void testBug566980_002() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", @@ -5225,37 +4960,7 @@ public void testBug566980_002() { "Syntax error on token \"void\", delete this token\n" + "----------\n", null, - true, - options - ); - } - @SuppressWarnings({ "rawtypes" }) - public void testBug566846_001() { - Map options = getCompilerOptions(); - this.runNegativeTest( - new String[] { - "X.java", - "record X;\n", - }, - "----------\n" + - "1. ERROR in X.java (at line 1)\n" + - " record X;\n" + - " ^\n" + - "The preview feature Implicitly Declared Classes and Instance Main Methods is only available with source level 23 and above\n" + - "----------\n" + - "2. ERROR in X.java (at line 1)\n" + - " record X;\n" + - " ^^^^^^\n" + - "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + - "----------\n" + - "3. ERROR in X.java (at line 1)\n" + - " record X;\n" + - " ^\n" + - "Implicitly declared class must have a candidate main method\n" + - "----------\n", - null, - true, - options + true ); } public void testBug568428_001() {