From 1af7ed636212551f9e571fd281bf99a212c5684e Mon Sep 17 00:00:00 2001 From: Sarika Sinha Date: Fri, 21 Aug 2020 17:03:17 +0530 Subject: Bug 564152 - [15] 2 Rewrite switch expression test case failing with Java 15 Change-Id: I430f8746d3925e8e71cbef7f44957994b37e7b46 --- .../describing/ASTRewritingSwitchExpressionsTest.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java index 268792e241..56cb0d810f 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java @@ -55,11 +55,14 @@ public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest { return createSuite(ASTRewritingSwitchExpressionsTest.class); } - @SuppressWarnings("deprecation") @Override protected void setUp() throws Exception { super.setUp(); - if (this.apiLevel == AST_INTERNAL_JLS14 ) { + if (this.apiLevel == AST_INTERNAL_JLS15 ) { + this.project1.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_15); + this.project1.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_15); + this.project1.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_15); + } else if (this.apiLevel == AST_INTERNAL_JLS14 ) { this.project1.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_14); this.project1.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_14); this.project1.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_14); @@ -230,9 +233,9 @@ public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest { @SuppressWarnings("rawtypes") public void testSwitchExpressions_03_since_12() throws Exception { - if (this.apiLevel == AST_INTERNAL_JLS15) { - return; - } + /* + * if (this.apiLevel == AST_INTERNAL_JLS15) { return; } + */ IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null); String s = "package test1;\n"+ @@ -402,9 +405,9 @@ public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest { } @SuppressWarnings("rawtypes") public void testSwitchExpressions_04_since_12() throws Exception { - if (this.apiLevel == AST_INTERNAL_JLS15) { - return; - } + /* + * if (this.apiLevel == AST_INTERNAL_JLS15) { return; } + */ IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null); String s = "package test1;\n"+ "public class X {\n"+ -- cgit v1.2.3