remove language level 12 preview for 2019.3 release

IDEA would support latest preview only

GitOrigin-RevId: 6609e80acced9e1be07880c14de239f75afcc78b
This commit is contained in:
Anna Kozlova
2019-07-09 00:03:25 +03:00
committed by intellij-monorepo-bot
parent ccb108690b
commit 2e17e61cae
92 changed files with 52 additions and 52 deletions
@@ -3222,8 +3222,8 @@ public class HighlightUtil extends HighlightUtilBase {
STATIC_INTERFACE_CALLS(LanguageLevel.JDK_1_8, "feature.static.interface.calls"),
REFS_AS_RESOURCE(LanguageLevel.JDK_1_9, "feature.try.with.resources.refs"),
MODULES(LanguageLevel.JDK_1_9, "feature.modules"),
ENHANCED_SWITCH(LanguageLevel.JDK_12_PREVIEW, "feature.enhanced.switch"),
SWITCH_EXPRESSION(LanguageLevel.JDK_12_PREVIEW, "feature.switch.expressions"),
ENHANCED_SWITCH(LanguageLevel.JDK_13_PREVIEW, "feature.enhanced.switch"),
SWITCH_EXPRESSION(LanguageLevel.JDK_13_PREVIEW, "feature.switch.expressions"),
TEXT_BLOCKS(LanguageLevel.JDK_13_PREVIEW, "feature.text.blocks"),
RAW_LITERALS(LanguageLevel.JDK_X, "feature.raw.literals");
+2 -2
View File
@@ -1606,7 +1606,7 @@
implementationClass="com.intellij.codeInspection.OverflowingLoopIndexInspection" />
<localInspection groupPath="Java,Java language level migration aids" language="JAVA" shortName="EnhancedSwitchMigration"
key="inspection.switch.expression.migration.inspection.name" bundle="messages.InspectionsBundle"
groupKey="group.names.language.level.specific.issues.and.migration.aids12" groupBundle="messages.InspectionsBundle"
groupKey="group.names.language.level.specific.issues.and.migration.aids13" groupBundle="messages.InspectionsBundle"
enabledByDefault="true" level="WARNING"
implementationClass="com.intellij.codeInspection.EnhancedSwitchMigrationInspection" />
<localInspection groupPath="Java" language="JAVA" shortName="RedundantLabeledSwitchRuleCodeBlock"
@@ -1616,7 +1616,7 @@
implementationClass="com.intellij.codeInspection.enhancedSwitch.RedundantLabeledSwitchRuleCodeBlockInspection" />
<localInspection groupPath="Java,Java language level migration aids" language="JAVA" shortName="EnhancedSwitchBackwardMigration"
key="inspection.switch.expression.backward.migration.inspection.name" bundle="messages.InspectionsBundle"
groupKey="group.names.language.level.specific.issues.and.migration.aids12" groupBundle="messages.InspectionsBundle"
groupKey="group.names.language.level.specific.issues.and.migration.aids13" groupBundle="messages.InspectionsBundle"
enabledByDefault="true" level="INFORMATION"
implementationClass="com.intellij.codeInspection.EnhancedSwitchBackwardMigrationInspection" />
<localInspection groupPath="Java" language="JAVA" shortName="SwitchLabeledRuleCanBeCodeBlock"
@@ -8,10 +8,8 @@ import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
import com.intellij.psi.*;
import com.intellij.psi.util.PsiUtil;
import com.intellij.util.ObjectUtils;
import com.siyeh.ig.psiutils.CommentTracker;
import org.jetbrains.annotations.Nls;
@@ -104,7 +102,7 @@ public class SwitchLabeledRuleCanBeCodeBlockInspection extends LocalInspectionTo
private static void wrapExpression(PsiExpressionStatement expressionStatement) {
CommentTracker tracker = new CommentTracker();
String valueKeyword = PsiUtil.getLanguageLevel(expressionStatement) == LanguageLevel.JDK_12_PREVIEW ? PsiKeyword.BREAK : PsiKeyword.YIELD;
String valueKeyword = PsiKeyword.YIELD;
tracker.replaceAndRestoreComments(expressionStatement, "{ " + valueKeyword + " " + tracker.text(expressionStatement) + " }");
}
@@ -3,7 +3,7 @@
Reports enhanced 'switch' statements and expressions which can be replaced with a traditional 'switch' statement.
<!-- tooltip end -->
<p>This inspection only reports if the language level of the project or module is 12 Preview</p>
<p>This inspection only reports if the language level is 13 Preview</p>
<p><small>New in 2019.1</small></p>
</body>
</html>
@@ -3,7 +3,7 @@
Reports 'switch' statements, which can be replaced with enhanced 'switch' statement or expression.
<!-- tooltip end -->
<p>This inspection only reports if the language level of the project or module is 12 Preview</p>
<p>This inspection only reports if the language level is 13 Preview</p>
<p><small>New in 2019.1</small></p>
</body>
</html>
@@ -32,7 +32,6 @@ public enum LanguageLevel {
JDK_10(JavaCoreBundle.message("jdk.10.language.level.description"), 10),
JDK_11(JavaCoreBundle.message("jdk.11.language.level.description"), 11),
JDK_12(JavaCoreBundle.message("jdk.12.language.level.description"), 12),
JDK_12_PREVIEW(JavaCoreBundle.message("jdk.12.preview.language.level.description"), 12),
JDK_13(JavaCoreBundle.message("jdk.13.language.level.description"), 13),
JDK_13_PREVIEW(JavaCoreBundle.message("jdk.13.preview.language.level.description"), 13),
JDK_X(JavaCoreBundle.message("jdk.X.language.level.description"), 14);
@@ -11,7 +11,6 @@ jdk.1.9.language.level.description=9 - Modules, private methods in interfaces et
jdk.10.language.level.description=10 - Local variable type inference
jdk.11.language.level.description=11 - Local variable syntax for lambda parameters
jdk.12.language.level.description=12 - No new language features
jdk.12.preview.language.level.description=12 (Preview) - Switch expressions
jdk.13.language.level.description=13 - No new language features
jdk.13.preview.language.level.description=13 (Preview) - Switch expressions, text blocks
jdk.X.language.level.description=X - Experimental features
@@ -5,13 +5,14 @@ import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCa
import com.intellij.testFramework.LightProjectDescriptor;
import org.jetbrains.annotations.NotNull;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_12;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_13;
public class WrapSwitchRuleStatementsIntoBlockFixTest extends LightQuickFixParameterizedTestCase {
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
@Override
@@ -5,7 +5,7 @@ import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCa
import com.intellij.testFramework.LightProjectDescriptor;
import org.jetbrains.annotations.NotNull;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_12;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_13;
public class SplitSwitchBranchWithSeveralCaseValuesTest extends LightQuickFixParameterizedTestCase {
@@ -17,7 +17,7 @@ public class SplitSwitchBranchWithSeveralCaseValuesTest extends LightQuickFixPar
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
@Override
@@ -14,7 +14,7 @@ public class SwitchExpressionPostfixTemplateTest extends PostfixTemplateTestCase
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
public void testIntExprInit() {
@@ -16,5 +16,5 @@ class DuplicateBranchesInEnhancedSwitchFixTest : LightQuickFixParameterizedTestC
override fun getBasePath() = "/inspection/duplicateBranchesInEnhancedSwitchFix"
override fun getProjectDescriptor(): LightProjectDescriptor = LightJavaCodeInsightFixtureTestCase.JAVA_12
override fun getProjectDescriptor(): LightProjectDescriptor = LightJavaCodeInsightFixtureTestCase.JAVA_13
}
@@ -2,8 +2,8 @@
package com.intellij.java.codeInspection;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.EnhancedSwitchMigrationInspection;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.pom.java.LanguageLevel;
import org.jetbrains.annotations.NotNull;
@@ -23,6 +23,6 @@ public class EnhancedSwitchMigrationInspectionTest extends LightQuickFixParamete
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_12_PREVIEW;
return LanguageLevel.JDK_13_PREVIEW;
}
}
@@ -114,8 +114,8 @@ public class JavaParametersTest extends ModuleRootManagerTestCase {
public void testPreviewLanguageFeatures() throws CantRunException {
ModuleRootModificationUtil.updateModel(myModule, (model) -> {
model.getModuleExtension(LanguageLevelModuleExtension.class)
.setLanguageLevel(LanguageLevel.JDK_12_PREVIEW);
model.setSdk(IdeaTestUtil.getMockJdk(JavaVersion.compose(12)));
.setLanguageLevel(LanguageLevel.JDK_13_PREVIEW);
model.setSdk(IdeaTestUtil.getMockJdk(JavaVersion.compose(13)));
});
JavaParameters javaParameters = new JavaParameters();
javaParameters.configureByModule(myModule, JavaParameters.CLASSES_AND_TESTS);
@@ -33,7 +33,7 @@ public class StatementParserTest extends JavaParsingTestCase {
public void testYieldIncomplete0() { doParserTest("yield "); }
public void testYieldIncomplete1() { doParserTest("yield x"); }
public void testYieldCall() { doParserTest("foo.yield();"); }
public void testYieldCompatibility() { setLanguageLevel(LanguageLevel.JDK_12_PREVIEW); doParserTest("yield(2);"); }
public void testYieldCompatibility() { setLanguageLevel(LanguageLevel.JDK_12); doParserTest("yield(2);"); }
public void testContinueNormal0() { doParserTest("continue;"); }
public void testContinueNormal1() { doParserTest("continue LABEL;"); }
@@ -117,7 +117,7 @@ public class IntroduceVariableTest extends LightJavaCodeInsightTestCase {
public void testReturnTernary() { doTest("temp", true, false, false, CommonClassNames.JAVA_LANG_STRING); }
public void testAssignTernary() { doTest("temp", true, false, false, CommonClassNames.JAVA_LANG_STRING); }
public void testEnsureCodeBlockAroundBreakStatementJava13Preview() { doTest("temp", true, false, false, CommonClassNames.JAVA_LANG_STRING); }
public void testEnsureCodeBlockForThrowsJava12Preview() { doTest("temp", true, false, false, CommonClassNames.JAVA_LANG_STRING); }
public void testEnsureCodeBlockForThrowsJava13Preview() { doTest("temp", true, false, false, CommonClassNames.JAVA_LANG_STRING); }
public void testFromSwitchStatementJava13Preview() { doTest("temp", true, false, false, CommonClassNames.JAVA_LANG_STRING); }
public void testVarTypeExtractedJava10() {
@@ -7,7 +7,10 @@ import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.*;
import com.intellij.openapi.roots.ContentEntry;
import com.intellij.openapi.roots.LanguageLevelModuleExtension;
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.pom.java.AcceptedLanguageLevelsSettings;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.*;
@@ -67,7 +70,7 @@ public abstract class LightJavaCodeInsightFixtureTestCase extends UsefulTestCase
public static final @NotNull LightProjectDescriptor JAVA_10 = new ProjectDescriptor(LanguageLevel.JDK_10);
public static final @NotNull LightProjectDescriptor JAVA_10_ANNOTATED = new ProjectDescriptor(LanguageLevel.JDK_10, true);
public static final @NotNull LightProjectDescriptor JAVA_11 = new ProjectDescriptor(LanguageLevel.JDK_11);
public static final @NotNull LightProjectDescriptor JAVA_12 = new ProjectDescriptor(LanguageLevel.JDK_12_PREVIEW);
public static final @NotNull LightProjectDescriptor JAVA_12 = new ProjectDescriptor(LanguageLevel.JDK_12);
public static final @NotNull LightProjectDescriptor JAVA_13 = new ProjectDescriptor(LanguageLevel.JDK_13_PREVIEW);
public static final @NotNull LightProjectDescriptor JAVA_X = new ProjectDescriptor(LanguageLevel.JDK_X);
@@ -20,7 +20,7 @@ public enum LanguageLevel {
JDK_1_9(9),
JDK_10(10),
JDK_11(11),
JDK_12(12), JDK_12_PREVIEW(12),
JDK_12(12),
JDK_13(13), JDK_13_PREVIEW(13),
JDK_X(14);
@@ -604,7 +604,7 @@ group.names.language.level.specific.issues.and.migration.aids9=Java 9
group.names.language.level.specific.issues.and.migration.aids5=Java 5
group.names.language.level.specific.issues.and.migration.aids10=Java 10
group.names.language.level.specific.issues.and.migration.aids11=Java 11
group.names.language.level.specific.issues.and.migration.aids12=Java 12
group.names.language.level.specific.issues.and.migration.aids13=Java 13
group.names.javabeans.issues=JavaBeans issues
group.names.inheritance.issues=Inheritance issues
group.names.data.flow.issues=Data flow
@@ -73,6 +73,7 @@ public class UninitializedReadCollector {
if (statement instanceof PsiBreakStatement ||
statement instanceof PsiContinueStatement ||
statement instanceof PsiAssertStatement ||
statement instanceof PsiYieldStatement ||
statement instanceof PsiEmptyStatement) {
return false;
}
@@ -40,7 +40,7 @@ public class IOResourceInspectionTest extends LightJavaInspectionTestCase {
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
@Override
@@ -36,6 +36,6 @@ public class NestedAssignmentInspectionTest extends LightJavaInspectionTestCase
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
}
@@ -32,7 +32,7 @@ class IgnoreResultOfCallInspectionTest extends LightJavaInspectionTestCase {
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12
return JAVA_13
}
@Override
@@ -41,6 +41,6 @@ public class ResultOfObjectAllocationIgnoredInspectionTest extends LightJavaInsp
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
}
@@ -151,7 +151,7 @@ public class EnumSwitchStatementWhichMissesCasesInspectionTest extends LightJava
"}");
}
public void testJava12Preview() {
public void testJava13Preview() {
doTest("enum E {A, B, C}\n" +
"\n" +
"class X {\n" +
@@ -179,7 +179,7 @@ public class EnumSwitchStatementWhichMissesCasesInspectionTest extends LightJava
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
@Nullable
@@ -3,7 +3,6 @@ package com.siyeh.ig.controlflow;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import com.siyeh.ig.LightJavaInspectionTestCase;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -17,7 +16,7 @@ public class NestedSwitchInspectionTest extends LightJavaInspectionTestCase {
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_12;
return JAVA_13;
}
@Nullable
@@ -30,7 +30,7 @@ public class SwitchStatementWithTooFewBranchesInspectionTest extends LightJavaIn
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
@Nullable
@@ -62,7 +62,7 @@ public class SwitchStatementWithTooManyBranchesInspectionTest extends LightJavaI
" }");
}
public void testJava12Expression() {
public void testJava13Expression() {
doMemberTest(" public int foo(int x) {\n" +
" return /*'switch' has too many branches (11)*/switch/**/ (x) {\n" +
" case 1 -> 0;\n" +
@@ -113,7 +113,7 @@ public class SwitchStatementWithTooManyBranchesInspectionTest extends LightJavaI
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
@Nullable
@@ -30,7 +30,7 @@ public class SwitchStatementsWithoutDefaultInspectionTest extends LightJavaInspe
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
@Nullable
@@ -33,7 +33,7 @@ public class UnnecessaryBreakInspectionTest extends LightJavaInspectionTestCase
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
@Nullable
@@ -15,7 +15,7 @@ public class UnnecessaryContinueInspectionTest extends LightJavaCodeInsightFixtu
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
private void doTest() {
@@ -102,6 +102,6 @@ public class UnnecessaryDefaultInspectionTest extends LightJavaInspectionTestCas
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
}
@@ -15,7 +15,7 @@ public class UnnecessaryReturnInspectionTest extends LightJavaCodeInsightFixture
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
private void doTest() {
@@ -24,7 +24,7 @@ public class IfCanBeSwitchSwitchExpressionFixTest extends IGQuickFixesTestCase {
@Override
protected void tuneFixture(JavaModuleFixtureBuilder builder) throws Exception {
super.tuneFixture(builder);
builder.setLanguageLevel(LanguageLevel.JDK_12_PREVIEW);
builder.setLanguageLevel(LanguageLevel.JDK_13_PREVIEW);
builder.addJdk(IdeaTestUtil.getMockJdk18Path().getPath());
}
@@ -22,6 +22,6 @@ public class AutoBoxingInspectionTest extends LightJavaInspectionTestCase {
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
}
@@ -13,7 +13,7 @@ public class UnnecessaryBoxingInspectionTest extends LightJavaInspectionTestCase
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
public void testUnnecessaryBoxing() {
@@ -18,7 +18,7 @@ public class UnnecessaryParenthesesInspectionTest extends LightJavaCodeInsightFi
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
public void testUnnecessaryParenthesesInspection() {
@@ -25,6 +25,6 @@ public class UnqualifiedStaticUsageInspectionTest extends LightJavaInspectionTes
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_12;
return JAVA_13;
}
}
@@ -859,19 +859,19 @@ public class StructureImportingTest extends MavenImportingTestCase {
" <artifactId>maven-compiler-plugin</artifactId>\n" +
" <version>3.8.0</version>\n" +
" <configuration>\n" +
" <release>12</release>\n" +
" <release>13</release>\n" +
" <compilerArgs>\n" +
" <arg>--enable-preview</arg>\n" +
" </compilerArgs>\n" +
" <source>12</source>\n" +
" <target>12</target>\n" +
" <source>13</source>\n" +
" <target>13</target>\n" +
" </configuration>\n" +
" </plugin>" +
" </plugins>" +
"</build>");
assertModules("project");
assertEquals(LanguageLevel.JDK_12_PREVIEW, getLanguageLevelForModule());
assertEquals(LanguageLevel.JDK_13_PREVIEW, getLanguageLevelForModule());
}
public void testInheritingLanguageLevelFromPluginManagementSection() {