bump highest language level to 14, prepare to remove 13_preview

GitOrigin-RevId: ec42a9047ba63b0cbaddd8357d11ae2ed56ed6b6
This commit is contained in:
Anna Kozlova
2020-04-01 14:07:24 +02:00
committed by intellij-monorepo-bot
parent dd3433cd18
commit bd1a21a02a
85 changed files with 24 additions and 17 deletions

View File

@@ -38,7 +38,7 @@ public enum LanguageLevel {
JDK_14_PREVIEW(JavaPsiBundle.message("jdk.14.preview.language.level.description"), 14),
JDK_X(JavaPsiBundle.message("jdk.X.language.level.description"), 15);
public static final LanguageLevel HIGHEST = JDK_13;
public static final LanguageLevel HIGHEST = JDK_14;
public static final Key<LanguageLevel> KEY = Key.create("LANGUAGE_LEVEL");
private final String myPresentableText;

View File

@@ -52,7 +52,7 @@ public class IntroduceVariableTest extends LightJavaCodeInsightTestCase {
public void testExpectedType8Inference() { doTest("temp", true, false, false, "java.util.Map<java.lang.String,java.util.List<java.lang.String>>"); }
public void testMethodCall() { doTest("temp", true, true, true, CommonClassNames.JAVA_LANG_OBJECT); }
public void testMethodCallInSwitch() { doTest("i", true, true, true, "int"); }
public void testFunctionalExpressionInSwitchJava13Preview() { doTest("p", true, true, true, "java.util.function.Predicate<java.lang.String>"); }
public void testFunctionalExpressionInSwitch() { doTest("p", true, true, true, "java.util.function.Predicate<java.lang.String>"); }
public void testParenthesizedOccurrence1() { doTest("empty", true, true, true, "boolean"); }
public void testParenthesizedOccurrence2() { doTest("s", true, true, true, JAVA_LANG_STRING); }
public void testAfterSemicolon() { doTest("s", true, true, true, CommonClassNames.JAVA_LANG_RUNNABLE); }
@@ -150,9 +150,9 @@ public class IntroduceVariableTest extends LightJavaCodeInsightTestCase {
public void testReturnTernary() { doTest("temp", true, false, false, JAVA_LANG_STRING); }
public void testFieldInitializer() { doTest("temp", true, false, false, JAVA_LANG_STRING); }
public void testAssignTernary() { doTest("temp", true, false, false, JAVA_LANG_STRING); }
public void testEnsureCodeBlockAroundBreakStatementJava13Preview() { doTest("temp", true, false, false, JAVA_LANG_STRING); }
public void testEnsureCodeBlockForThrowsJava13Preview() { doTest("temp", true, false, false, JAVA_LANG_STRING); }
public void testFromSwitchStatementJava13Preview() { doTest("temp", true, false, false, JAVA_LANG_STRING); }
public void testEnsureCodeBlockAroundBreakStatement() { doTest("temp", true, false, false, JAVA_LANG_STRING); }
public void testEnsureCodeBlockForThrows() { doTest("temp", true, false, false, JAVA_LANG_STRING); }
public void testFromSwitchStatement() { doTest("temp", true, false, false, JAVA_LANG_STRING); }
public void testVarTypeExtractedJava10() {
doTestWithVarType(new MockIntroduceVariableHandler("temp", true, false, false, "java.util.ArrayList<java.lang.String>"));

View File

@@ -22,7 +22,7 @@ public enum LanguageLevel {
JDK_14(14), JDK_14_PREVIEW(14),
JDK_X(15);
public static final LanguageLevel HIGHEST = JDK_13;
public static final LanguageLevel HIGHEST = JDK_14;
private final JavaVersion myVersion;

View File

@@ -3,8 +3,7 @@ class X {
void test(int i) {
switch(i) {
default:
throw new IllegalStateException("Unexpected value: " + i);
default -> throw new IllegalStateException("Unexpected value: " + i);
}
}
}

View File

@@ -3,7 +3,8 @@ class X {
void test(int i) {
switch(i) {
default -> throw new IllegalStateException("Unexpected value: " + i);
default:
throw new IllegalStateException("Unexpected value: " + i);
}
}
}

View File

@@ -2,10 +2,10 @@
class Foo {
void foo(E e) {
switch (e) {
case E1:
break;
case E2:
break;
case E1 -> {
}
case E2 -> {
}
}
}
}

View File

@@ -1,8 +1,10 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.siyeh.ipp.switchbranches;
import com.intellij.testFramework.LightProjectDescriptor;
import com.siyeh.ig.psiutils.CreateSwitchBranchesUtil;
import com.siyeh.ipp.IPPTestCase;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
@@ -44,4 +46,9 @@ public class CreateMissingSwitchBranchesActionTest extends IPPTestCase {
protected String getRelativePath() {
return "switchbranches";
}
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_8;
}
}