diff --git a/java/java-tests/testData/inspection/suspiciousCalls/RemoveAll14.java b/java/java-tests/testData/inspection/suspiciousCalls/RemoveAll14.java index f6e2c033b6fc..228dfed9ebac 100644 --- a/java/java-tests/testData/inspection/suspiciousCalls/RemoveAll14.java +++ b/java/java-tests/testData/inspection/suspiciousCalls/RemoveAll14.java @@ -5,7 +5,7 @@ class Simple { public static void main(Set set, Set setO) { class O {} - Map someData = new HashMap(); + Map someData = Collections.EMPTY_MAP; set.removeAll(someData.keySet()); setO.removeAll(someData.keySet()); diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/CopyReferenceActionTest.groovy b/java/java-tests/testSrc/com/intellij/java/codeInsight/CopyReferenceActionTest.groovy index e98f33105786..185882f1b8ef 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/CopyReferenceActionTest.groovy +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/CopyReferenceActionTest.groovy @@ -24,10 +24,12 @@ import com.intellij.openapi.ide.CopyPasteManager import com.intellij.psi.PsiFile import com.intellij.testFramework.LightProjectDescriptor import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase +import org.jetbrains.annotations.NotNull class CopyReferenceActionTest extends LightCodeInsightFixtureTestCase { private int oldSetting + @NotNull @Override protected LightProjectDescriptor getProjectDescriptor() { return JAVA_9 diff --git a/java/testFramework/src/com/intellij/testFramework/fixtures/LightCodeInsightFixtureTestCase.java b/java/testFramework/src/com/intellij/testFramework/fixtures/LightCodeInsightFixtureTestCase.java index 6674fed63abe..8ebcbb412df5 100644 --- a/java/testFramework/src/com/intellij/testFramework/fixtures/LightCodeInsightFixtureTestCase.java +++ b/java/testFramework/src/com/intellij/testFramework/fixtures/LightCodeInsightFixtureTestCase.java @@ -42,6 +42,11 @@ import java.io.File; */ public abstract class LightCodeInsightFixtureTestCase extends UsefulTestCase { public static final LightProjectDescriptor JAVA_1_4 = new DefaultLightProjectDescriptor() { + @Override + public Sdk getSdk() { + return IdeaTestUtil.getMockJdk14(); + } + @Override public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { model.getModuleExtension(LanguageLevelModuleExtension.class).setLanguageLevel(LanguageLevel.JDK_1_4); diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/IgnoreResultOfCallInspectionTest.groovy b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/IgnoreResultOfCallInspectionTest.groovy index 68f33c31f824..414578e6ae93 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/IgnoreResultOfCallInspectionTest.groovy +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/IgnoreResultOfCallInspectionTest.groovy @@ -19,6 +19,7 @@ import com.intellij.codeInspection.LocalInspectionTool import com.intellij.openapi.util.registry.Registry import com.intellij.testFramework.LightProjectDescriptor import com.siyeh.ig.LightInspectionTestCase +import org.jetbrains.annotations.NotNull @SuppressWarnings(["ResultOfMethodCallIgnored", "UnusedReturnValue"]) class IgnoreResultOfCallInspectionTest extends LightInspectionTestCase { @@ -28,6 +29,7 @@ class IgnoreResultOfCallInspectionTest extends LightInspectionTestCase { return new IgnoreResultOfCallInspection() } + @NotNull @Override protected LightProjectDescriptor getProjectDescriptor() { return JAVA_8