remove Java 15 Preview language level (IDEA-273436)

GitOrigin-RevId: efe6feafd81a99bde15e892530c1085fc4fb8772
This commit is contained in:
Anna Kozlova
2021-08-30 09:39:44 +02:00
committed by intellij-monorepo-bot
parent 2358ac3354
commit f55ce0722f
147 changed files with 231 additions and 1130 deletions

View File

@@ -38,35 +38,14 @@ public enum HighlightingFeature {
VAR_LAMBDA_PARAMETER(LanguageLevel.JDK_11, "feature.var.lambda.parameter"),
ENHANCED_SWITCH(LanguageLevel.JDK_14, "feature.enhanced.switch"),
SWITCH_EXPRESSION(LanguageLevel.JDK_14, "feature.switch.expressions"),
RECORDS(LanguageLevel.JDK_15_PREVIEW, "feature.records") {
@Override
boolean isSufficient(@NotNull LanguageLevel useSiteLevel) {
return useSiteLevel.isAtLeast(LanguageLevel.JDK_15_PREVIEW);
}
@Override
LanguageLevel getStandardLevel() {
return LanguageLevel.JDK_16;
}
},
PATTERNS(LanguageLevel.JDK_15_PREVIEW, "feature.patterns.instanceof"){
@Override
boolean isSufficient(@NotNull LanguageLevel useSiteLevel) {
return useSiteLevel.isAtLeast(LanguageLevel.JDK_15_PREVIEW);
}
@Override
LanguageLevel getStandardLevel() {
return LanguageLevel.JDK_16;
}
},
RECORDS(LanguageLevel.JDK_16, "feature.records"),
PATTERNS(LanguageLevel.JDK_16, "feature.patterns.instanceof"),
TEXT_BLOCK_ESCAPES(LanguageLevel.JDK_15, "feature.text.block.escape.sequences"),
TEXT_BLOCKS(LanguageLevel.JDK_15, "feature.text.blocks") ,
SEALED_CLASSES(LanguageLevel.JDK_15_PREVIEW, "feature.sealed.classes") {
SEALED_CLASSES(LanguageLevel.JDK_16_PREVIEW, "feature.sealed.classes") {
@Override
boolean isSufficient(@NotNull LanguageLevel useSiteLevel) {
return useSiteLevel == LanguageLevel.JDK_15_PREVIEW ||
useSiteLevel == LanguageLevel.JDK_16_PREVIEW ||
return useSiteLevel == LanguageLevel.JDK_16_PREVIEW ||
useSiteLevel.isAtLeast(LanguageLevel.JDK_17);
}
@@ -75,28 +54,8 @@ public enum HighlightingFeature {
return LanguageLevel.JDK_17;
}
},
LOCAL_INTERFACES(LanguageLevel.JDK_15_PREVIEW, "feature.local.interfaces"){
@Override
boolean isSufficient(@NotNull LanguageLevel useSiteLevel) {
return useSiteLevel.isAtLeast(LanguageLevel.JDK_15_PREVIEW);
}
@Override
LanguageLevel getStandardLevel() {
return LanguageLevel.JDK_16;
}
},
LOCAL_ENUMS(LanguageLevel.JDK_15_PREVIEW, "feature.local.enums"){
@Override
boolean isSufficient(@NotNull LanguageLevel useSiteLevel) {
return useSiteLevel.isAtLeast(LanguageLevel.JDK_15_PREVIEW);
}
@Override
LanguageLevel getStandardLevel() {
return LanguageLevel.JDK_16;
}
},
LOCAL_INTERFACES(LanguageLevel.JDK_16, "feature.local.interfaces"),
LOCAL_ENUMS(LanguageLevel.JDK_16, "feature.local.enums"),
INNER_STATICS(LanguageLevel.JDK_16, "feature.inner.statics"),
PATTERNS_IN_SWITCH(LanguageLevel.JDK_17_PREVIEW, "feature.patterns.in.switch"),
GUARDED_AND_PARENTHESIZED_PATTERNS(LanguageLevel.JDK_17_PREVIEW, "feature.guarded.and.parenthesised.patterns");

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInspection;
import com.intellij.codeInsight.AnnotationTargetUtil;
@@ -61,7 +61,7 @@ public class ConvertRecordToClassFix extends LocalQuickFixAndIntentionActionOnPs
if (!PsiUtil.isLanguageLevel7OrHigher(element)) return null;
PsiJavaFile maybeRecord = (PsiJavaFile)PsiFileFactory.getInstance(element.getProject())
.createFileFromText("Dummy.java", JavaLanguage.INSTANCE, element.getText(), false, false);
PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(maybeRecord, LanguageLevel.JDK_15_PREVIEW);
PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(maybeRecord, LanguageLevel.JDK_16);
PsiClass[] classes = maybeRecord.getClasses();
if (classes.length == 1 && classes[0].isRecord()) {
return classes[0];

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInspection.classCanBeRecord;
import com.intellij.codeInsight.AnnotationUtil;
@@ -83,7 +83,7 @@ class RecordBuilder {
PsiClass build() {
PsiJavaFile psiFile = (PsiJavaFile)PsiFileFactory.getInstance(myOriginClass.getProject())
.createFileFromText("Dummy.java", JavaLanguage.INSTANCE, myRecordText.toString(), false, false);
PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(psiFile, LanguageLevel.JDK_15_PREVIEW);
PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(psiFile, LanguageLevel.JDK_16);
PsiClass psiRecord = psiFile.getClasses()[0];
CodeStyleManager.getInstance(myOriginClass.getProject()).reformat(psiRecord);
return psiRecord;

View File

@@ -89,7 +89,6 @@ public class Java15APIUsageInspection extends AbstractBaseJavaLocalInspectionToo
ourPresentableShortMessage.put(LanguageLevel.JDK_13, "14");
ourPresentableShortMessage.put(LanguageLevel.JDK_14, "15");
ourPresentableShortMessage.put(LanguageLevel.JDK_15, "16");
ourPresentableShortMessage.put(LanguageLevel.JDK_15_PREVIEW, "16");
ourPresentableShortMessage.put(LanguageLevel.JDK_16, "17");
ourPresentableShortMessage.put(LanguageLevel.JDK_16_PREVIEW, "17");
}

View File

@@ -129,7 +129,7 @@ public class JavaFilePasteProvider implements PasteProvider {
private static PsiClass @NotNull [] getPastedClasses(@NotNull Project project, @NotNull String pasteText) {
PsiFile psiFile = PsiFileFactory.getInstance(project).createFileFromText(
"A.java", JavaLanguage.INSTANCE, StringUtil.convertLineSeparators(pasteText), false, false);
PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(psiFile, LanguageLevel.JDK_15_PREVIEW); // to parse records
PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(psiFile, LanguageLevel.JDK_16_PREVIEW); // to parse records
return psiFile instanceof PsiJavaFile ? ((PsiJavaFile)psiFile).getClasses() : PsiClass.EMPTY_ARRAY;
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.fileTemplates;
import com.intellij.ide.highlighter.JavaFileType;
@@ -28,7 +28,7 @@ public class JavaCreateFromTemplateHandler implements CreateFromTemplateHandler
if (extension == null) extension = JavaFileType.INSTANCE.getDefaultExtension();
final String name = "myClass" + "." + extension;
final PsiFile psiFile = PsiFileFactory.getInstance(project).createFileFromText(name, JavaLanguage.INSTANCE, content, false, false);
psiFile.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.JDK_15_PREVIEW);
psiFile.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.JDK_16_PREVIEW);
if (!(psiFile instanceof PsiJavaFile)){
throw new IncorrectOperationException("This template did not produce a Java class or an interface\n"+psiFile.getText());

View File

@@ -122,7 +122,6 @@ jdk.12.language.level.description=12 - No new language features
jdk.13.language.level.description=13 - No new language features
jdk.14.language.level.description=14 - Switch expressions
jdk.15.language.level.description=15 - Text blocks
jdk.15.preview.language.level.description=15 (Preview) - Sealed types, records, patterns, local enums and interfaces
jdk.16.language.level.description=16 - Records, patterns, local enums and interfaces
jdk.16.preview.language.level.description=16 (Preview) - Sealed types
jdk.17.language.level.description=17 - Sealed types, always-strict floating-point semantics

View File

@@ -37,7 +37,6 @@ public enum LanguageLevel {
JDK_13(JavaPsiBundle.messagePointer("jdk.13.language.level.description"), 13),
JDK_14(JavaPsiBundle.messagePointer("jdk.14.language.level.description"), 14),
JDK_15(JavaPsiBundle.messagePointer("jdk.15.language.level.description"), 15),
JDK_15_PREVIEW(JavaPsiBundle.messagePointer("jdk.15.preview.language.level.description"), 15),
JDK_16(JavaPsiBundle.messagePointer("jdk.16.language.level.description"), 16),
JDK_16_PREVIEW(JavaPsiBundle.messagePointer("jdk.16.preview.language.level.description"), 16),
JDK_17(JavaPsiBundle.messagePointer("jdk.17.language.level.description"), 17),

View File

@@ -38,13 +38,13 @@ public final class JavaLexer extends LexerBase {
return id != null &&
(level.isAtLeast(LanguageLevel.JDK_1_9) && JAVA9_KEYWORDS.contains(id) ||
level.isAtLeast(LanguageLevel.JDK_10) && VAR.contentEquals(id) ||
level.isAtLeast(LanguageLevel.JDK_15_PREVIEW) && RECORD.contentEquals(id) ||
level.isAtLeast(LanguageLevel.JDK_16) && RECORD.contentEquals(id) ||
level.isAtLeast(LanguageLevel.JDK_14) && YIELD.contentEquals(id) ||
(isSealedAvailable(level) && (SEALED.contentEquals(id) || PERMITS.contentEquals(id))));
}
public static boolean isSealedAvailable(@NotNull LanguageLevel level) {
return level.isAtLeast(LanguageLevel.JDK_15_PREVIEW) && (level.isAtLeast(LanguageLevel.JDK_17) || level.isPreview());
return level.isAtLeast(LanguageLevel.JDK_16_PREVIEW);
}
private final _JavaLexer myFlexLexer;

View File

@@ -431,7 +431,7 @@ public class DeclarationParser {
if (tokenType == JavaTokenType.IDENTIFIER && PsiKeyword.RECORD.equals(builder.getTokenText()) &&
builder.lookAhead(1) == JavaTokenType.IDENTIFIER) {
LanguageLevel level = getLanguageLevel(builder);
return level.isAtLeast(LanguageLevel.JDK_15_PREVIEW);
return level.isAtLeast(LanguageLevel.JDK_16);
}
return false;
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.impl;
import com.intellij.ide.highlighter.JavaFileType;
@@ -155,7 +155,7 @@ public class PsiJavaParserFacadeImpl implements PsiJavaParserFacade {
}
private @NotNull PsiClass createRecordFromText(@NotNull String text) {
JavaDummyElement dummyElement = new JavaDummyElement(text, DECLARATION, LanguageLevel.JDK_15_PREVIEW);
JavaDummyElement dummyElement = new JavaDummyElement(text, DECLARATION, LanguageLevel.JDK_16);
DummyHolder holder = DummyHolderFactory.createHolder(myManager, dummyElement, null);
PsiElement element = SourceTreeToPsiMap.treeElementToPsi(holder.getTreeElement().getFirstChildNode());
if (!(element instanceof PsiClass)) {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.impl.source;
import com.intellij.openapi.diagnostic.Logger;
@@ -96,7 +96,7 @@ public final class ClassInnerStuffCache {
}
private boolean classNameIsSealed() {
return PsiUtil.getLanguageLevel(myClass).isAtLeast(LanguageLevel.JDK_15_PREVIEW) && PsiKeyword.SEALED.equals(myClass.getName());
return PsiKeyword.SEALED.equals(myClass.getName()) && PsiUtil.getLanguageLevel(myClass).isAtLeast(LanguageLevel.JDK_16_PREVIEW);
}
@Nullable

View File

@@ -1,10 +0,0 @@
class InstanceOfSubtypeJava15 {
void test(CharSequence cs) {
if (cs instanceof String) {}
if (cs instanceof String s) {}
if (cs instanceof CharSequence) {}
if (cs instanceof CharSequence s) {}
if (cs instanceof Object) {}
if (cs instanceof Object s) {}
}
}

View File

@@ -1,10 +0,0 @@
class X {
void expressions(Object obj) {
if (obj instanceof String s) {
<error descr="Cannot assign a value to final variable 's'">s</error> = "foo";
}
if (obj instanceof <error descr="Modifier 'final' not allowed here">final</error> String s) {
<error descr="Cannot assign a value to final variable 's'">s</error> = "foo";
}
}
}

View File

@@ -55,7 +55,7 @@ record AnnotatedComponents(
class Outer {
record NestedRecord() {}
class Inner {
<error descr="Static declarations in inner classes are not supported at language level '15'">record InnerRecord()</error> {}
record InnerRecord() {}
}
}

View File

@@ -1,9 +0,0 @@
// "Replace 's' with pattern variable" "true"
class X {
void test(Object obj) {
if (obj instanceof String s) {
}
}
@interface Foo {}
}

View File

@@ -1,7 +0,0 @@
// "Replace 's' with pattern variable" "true"
class X {
void test(Object obj) {
if (obj instanceof String s) {
}
}
}

View File

@@ -1,10 +0,0 @@
// "Replace 's' with pattern variable" "true"
class X {
void test(Object obj) {
if (obj instanceof String) {
@Foo String <caret>s = (String)obj;
}
}
@interface Foo {}
}

View File

@@ -1,8 +0,0 @@
// "Replace 's' with pattern variable" "true"
class X {
void test(Object obj) {
if (obj instanceof String) {
final String <caret>s = (String)obj;
}
}
}

View File

@@ -1,10 +0,0 @@
// "Replace 's' with pattern variable" "false"
class X {
void test(Object obj) {
if (obj instanceof String) {
String <caret>s = (String)obj;
System.out.println(s);
s = s.trim();
}
}
}

View File

@@ -1,11 +1,10 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight;
import com.intellij.JavaTestUtil;
import com.intellij.application.options.CodeStyle;
import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.actionSystem.IdeActions;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import com.intellij.testFramework.EditorActionTestCase;
@@ -35,11 +34,6 @@ public class CompleteStatementTest extends EditorActionTestCase {
myJavaSettings = mySettings.getCommonSettings(JavaLanguage.INSTANCE);
}
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_15_PREVIEW;
}
public void testAddMissingSemicolon() { doTest(); }
public void testAddMissingSemicolonToPackageStatement() { doTest(); }
public void testAddMissingSemicolonAfterAnonymous() { doTest(); }

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight;
import com.intellij.JavaTestUtil;
@@ -45,7 +31,7 @@ public class GenerateConstructorTest extends LightJavaCodeInsightFixtureTestCase
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
return JAVA_16;
}
@Override

View File

@@ -12,7 +12,6 @@ import com.intellij.psi.PsiManager
import com.intellij.psi.PsiType
import com.intellij.psi.codeStyle.JavaCodeStyleSettings
import com.intellij.psi.impl.light.LightFieldBuilder
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.ServiceContainerUtil
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import com.intellij.util.NotNullFunction
@@ -21,6 +20,7 @@ import com.siyeh.ig.style.UnqualifiedFieldAccessInspection
import groovy.transform.CompileStatic
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable
/**
* @author peter
*/
@@ -347,9 +347,4 @@ record Point(int x, int y) {
}.invoke(project, myFixture.editor, myFixture.file)
UIUtil.dispatchAllInvocationEvents()
}
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15
}
}

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight;
import com.intellij.application.options.CodeStyle;
@@ -6,17 +6,14 @@ import com.intellij.openapi.command.undo.UndoManager;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.fileEditor.TextEditor;
import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import com.intellij.testFramework.IdeaTestUtil;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.fixtures.BasePlatformTestCase;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.regex.Matcher;
@@ -112,7 +109,7 @@ public class JavaTypingTest extends BasePlatformTestCase {
}
public void testInsertPairedBraceForLocalRecord() {
IdeaTestUtil.withLevel(getModule(), LanguageLevel.JDK_15_PREVIEW, () -> doTest('{'));
doTest('{');
}
public void testSemicolonInStringLiteral() {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight
import com.intellij.JavaTestUtil
@@ -28,7 +28,7 @@ class OverrideImplementTest extends LightJavaCodeInsightFixtureTestCase {
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15
return JAVA_LATEST
}
private void addRecordClass() {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.completion;
import com.intellij.JavaTestUtil;
@@ -150,7 +150,7 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
public void testPrimitivesInClassAnnotationAttribute() { doTest(3, "true", "int", "boolean"); }
public void testPrimitivesInMethodReturningArray() { doTest(2, "true", "byte", "boolean"); }
public void testPrimitivesInMethodReturningClass() { doTest(3, "byte", "boolean", "void"); }
public void testPrimitivesInRecordHeader() {setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest(2, "byte", "boolean"); }
public void testPrimitivesInRecordHeader() {setLanguageLevel(LanguageLevel.JDK_16); doTest(2, "byte", "boolean"); }
public void testNoClassKeywordsInLocalArrayInitializer() { doTest(0, "class", "interface", "enum"); }
public void testNoClassKeywordsInFieldArrayInitializer() { doTest(0, "class", "interface", "enum"); }
@@ -189,23 +189,23 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
public void testSuggestModifiersAfterUnfinishedMethod() { doTest(1, "public"); }
public void testPrivateInJava9Interface() { setLanguageLevel(LanguageLevel.JDK_1_9); doTest(); }
public void testQualifiedNew() { doTest(1, "new"); }
public void testRecord() {setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest(); }
public void testRecordInFileScope() {setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest(1, "record"); }
public void testRecord() {setLanguageLevel(LanguageLevel.JDK_16); doTest(); }
public void testRecordInFileScope() {setLanguageLevel(LanguageLevel.JDK_16); doTest(1, "record"); }
public void testNoLocalInterfaceAt15() {
setLanguageLevel(LanguageLevel.JDK_15); doTest(0);
}
public void testLocalInterface() {
setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest();
setLanguageLevel(LanguageLevel.JDK_16); doTest();
}
public void testLocalEnum() {
setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest();
setLanguageLevel(LanguageLevel.JDK_16); doTest();
}
public void testSealedModifier() {setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest(1, "sealed"); }
public void testSealedModifier() {setLanguageLevel(LanguageLevel.JDK_16_PREVIEW); doTest(1, "sealed"); }
public void testNoSealedModifier() {setLanguageLevel(LanguageLevel.JDK_16); doTest(1, "final"); }
public void testPermitsList() {setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest(1, "permits"); }
public void testEnumPermitsList() {setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest(0, "permits"); }
public void testInnerClassSealedModifier() {setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest(1, "sealed");}
public void testInterfaceInnerClassSealedModifier() {setLanguageLevel(LanguageLevel.JDK_15_PREVIEW); doTest(1, "sealed");}
public void testPermitsList() {setLanguageLevel(LanguageLevel.JDK_16_PREVIEW); doTest(1, "permits"); }
public void testEnumPermitsList() {setLanguageLevel(LanguageLevel.JDK_16_PREVIEW); doTest(0, "permits"); }
public void testInnerClassSealedModifier() {setLanguageLevel(LanguageLevel.JDK_16_PREVIEW); doTest(1, "sealed");}
public void testInterfaceInnerClassSealedModifier() {setLanguageLevel(LanguageLevel.JDK_16_PREVIEW); doTest(1, "sealed");}
public void testOverwriteCatch() {
configureByTestName();

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.completion
import com.intellij.testFramework.LightProjectDescriptor
@@ -11,7 +11,7 @@ class Normal14CompletionTest extends NormalCompletionTestCase {
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15
return JAVA_16
}
void testRecordImplements() {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon;
import com.intellij.JavaTestUtil;
@@ -23,7 +23,7 @@ public class IncreaseLanguageLevelFixTest extends LightDaemonAnalyzerTestCase {
@Override
protected Sdk getProjectJDK() {
return IdeaTestUtil.getMockJdk(JavaVersion.compose(15));
return IdeaTestUtil.getMockJdk(JavaVersion.compose(16));
}
@Override
@@ -40,19 +40,19 @@ public class IncreaseLanguageLevelFixTest extends LightDaemonAnalyzerTestCase {
}
public void testRecordTopLevel() {
IdeaTestUtil.withLevel(getModule(), LanguageLevel.JDK_15, () -> doTest(LanguageLevel.JDK_15_PREVIEW));
IdeaTestUtil.withLevel(getModule(), LanguageLevel.JDK_15, () -> doTest(LanguageLevel.JDK_16));
}
public void testRecordInClass() {
doTest(LanguageLevel.JDK_15_PREVIEW);
doTest(LanguageLevel.JDK_16);
}
public void testRecordInMethod() {
doTest(LanguageLevel.JDK_15_PREVIEW);
doTest(LanguageLevel.JDK_16);
}
public void testSealedClasses() {
doTest(LanguageLevel.JDK_15_PREVIEW);
doTest(LanguageLevel.JDK_16_PREVIEW);
}
private void doTest(LanguageLevel level) {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon
import com.intellij.JavaTestUtil
@@ -6,7 +6,6 @@ import com.intellij.openapi.actionSystem.IdeActions
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
class JavaTextBlocksHighlightingTest : LightJavaCodeInsightFixtureTestCase() {
override fun getProjectDescriptor() = JAVA_15
override fun getBasePath() = "${JavaTestUtil.getRelativeJavaTestDataPath()}/codeInsight/daemonCodeAnalyzer/textBlocks"
fun testTextBlocks() = doTest()

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon;
import com.intellij.JavaTestUtil;
@@ -56,7 +56,7 @@ public class JavadocHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testParam2() { doTest(); }
public void testParam3() { doTest(); }
public void testParam4() { doTest(); }
public void testRecordParamJava15Preview() { doTest(); }
public void testRecordParamJava16() { doTest(); }
public void testTypeParam() {
myInspection.METHOD_OPTIONS.ACCESS_JAVADOC_REQUIRED_FOR = "private";
myInspection.METHOD_OPTIONS.REQUIRED_TAGS = "@param";

View File

@@ -1,10 +1,8 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon;
import com.intellij.JavaTestUtil;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
public class LightLocalEnumsInterfacesHighlightingTest extends LightJavaCodeInsightFixtureTestCase {
@Override
@@ -12,12 +10,6 @@ public class LightLocalEnumsInterfacesHighlightingTest extends LightJavaCodeInsi
return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/daemonCodeAnalyzer/localInterfaceEnum";
}
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
}
public void testLocalInterface() {
doTest();
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon;
import com.intellij.JavaTestUtil;
@@ -18,7 +18,7 @@ public class LightPatternsHighlightingTest extends LightJavaCodeInsightFixtureTe
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
return JAVA_16;
}
public void testInstanceOfBasics() {
@@ -36,9 +36,6 @@ public class LightPatternsHighlightingTest extends LightJavaCodeInsightFixtureTe
public void testInstanceOfInSwitch() {
doTest();
}
public void testReassignPatternVariableJava15() {
doTest();
}
public void testReassignPatternVariable() {
IdeaTestUtil.withLevel(getModule(), LanguageLevel.JDK_16, this::doTest);
}
@@ -49,11 +46,8 @@ public class LightPatternsHighlightingTest extends LightJavaCodeInsightFixtureTe
public void testInstanceOfNonReified() {
doTest();
}
public void testInstanceOfSubtypeJava15() {
doTest();
}
public void testInstanceOfSubtype() {
IdeaTestUtil.withLevel(getModule(), LanguageLevel.JDK_16, this::doTest);
doTest();
}
private void doTest() {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon;
import com.intellij.JavaTestUtil;
@@ -20,7 +20,7 @@ public class LightRecordsHighlightingTest extends LightJavaCodeInsightFixtureTes
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
return JAVA_16;
}
public void testRecordBasics() {

View File

@@ -1,11 +1,9 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.indentGuide;
import com.intellij.JavaTestUtil;
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
import java.util.Collections;
@@ -32,11 +30,6 @@ public class JavaTextBlockIndentGuidePerformanceTest extends LightDaemonAnalyzer
.assertTiming();
}
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
}
private static String createCodeBlocks(int n, int nLines) {
return IntStream.range(0, n)

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.indentGuide;
import com.intellij.codeInsight.daemon.impl.StringContentIndentUtil;
@@ -6,7 +6,6 @@ import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.markup.RangeHighlighter;
import com.intellij.openapi.util.TextRange;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
@@ -110,12 +109,6 @@ public class JavaTextBlockIndentGuideTest extends BaseIndentGuideTest {
"}");
}
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
}
private void doTest(@NotNull String text) {
doTest(text, TextBlockIndentGuidesProvider::create);
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.problems
import com.intellij.codeInsight.daemon.problems.Problem
@@ -13,7 +13,6 @@ import com.intellij.refactoring.BaseRefactoringProcessor
import com.intellij.refactoring.RefactoringFactory
import com.intellij.refactoring.move.moveInner.MoveInnerImpl
import com.intellij.refactoring.openapi.impl.MoveInnerRefactoringImpl
import com.intellij.testFramework.TestModeFlags
internal class ClassProblemsTest : ProjectProblemsViewTest() {
fun testRename() = doClassTest { psiClass, factory ->

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.problems
import com.intellij.codeInsight.daemon.problems.pass.ProjectProblemUtils
@@ -26,7 +26,7 @@ internal abstract class ProjectProblemsViewTest : LightJavaCodeInsightFixtureTes
}
override fun getProjectDescriptor(): LightProjectDescriptor {
return JAVA_15
return JAVA_16
}
protected fun getProblems(editor: Editor = myFixture.editor) =

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
@@ -10,7 +10,7 @@ public class AddEmptyRecordHeaderTest extends LightQuickFixParameterizedTestCase
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_LATEST;
}
@Override

View File

@@ -1,8 +1,7 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiFile;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
public class AddToPermitsListTest extends LightJavaCodeInsightFixtureTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_16;
}
public void testNoPermitsList() {

View File

@@ -1,22 +1,7 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.pom.java.LanguageLevel;
public class ChangeMethodSignatureFromUsageModernTest extends LightQuickFixParameterizedTestCase {
@@ -25,8 +10,4 @@ public class ChangeMethodSignatureFromUsageModernTest extends LightQuickFixParam
return "/codeInsight/daemonCodeAnalyzer/quickFix/changeMethodSignatureFromUsageModern";
}
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_15_PREVIEW;
}
}

View File

@@ -1,26 +1,9 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.application.options.CodeStyle;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.lang.java.JavaLanguage;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
/**
* @author ven
@@ -32,12 +15,6 @@ public class CreateClassFromNewTest extends LightQuickFixParameterizedTestCase {
CodeStyle.getSettings(getProject()).getCommonSettings(JavaLanguage.INSTANCE).SPACE_BEFORE_CLASS_LBRACE = true;
}
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
}
@Override
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/createClassFromNew";

View File

@@ -1,36 +1,13 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
import com.intellij.psi.codeStyle.JavaCodeStyleSettings;
import com.intellij.testFramework.LightProjectDescriptor;
import com.siyeh.ig.style.MissortedModifiersInspection;
import com.siyeh.ig.style.UnqualifiedFieldAccessInspection;
import org.jetbrains.annotations.NotNull;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_15;
public class CreateConstructorParameterFromFieldTest extends LightQuickFixParameterizedTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
}
@Override
protected void setUp() throws Exception {
super.setUp();

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
@@ -11,7 +11,7 @@ public class CreateInnerClassFromNewTest extends LightQuickFixParameterizedTestC
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_LATEST;
}
@Override

View File

@@ -1,11 +1,10 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.ActionHint;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
import com.intellij.codeInsight.template.impl.TemplateState;
import com.intellij.pom.java.LanguageLevel;
import org.jetbrains.annotations.NotNull;
/**
@@ -30,9 +29,4 @@ public class DelegateWithDefaultParamValueTest extends LightQuickFixParameterize
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/delegateWithDefaultValue";
}
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_15_PREVIEW;
}
}

View File

@@ -1,18 +1,10 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.testFramework.LightProjectDescriptor;
import org.jetbrains.annotations.NotNull;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_15;
public class DeleteInvalidElementFixTest extends LightQuickFixParameterizedTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
}
@Override
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/deleteInvalidElement";

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
@@ -10,7 +10,7 @@ public class ExtendSealedClassTest extends LightQuickFixParameterizedTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_16;
}
@Override

View File

@@ -1,24 +1,7 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
public class ModifierRecordsTest extends LightQuickFixParameterizedTestCase {
@Override
@@ -26,9 +9,4 @@ public class ModifierRecordsTest extends LightQuickFixParameterizedTestCase {
return "/codeInsight/daemonCodeAnalyzer/quickFix/modifierRecords";
}
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.intention.IntentionAction;
@@ -38,6 +38,6 @@ public class ModifierSealedClassesTest extends LightJavaCodeInsightFixtureTestCa
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_16;
}
}

View File

@@ -1,39 +1,17 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.MoveFieldAssignmentToInitializerInspection;
import com.intellij.testFramework.LightProjectDescriptor;
import org.jetbrains.annotations.NotNull;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_15;
public class MoveFieldAssignmentToInitializerInspectionTest extends LightQuickFixParameterizedTestCase {
@Override
protected LocalInspectionTool @NotNull [] configureLocalInspectionTools() {
return new LocalInspectionTool[]{new MoveFieldAssignmentToInitializerInspection()};
}
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
}
@Override
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/moveFieldAssignmentToInitializer";

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.psi.PsiClass;
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
public class MoveToPackageTest extends LightJavaCodeInsightFixtureTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_16;
}
public void testSimple() {

View File

@@ -1,30 +1,16 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.testFramework.LightProjectDescriptor;
import org.jetbrains.annotations.NotNull;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_15;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_LATEST;
public class NormalizeRecordComponentFixTest extends LightQuickFixParameterizedTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
return JAVA_LATEST;
}
@Override

View File

@@ -1,25 +1,10 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.defUse.DefUseInspection;
import com.intellij.codeInspection.sillyAssignment.SillyAssignmentInspection;
import com.intellij.pom.java.LanguageLevel;
import org.jetbrains.annotations.NotNull;
public class RemoveUnusedAssignmentTest extends LightQuickFixParameterizedTestCase {
@@ -32,9 +17,4 @@ public class RemoveUnusedAssignmentTest extends LightQuickFixParameterizedTestCa
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/unusedAssignment";
}
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_15_PREVIEW;
}
}

View File

@@ -1,24 +1,9 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.PossibleHeapPollutionVarargsInspection;
import com.intellij.pom.java.LanguageLevel;
import org.jetbrains.annotations.NotNull;
@@ -34,9 +19,4 @@ public class SafeVarargsCanBeUsedTest extends LightQuickFixParameterizedTestCase
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/safeVarargs";
}
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_15_PREVIEW;
}
}

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
@@ -23,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
public class UnimplementIntentionTest extends LightQuickFixParameterizedTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_16;
}
@Override

View File

@@ -1,32 +1,9 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.testFramework.LightProjectDescriptor;
import org.jetbrains.annotations.NotNull;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_15;
public class VariableTypeTest extends LightQuickFixParameterizedTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
}
@Override
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/variableType";

View File

@@ -1,10 +1,8 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.editorActions
import com.intellij.openapi.editor.actionSystem.TypedAction
import com.intellij.openapi.editor.ex.EditorEx
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import groovy.transform.CompileStatic
@@ -34,11 +32,6 @@ class JavaQuoteTest extends LightJavaCodeInsightFixtureTestCase {
}
void testPrecedingTextBlock() { doTest 'f(""<caret> + """\n .""")', 'f("""\n <caret>""" + """\n .""")' }
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15
}
private void doTest(String before, String after, char c = '"') {
myFixture.configureByText("a.java", "class C {{\n ${before}\n}}")
TypedAction.instance.actionPerformed(editor, c, (editor as EditorEx).dataContext)

View File

@@ -1,10 +1,8 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.folding
import com.intellij.testFramework.LightProjectDescriptor
class JavaFolding14Test : JavaFoldingTestCase() {
override fun getProjectDescriptor(): LightProjectDescriptor = JAVA_15
fun testRecord() {
val text = """

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.generation.surroundWith
import com.intellij.codeInsight.generation.surroundWith.*
@@ -6,15 +6,11 @@ import com.intellij.lang.LanguageSurrounders
import com.intellij.lang.java.JavaLanguage
import com.intellij.lang.surroundWith.Surrounder
import com.intellij.testFramework.LightJavaCodeInsightTestCase
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_15
import com.intellij.util.containers.ContainerUtil
class JavaSurroundWith13Test : LightJavaCodeInsightTestCase() {
private val BASE_PATH = "/codeInsight/generation/surroundWith/java13/"
override fun getProjectDescriptor(): LightProjectDescriptor = JAVA_15
fun testCaseBlockWithIf() = doTest(JavaWithIfSurrounder())
fun testCaseResultWithIf() = doTest(JavaWithIfSurrounder())
fun testCaseThrowWithIf() = doTest(JavaWithIfSurrounder())

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.highlighting
import com.intellij.JavaTestUtil
@@ -13,17 +13,11 @@ import com.intellij.pom.java.LanguageLevel
import com.intellij.psi.PsiElement
import com.intellij.psi.impl.source.tree.injected.MyTestInjector
import com.intellij.testFramework.IdeaTestUtil
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
class HighlightUsagesHandlerTest extends LightJavaCodeInsightFixtureTestCase {
final String basePath = JavaTestUtil.relativeJavaTestDataPath
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15
}
void testHighlightImport() {
configureFile()
ctrlShiftF7()

View File

@@ -1,24 +1,7 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.intention;
import com.intellij.codeInsight.daemon.LightIntentionActionTestCase;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
public class ConvertCompactConstructorToCanonicalActionTest extends LightIntentionActionTestCase {
@Override
@@ -26,8 +9,4 @@ public class ConvertCompactConstructorToCanonicalActionTest extends LightIntenti
return "/codeInsight/daemonCodeAnalyzer/quickFix/compactToCanonical";
}
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.intention;
import com.intellij.codeInsight.intention.impl.CreateSubclassAction;
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull;
public class CreateSubclassTest extends LightMultiFileTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
return JAVA_16;
}
public void testGenerics() {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.intention;
import com.intellij.JavaTestUtil;
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
public class SealClassActionFailingTest extends LightJavaCodeInsightFixtureTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_16;
}
public void testFunctionalInterface() {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.intention;
import com.intellij.codeInsight.intention.impl.SealClassAction;
@@ -12,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
public class SealClassActionMultiFileTest extends LightJavaCodeInsightFixtureTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_16;
}
public void testMultiFile() {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.intention;
import com.intellij.codeInsight.daemon.LightIntentionActionTestCase;
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
public class SealClassActionTest extends LightIntentionActionTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_16;
}
@Override

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.javadoc;
import com.intellij.JavaTestUtil;
@@ -56,7 +56,7 @@ public class JavaDocInfoGeneratorTest extends JavaCodeInsightTestCase {
@Override
protected @NotNull LanguageLevel getProjectLanguageLevel() {
return LanguageLevel.JDK_15_PREVIEW;
return LanguageLevel.HIGHEST;
}
public void testSimpleField() { doTestField(); }

View File

@@ -25,7 +25,7 @@ class JavaLiveTemplateTest extends LiveTemplateTestCase {
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15
return JAVA_16
}
final String basePath = JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/template/"

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
@@ -16,7 +16,7 @@ public class FillPermitsListInspectionTest extends LightQuickFixParameterizedTes
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_15_PREVIEW;
return LanguageLevel.JDK_16_PREVIEW;
}
@Override

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection;
@@ -71,10 +71,10 @@ public class JavaAPIUsagesInspectionTest extends LightJavaCodeInsightFixtureTest
//generate apiXXX.txt
//configure jdk and set test project descriptor
private static final String PREVIEW_JDK_HOME = "/home/me/.jdks/openjdk-15";
private static final String JDK_HOME = "/home/me/java/jdk-16";
private static final LanguageLevel LANGUAGE_LEVEL = LanguageLevel.JDK_15_PREVIEW;
private static final String VERSION = "16";
private static final String PREVIEW_JDK_HOME = "/home/me/.jdks/openjdk-16";
private static final String JDK_HOME = "/home/me/java/jdk-17";
private static final LanguageLevel LANGUAGE_LEVEL = LanguageLevel.JDK_16_PREVIEW;
private static final String VERSION = "17";
private static final LightProjectDescriptor API_VERSION_PROJECT_DESCRIPTOR = new LightProjectDescriptor() {
@Override
public @NotNull Sdk getSdk() {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection;
import com.intellij.JavaTestUtil;
@@ -26,7 +26,7 @@ public class LocalCanBeFinalTest extends LightJavaCodeInsightFixtureTestCase {
@Override
protected LightProjectDescriptor getProjectDescriptor() {
// has to have JFrame and sources
return JAVA_15;
return JAVA_16;
}
private void doTest() {

View File

@@ -1,25 +1,9 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection;
import com.intellij.JavaTestUtil;
import com.intellij.codeInspection.MeaninglessRecordAnnotationInspection;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
public class MeaninglessRecordAnnotationInspectionTest extends LightJavaCodeInsightFixtureTestCase {
@Override
@@ -27,12 +11,6 @@ public class MeaninglessRecordAnnotationInspectionTest extends LightJavaCodeInsi
return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInspection/meaninglessRecordAnnotation";
}
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
}
@Override
protected void setUp() throws Exception {
super.setUp();

View File

@@ -1,27 +0,0 @@
// 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.intellij.java.codeInspection;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.PatternVariableCanBeUsedInspection;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
public class PatternVariableCanBeUsedInspection15Test extends LightQuickFixParameterizedTestCase {
@Override
protected LocalInspectionTool @NotNull [] configureLocalInspectionTools() {
return new LocalInspectionTool[]{new PatternVariableCanBeUsedInspection()};
}
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
}
@Override
protected String getBasePath() {
return "/inspection/patternVariableCanBeUsed15";
}
}

View File

@@ -1,25 +1,9 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.RecordCanBeClassInspection;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
public class RecordCanBeClassInspectionTest extends LightQuickFixParameterizedTestCase {
@@ -28,12 +12,6 @@ public class RecordCanBeClassInspectionTest extends LightQuickFixParameterizedTe
protected LocalInspectionTool @NotNull [] configureLocalInspectionTools() {
return new LocalInspectionTool[]{new RecordCanBeClassInspection()};
}
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
}
@Override
protected String getBasePath() {
return "/inspection/recordCanBeClass/";

View File

@@ -1,25 +1,9 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.RedundantRecordConstructorInspection;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
public class RedundantRecordConstructorInspectionTest extends LightQuickFixParameterizedTestCase {
@@ -29,11 +13,6 @@ public class RedundantRecordConstructorInspectionTest extends LightQuickFixParam
return new LocalInspectionTool[]{new RedundantRecordConstructorInspection()};
}
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
}
@Override
protected String getBasePath() {
return "/inspection/redundantRecordConstructor/";

View File

@@ -1,11 +1,9 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.codeInspection.RecordCanBeClassInspection;
import com.intellij.testFramework.LightProjectDescriptor;
import com.siyeh.ig.LightJavaInspectionTestCase;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SerializableRecordCanBeClassInspectionTest extends LightJavaInspectionTestCase {
@@ -160,11 +158,6 @@ public class SerializableRecordCanBeClassInspectionTest extends LightJavaInspect
return new RecordCanBeClassInspection();
}
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
}
@Override
protected String[] getEnvironmentClasses() {
return new String[]{

View File

@@ -1,12 +1,10 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection.classCanBeRecord;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.classCanBeRecord.ClassCanBeRecordInspection;
import com.intellij.codeInspection.classCanBeRecord.ClassCanBeRecordInspection.ConversionStrategy;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
public class ClassCanBeRecordInspectionAccessorsRenamingTest extends LightQuickFixParameterizedTestCase {
@@ -16,11 +14,6 @@ public class ClassCanBeRecordInspectionAccessorsRenamingTest extends LightQuickF
return new LocalInspectionTool[]{new ClassCanBeRecordInspection(ConversionStrategy.SILENTLY, false)};
}
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
}
@Override
protected String getBasePath() {
return "/inspection/classCanBeRecord/accessorsRenaming";

View File

@@ -1,12 +1,10 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection.classCanBeRecord;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.classCanBeRecord.ClassCanBeRecordInspection;
import com.intellij.codeInspection.classCanBeRecord.ClassCanBeRecordInspection.ConversionStrategy;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
public class ClassCanBeRecordInspectionTest extends LightQuickFixParameterizedTestCase {
@@ -16,11 +14,6 @@ public class ClassCanBeRecordInspectionTest extends LightQuickFixParameterizedTe
return new LocalInspectionTool[]{new ClassCanBeRecordInspection(ConversionStrategy.SILENTLY, true)};
}
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
}
@Override
protected String getBasePath() {
return "/inspection/classCanBeRecord";

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection.classCanBeRecord;
import com.intellij.codeInsight.daemon.ImplicitUsageProvider;
@@ -45,7 +45,7 @@ public class ClassCanBeRecordInspectionUsageProviderTest extends LightQuickFixPa
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_LATEST;
}
@Override

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInspection.classCanBeRecord;
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
@@ -18,7 +18,7 @@ public class ClassCanBeRecordInspectionWeakenAccessibilityTest extends LightQuic
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return LightJavaCodeInsightFixtureTestCase.JAVA_15;
return LightJavaCodeInsightFixtureTestCase.JAVA_LATEST;
}
@Override

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.editor;
import com.intellij.ide.highlighter.HighlighterFactory;
@@ -12,7 +12,6 @@ import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
import com.intellij.openapi.editor.highlighter.HighlighterIterator;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.JavaDocTokenType;
import com.intellij.psi.JavaTokenType;
import com.intellij.psi.StringEscapesTokenTypes;
@@ -26,11 +25,6 @@ public class JavaHighlighterTest extends LightJavaCodeInsightTestCase {
private Document myDocument;
private final ArrayList<Editor> myEditorsToRelease = new ArrayList<>();
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_15_PREVIEW;
}
@Override
protected void tearDown() throws Exception {
try {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.execution.configurations;
import com.intellij.execution.CantRunException;
@@ -114,7 +114,7 @@ public class JavaParametersTest extends ModuleRootManagerTestCase {
public void testPreviewLanguageFeatures() throws CantRunException {
ModuleRootModificationUtil.updateModel(myModule, (model) -> {
model.getModuleExtension(LanguageLevelModuleExtension.class)
.setLanguageLevel(LanguageLevel.JDK_15_PREVIEW);
.setLanguageLevel(LanguageLevel.JDK_16_PREVIEW);
Sdk mockJdk = IdeaTestUtil.getMockJdk(JavaVersion.compose(14));
WriteAction.runAndWait(() -> ProjectJdkTable.getInstance().addJdk(mockJdk, myProject));
model.setSdk(mockJdk);

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.lexer
import com.intellij.lang.java.lexer.JavaLexer
@@ -29,10 +15,10 @@ class JavaKeywordsTest {
assertFalse(JavaLexer.isSoftKeyword("char", LanguageLevel.JDK_1_9))
assertFalse(JavaLexer.isKeyword("module", LanguageLevel.JDK_1_9))
assertTrue(JavaLexer.isSoftKeyword("module", LanguageLevel.JDK_1_9))
assertFalse(JavaLexer.isKeyword("sealed", LanguageLevel.JDK_15_PREVIEW))
assertTrue(JavaLexer.isSoftKeyword("sealed", LanguageLevel.JDK_15_PREVIEW))
assertFalse(JavaLexer.isKeyword("permits", LanguageLevel.JDK_15_PREVIEW))
assertTrue(JavaLexer.isSoftKeyword("permits", LanguageLevel.JDK_15_PREVIEW))
assertFalse(JavaLexer.isKeyword("sealed", LanguageLevel.JDK_16_PREVIEW))
assertTrue(JavaLexer.isSoftKeyword("sealed", LanguageLevel.JDK_16_PREVIEW))
assertFalse(JavaLexer.isKeyword("permits", LanguageLevel.JDK_16_PREVIEW))
assertTrue(JavaLexer.isSoftKeyword("permits", LanguageLevel.JDK_16_PREVIEW))
}
@Test fun sequences() {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.propertyBased;
import com.intellij.codeInsight.intention.impl.SealClassAction;
@@ -34,7 +34,7 @@ public class MakeClassSealedPropertyTest extends BaseUnivocityTest {
@Override
public void setUp() throws Exception {
super.setUp();
WriteAction.run(() -> LanguageLevelProjectExtension.getInstance(myProject).setLanguageLevel(LanguageLevel.JDK_15_PREVIEW));
WriteAction.run(() -> LanguageLevelProjectExtension.getInstance(myProject).setLanguageLevel(LanguageLevel.JDK_16_PREVIEW));
((PsiDocumentManagerImpl)PsiDocumentManager.getInstance(myProject)).disableBackgroundCommit(getTestRootDisposable());
MadTestingUtil.enableAllInspections(myProject);
}

View File

@@ -20,7 +20,7 @@ import groovy.transform.CompileStatic
class JavaPsiTest extends LightJavaCodeInsightFixtureTestCase {
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15
return JAVA_16
}
void testEmptyImportList() {
@@ -228,7 +228,7 @@ class JavaPsiTest extends LightJavaCodeInsightFixtureTestCase {
}
void "test enum with name sealed"() {
withLanguageLevel(LanguageLevel.JDK_15_PREVIEW) {
withLanguageLevel(LanguageLevel.JDK_16_PREVIEW) {
def clazz = configureFile("enum sealed {}").classes[0]
assert !clazz.getAllMethods().any { it.name == "values" }
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.psi;
import com.intellij.lang.FileASTNode;
@@ -23,7 +23,7 @@ import java.io.IOException;
import java.security.SecureRandom;
import java.util.List;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_15;
import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_LATEST;
@SuppressWarnings("SpellCheckingInspection")
public class JavaStubBuilderTest extends LightIdeaTestCase {
@@ -43,7 +43,7 @@ public class JavaStubBuilderTest extends LightIdeaTestCase {
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
return JAVA_LATEST;
}
public void testEmpty() {
@@ -733,7 +733,7 @@ public class JavaStubBuilderTest extends LightIdeaTestCase {
private void doTest(/*@Language("JAVA")*/ String source, @Language("TEXT") String expected) {
PsiJavaFile file = (PsiJavaFile)createLightFile("test.java", source);
file.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.JDK_15_PREVIEW);
file.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.HIGHEST);
FileASTNode fileNode = file.getNode();
assertNotNull(fileNode);
assertFalse(fileNode.isParsed());

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.psi;
import com.intellij.application.options.CodeStyle;
@@ -27,9 +13,7 @@ import com.intellij.psi.codeStyle.JavaCodeStyleSettings;
import com.intellij.psi.codeStyle.PackageEntry;
import com.intellij.psi.codeStyle.PackageEntryTable;
import com.intellij.psi.codeStyle.modifier.CodeStyleSettingsModifier;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.ServiceContainerUtil;
import org.jetbrains.annotations.NotNull;
public class OptimizeImportsTest extends OptimizeImportsTestCase {
static final String BASE_PATH = PathManagerEx.getTestDataPath() + "/psi/optimizeImports";
@@ -111,11 +95,6 @@ public class OptimizeImportsTest extends OptimizeImportsTestCase {
myFixture.checkResult("class Foo {}");
}
@Override
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
}
public void testNoStubPsiMismatchOnRecordInsideImportList() {
myFixture.enableInspections(new UnusedImportInspection());
myFixture.configureByText("a.java", "import java.ut<caret>il.List;\n" +

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.psi.formatter.java;
import com.intellij.JavaTestUtil;
@@ -125,7 +125,7 @@ public abstract class AbstractJavaFormatterTest extends LightIdeaTestCase {
public void doTextTest(@NotNull Action action, @NotNull String text, @NotNull String textAfter) throws IncorrectOperationException {
final PsiFile file = createFile("A.java", text);
file.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.JDK_15_PREVIEW);
file.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.JDK_16_PREVIEW);
final PsiDocumentManager manager = PsiDocumentManager.getInstance(getProject());
final Document document = manager.getDocument(file);
if (document == null) {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.psi.formatter.java
import com.intellij.application.options.CodeStyle
@@ -13,8 +13,6 @@ import com.intellij.psi.JavaCodeFragmentFactory
import com.intellij.psi.PsiElement
import com.intellij.psi.codeStyle.CodeStyleManager
import com.intellij.psi.codeStyle.CommonCodeStyleSettings
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import com.intellij.util.IncorrectOperationException
/**
@@ -22,10 +20,7 @@ import com.intellij.util.IncorrectOperationException
* java formatting test classes.
*/
class JavaFormatterTest : AbstractJavaFormatterTest() {
override fun getProjectDescriptor(): LightProjectDescriptor {
return LightJavaCodeInsightFixtureTestCase.JAVA_15
}
fun testPaymentManager() {
settings.KEEP_LINE_BREAKS = false
doTest("paymentManager.java", "paymentManager_after.java")

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.psi.resolve
import com.intellij.lang.FCTSBackedLighterAST
@@ -40,7 +26,7 @@ import org.jetbrains.annotations.NotNull
class FileLocalResolverTest extends LightJavaCodeInsightFixtureTestCase {
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15
return JAVA_16
}
void "test unknown variable"() {
@@ -254,7 +240,7 @@ class C {
def file = PsiFileFactory.getInstance(project).
createFileFromText('a.java', JavaLanguage.INSTANCE, myFixture.file.text, false, false)
file.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.JDK_15_PREVIEW)
file.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.HIGHEST)
def fctsTree = file.node.lighterAST
assert fctsTree instanceof FCTSBackedLighterAST

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.psi.resolve;
import com.intellij.lang.jvm.JvmParameter;
@@ -15,7 +15,7 @@ public class ResolveRecordMethodsTest extends LightResolveTestCase {
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_15;
return JAVA_LATEST;
}
private PsiElement resolve() {

Some files were not shown because too many files have changed in this diff Show More