mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 13:15:25 +07:00
Cleanup (warnings, formatting)
This commit is contained in:
+87
-91
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -20,7 +20,6 @@ import com.intellij.lang.java.JavaLanguage;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -28,7 +27,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* @since 20.02.2003
|
||||
*/
|
||||
public class KeywordCompletionTest extends LightCompletionTestCase {
|
||||
private static final String BASE_PATH = "/codeInsight/completion/keywords";
|
||||
private static final String BASE_PATH = "/codeInsight/completion/keywords/";
|
||||
|
||||
private static final String[] FILE_SCOPE_KEYWORDS = {
|
||||
"package", "public", "private", "import", "final", "class", "interface", "abstract", "enum", "default", null};
|
||||
@@ -45,74 +44,74 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
|
||||
return JavaTestUtil.getJavaTestDataPath();
|
||||
}
|
||||
|
||||
public void testFileScope1() throws Exception { doTest(8, FILE_SCOPE_KEYWORDS); }
|
||||
public void testFileScope2() throws Exception { doTest(7, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope1() throws Exception { doTest(5, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope2() throws Exception { doTest(4, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope3() throws Exception { doTest(0, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope4() throws Exception { doTest(10, CLASS_SCOPE_KEYWORDS_2); }
|
||||
public void testInterfaceScope() throws Exception { doTest(8, INTERFACE_SCOPE_KEYWORDS); }
|
||||
public void testAfterAnnotations() throws Exception { doTest(6, "public", "final", "class", "interface", "abstract", "enum", null); }
|
||||
public void testExtends1() throws Exception { doTest(2, "extends", "implements", null); }
|
||||
public void testExtends2() throws Exception { doTest(1, "extends", "implements", "AAA", "BBB", "instanceof"); }
|
||||
public void testExtends3() throws Exception { doTest(2, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); }
|
||||
public void testExtends4() throws Exception { doTest(2, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); }
|
||||
public void testExtends5() throws Exception { doTest(1, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); }
|
||||
public void testExtends6() throws Exception { doTest(1, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); }
|
||||
public void testExtends7() throws Exception { doTest(false); }
|
||||
public void testExtends8() throws Exception { doTest(false); }
|
||||
public void testExtends9() throws Exception { doTest(false); }
|
||||
public void testExtends10() throws Exception { doTest(false); }
|
||||
public void testExtends11() throws Exception { doTest(false); }
|
||||
public void testExtends12() throws Exception { doTest(false); }
|
||||
public void testExtends13() throws Exception { doTest(false); }
|
||||
public void testExtendsAfterClassGenerics() throws Exception { doTest(2, "extends", "implements"); }
|
||||
public void testSynchronized1() throws Exception { doTest(false); }
|
||||
public void testFileScope1() { doTest(8, FILE_SCOPE_KEYWORDS); }
|
||||
public void testFileScope2() { doTest(7, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope1() { doTest(5, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope2() { doTest(4, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope3() { doTest(0, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope4() { doTest(10, CLASS_SCOPE_KEYWORDS_2); }
|
||||
public void testInterfaceScope() { doTest(8, INTERFACE_SCOPE_KEYWORDS); }
|
||||
public void testAfterAnnotations() { doTest(6, "public", "final", "class", "interface", "abstract", "enum", null); }
|
||||
public void testExtends1() { doTest(2, "extends", "implements", null); }
|
||||
public void testExtends2() { doTest(1, "extends", "implements", "AAA", "BBB", "instanceof"); }
|
||||
public void testExtends3() { doTest(2, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); }
|
||||
public void testExtends4() { doTest(2, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); }
|
||||
public void testExtends5() { doTest(1, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); }
|
||||
public void testExtends6() { doTest(1, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); }
|
||||
public void testExtends7() { doTest(); }
|
||||
public void testExtends8() { doTest(); }
|
||||
public void testExtends9() { doTest(); }
|
||||
public void testExtends10() { doTest(); }
|
||||
public void testExtends11() { doTest(); }
|
||||
public void testExtends12() { doTest(); }
|
||||
public void testExtends13() { doTest(); }
|
||||
public void testExtendsAfterClassGenerics() { doTest(2, "extends", "implements"); }
|
||||
public void testSynchronized1() { doTest(); }
|
||||
|
||||
public void testSynchronized2() throws Exception {
|
||||
public void testSynchronized2() {
|
||||
CodeStyleSettingsManager.getSettings(getProject()).getCommonSettings(JavaLanguage.INSTANCE).SPACE_BEFORE_SYNCHRONIZED_PARENTHESES = false;
|
||||
doTest(false);
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMethodScope1() throws Exception { doTest(1, "throws"); }
|
||||
public void testMethodScope2() throws Exception { doTest(1, "final", "public", "static", "volatile", "abstract"); }
|
||||
public void testMethodScope3() throws Exception { doTest(1, "final", "public", "static", "volatile", "abstract", "throws", "instanceof"); }
|
||||
public void testMethodScope4() throws Exception { doTest(6, "final", "try", "for", "while", "return", "throw"); }
|
||||
public void testMethodScope5() throws Exception { doTest(false); }
|
||||
public void testMethodScope1() { doTest(1, "throws"); }
|
||||
public void testMethodScope2() { doTest(1, "final", "public", "static", "volatile", "abstract"); }
|
||||
public void testMethodScope3() { doTest(1, "final", "public", "static", "volatile", "abstract", "throws", "instanceof"); }
|
||||
public void testMethodScope4() { doTest(6, "final", "try", "for", "while", "return", "throw"); }
|
||||
public void testMethodScope5() { doTest(); }
|
||||
public void testElseAfterSemicolon() { doTest(1, "else"); }
|
||||
public void testElseAfterRBrace() { doTest(false); }
|
||||
public void testExtraBracketAfterFinally1() throws Exception { doTest(false); }
|
||||
public void testExtraBracketAfterFinally2() throws Exception { doTest(false); }
|
||||
public void testExtendsInCastTypeParameters() throws Exception { doTest(false); }
|
||||
public void testExtendsInCastTypeParameters2() throws Exception { doTest(2, "extends", "super"); }
|
||||
public void testExtendsWithRightContextInClassTypeParameters() throws Exception { doTest(false); }
|
||||
public void testTrueInVariableDeclaration() throws Exception { doTest(false); }
|
||||
public void testNullInIf() throws Exception { doTest(false); }
|
||||
public void testNullInReturn() throws Exception { doTest(false); }
|
||||
public void testExtendsInMethodParameters() throws Exception { doTest(false); }
|
||||
public void testInstanceOf1() throws Exception { doTest(false); }
|
||||
public void testInstanceOf2() throws Exception { doTest(false); }
|
||||
public void testInstanceOf3() throws Exception { doTest(false); }
|
||||
public void testCatchFinally() throws Exception { doTest(2, "catch", "finally"); }
|
||||
public void testSecondCatch() throws Exception { doTest(2, "catch", "finally"); }
|
||||
public void testSuper1() throws Exception { doTest(1, "super"); }
|
||||
public void testSuper2() throws Exception { doTest(0, "super"); }
|
||||
public void testSuper3() throws Exception { doTest(false); }
|
||||
public void testSuper4() throws Exception { doTest(0, "class"); }
|
||||
public void testContinue() throws Exception { doTest(false); }
|
||||
public void testThrowsOnSeparateLine() throws Exception { doTest(false); }
|
||||
public void testDefaultInAnno() throws Exception { doTest(false); }
|
||||
public void testNullInMethodCall() throws Exception { doTest(false); }
|
||||
public void testNullInMethodCall2() throws Exception { doTest(false); }
|
||||
public void testNewInMethodRefs() throws Exception { doTest(1, "new", "null", "true", "false"); }
|
||||
public void testSpaceAfterInstanceof() throws Exception { doTest(false); }
|
||||
public void testInstanceofAfterUnresolved() throws Exception { doTest(1, "instanceof"); }
|
||||
public void testInstanceofAfterStatementStart() throws Exception { doTest(1, "instanceof"); }
|
||||
|
||||
public void testElseAfterRBrace() { doTest(); }
|
||||
public void testExtraBracketAfterFinally1() { doTest(); }
|
||||
public void testExtraBracketAfterFinally2() { doTest(); }
|
||||
public void testExtendsInCastTypeParameters() { doTest(); }
|
||||
public void testExtendsInCastTypeParameters2() { doTest(2, "extends", "super"); }
|
||||
public void testExtendsWithRightContextInClassTypeParameters() { doTest(); }
|
||||
public void testTrueInVariableDeclaration() { doTest(); }
|
||||
public void testNullInIf() { doTest(); }
|
||||
public void testNullInReturn() { doTest(); }
|
||||
public void testExtendsInMethodParameters() { doTest(); }
|
||||
public void testInstanceOf1() { doTest(); }
|
||||
public void testInstanceOf2() { doTest(); }
|
||||
public void testInstanceOf3() { doTest(); }
|
||||
public void testCatchFinally() { doTest(2, "catch", "finally"); }
|
||||
public void testSecondCatch() { doTest(2, "catch", "finally"); }
|
||||
public void testSuper1() { doTest(1, "super"); }
|
||||
public void testSuper2() { doTest(0, "super"); }
|
||||
public void testSuper3() { doTest(); }
|
||||
public void testSuper4() { doTest(0, "class"); }
|
||||
public void testContinue() { doTest(); }
|
||||
public void testThrowsOnSeparateLine() { doTest(); }
|
||||
public void testDefaultInAnno() { doTest(); }
|
||||
public void testNullInMethodCall() { doTest(); }
|
||||
public void testNullInMethodCall2() { doTest(); }
|
||||
public void testNewInMethodRefs() { doTest(1, "new", "null", "true", "false"); }
|
||||
public void testSpaceAfterInstanceof() { doTest(); }
|
||||
public void testInstanceofAfterUnresolved() { doTest(1, "instanceof"); }
|
||||
public void testInstanceofAfterStatementStart() { doTest(1, "instanceof"); }
|
||||
|
||||
public void testInstanceofNegation() {
|
||||
configureByFile(BASE_PATH + "/" + getTestName(true) + ".java");
|
||||
configureByFile(BASE_PATH + getTestName(true) + ".java");
|
||||
selectItem(myItems[0], '!');
|
||||
checkResultByFile(BASE_PATH + "/" + getTestName(true) + "_after.java");
|
||||
checkResultByFile(BASE_PATH + getTestName(true) + "_after.java");
|
||||
}
|
||||
|
||||
public void testNoPrimitivesInBooleanAnnotationAttribute() { doTest(1, "true", "int", "boolean"); }
|
||||
@@ -121,56 +120,53 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
|
||||
public void testPrimitivesInClassAnnotationValueAttribute() { doTest(2, "true", "int", "boolean"); }
|
||||
public void testPrimitivesInClassAnnotationAttribute() { doTest(3, "true", "int", "boolean"); }
|
||||
|
||||
public void testImportStatic() throws Exception { doTest(1, "static"); }
|
||||
public void testAbstractInInterface() throws Exception { doTest(1, "abstract"); }
|
||||
public void testCharInAnnotatedParameter() throws Exception { doTest(1, "char"); }
|
||||
public void testReturnInTernary() throws Exception { doTest(1, "return"); }
|
||||
public void testFinalAfterParameterAnno() throws Exception { doTest(2, "final", "float", "class"); }
|
||||
public void testFinalAfterParameterAnno2() throws Exception { doTest(2, "final", "float", "class"); }
|
||||
public void testImportStatic() { doTest(1, "static"); }
|
||||
public void testAbstractInInterface() { doTest(1, "abstract"); }
|
||||
public void testCharInAnnotatedParameter() { doTest(1, "char"); }
|
||||
public void testReturnInTernary() { doTest(1, "return"); }
|
||||
public void testFinalAfterParameterAnno() { doTest(2, "final", "float", "class"); }
|
||||
public void testFinalAfterParameterAnno2() { doTest(2, "final", "float", "class"); }
|
||||
public void testFinalAfterCase() { doTest(3, "final", "float", "class"); }
|
||||
public void testNoCaseInsideWhileInSwitch() { doTest(0, "case", "default"); }
|
||||
public void testFinalInCatch() { doTest(1, "final"); }
|
||||
public void testFinalInIncompleteCatch() { doTest(1, "final"); }
|
||||
public void testFinalInTryWithResources() throws Exception { doTest(1, "final", "float", "class"); }
|
||||
public void testNoFinalAfterTryBody() throws Exception { doTest(1, "final", "finally"); }
|
||||
public void testClassInMethod() throws Exception { doTest(2, "class", "char"); }
|
||||
public void testIntInClassArray() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
public void testIntInClassArray2() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
public void testIntInClassArray3() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
public void testArrayClass() throws Throwable { doTest(1, "class", "interface"); }
|
||||
public void testIntInGenerics() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
public void testIntInGenerics2() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
public void testFinalInTryWithResources() { doTest(1, "final", "float", "class"); }
|
||||
public void testNoFinalAfterTryBody() { doTest(1, "final", "finally"); }
|
||||
public void testClassInMethod() { doTest(2, "class", "char"); }
|
||||
public void testIntInClassArray() { doTest(2, "int", "char", "final"); }
|
||||
public void testIntInClassArray2() { doTest(2, "int", "char", "final"); }
|
||||
public void testIntInClassArray3() { doTest(2, "int", "char", "final"); }
|
||||
public void testArrayClass() { doTest(1, "class", "interface"); }
|
||||
public void testIntInGenerics() { doTest(2, "int", "char", "final"); }
|
||||
public void testIntInGenerics2() { doTest(2, "int", "char", "final"); }
|
||||
public void testBreakInLabeledBlock() { doTest(1, "break label", "continue"); }
|
||||
|
||||
public void testPrivateInJava9Interface() throws Exception {
|
||||
public void testPrivateInJava9Interface() {
|
||||
LanguageLevelProjectExtension levelProjectExtension = LanguageLevelProjectExtension.getInstance(getProject());
|
||||
LanguageLevel oldLevel = levelProjectExtension.getLanguageLevel();
|
||||
try {
|
||||
levelProjectExtension.setLanguageLevel(LanguageLevel.JDK_1_9);
|
||||
doTest(false);
|
||||
doTest();
|
||||
}
|
||||
finally {
|
||||
levelProjectExtension.setLanguageLevel(oldLevel);
|
||||
}
|
||||
}
|
||||
|
||||
public void testTryInExpression() throws Exception {
|
||||
configureByFile(BASE_PATH + "/" + getTestName(true) + ".java");
|
||||
public void testTryInExpression() {
|
||||
configureByFile(BASE_PATH + getTestName(true) + ".java");
|
||||
assertEquals("toString", myItems[0].getLookupString());
|
||||
assertEquals("this", myItems[1].getLookupString());
|
||||
}
|
||||
|
||||
private void doTest(boolean select) {
|
||||
configureByFile(BASE_PATH + "/" + getTestName(true) + ".java");
|
||||
if (select) {
|
||||
selectItem(myItems[0]);
|
||||
}
|
||||
checkResultByFile(BASE_PATH + "/" + getTestName(true) + "_after.java");
|
||||
private void doTest() {
|
||||
configureByFile(BASE_PATH + getTestName(true) + ".java");
|
||||
checkResultByFile(BASE_PATH + getTestName(true) + "_after.java");
|
||||
}
|
||||
|
||||
// todo: check included/excluded variants separately
|
||||
protected void doTest(int finalCount, @NonNls String... values) {
|
||||
configureByFile(BASE_PATH + "/" + getTestName(true) + ".java");
|
||||
protected void doTest(int finalCount, String... values) {
|
||||
configureByFile(BASE_PATH + getTestName(true) + ".java");
|
||||
testByCount(finalCount, values);
|
||||
}
|
||||
}
|
||||
+13
-41
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -16,48 +16,20 @@
|
||||
package com.intellij.codeInsight.daemon.lambda;
|
||||
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class ExceptionVariablesInferenceTest extends LightDaemonAnalyzerTestCase {
|
||||
@NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/exceptions";
|
||||
private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/exceptions/";
|
||||
|
||||
public void testUnboundExceptions() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
public void testUnboundExceptions() { doTest(); }
|
||||
public void testNotThrownLambdaBodyReferencedMethod() { doTest(); }
|
||||
public void testNotThrownLambdaBodyReferencedMethodContradictBounds() { doTest(); }
|
||||
public void testLambdaParamExceptionVariable() { doTest(); }
|
||||
public void testIDEA116441() { doTest(); }
|
||||
public void testLambdaBodyUncaughtExceptionsForOuterCallInference() { doTest(); }
|
||||
public void testMethodRefUncaughtExceptionsForOuterCallInference() { doTest(); }
|
||||
public void testExceptionsThrownByCallArguments() { doTest(); }
|
||||
|
||||
public void testNotThrownLambdaBodyReferencedMethod() throws Exception {
|
||||
doTest();
|
||||
private void doTest() {
|
||||
doTest(BASE_PATH + getTestName(false) + ".java", false, false);
|
||||
}
|
||||
|
||||
public void testNotThrownLambdaBodyReferencedMethodContradictBounds() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testLambdaParamExceptionVariable() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA116441() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testLambdaBodyUncaughtExceptionsForOuterCallInference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMethodRefUncaughtExceptionsForOuterCallInference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testExceptionsThrownByCallArguments() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
private void doTest(final boolean checkWarnings) throws Exception {
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
+121
-450
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -22,432 +22,129 @@ import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
@NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/graphInference";
|
||||
|
||||
public void testNestedCalls() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNestedCallsSameMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChainedInference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChainedInference1() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReturnStmt() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferenceFromSiblings() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChainedInferenceTypeParamsOrderIndependent() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCyclicParamsDependency() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferenceForFirstArg() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testConditionalExpressionsInference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferenceFromTypeParamsBounds() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferenceFromNotEqualTypeParamsBounds() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSOEDuringInferenceFromParamBounds() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDiamondsUsedToDetectArgumentType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferFromTypeArgs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDefaultConstructorAsArgument() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAfterAbstractPipeline() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCapturedReturnTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testClsCapturedReturnTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testOverloadChooserOfReturnType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA98866() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncompleteSubstitution() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testJDK8028774() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testErasedByReturnConstraint() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA104429() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTargetTypeByOverloadedMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTargetTypeByOverloadedMethod2() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testGrandParentTypeParams() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeepCallsChain() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testArrayPassedToVarargsMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA121055() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTargetTypeByAnonymousClass() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testStaticInheritorsAmbiguity() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNestedCalls1() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMostSpecificVarargsCase() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testLiftedCaptureToOuterCall() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSiteSubstitutionForReturnConstraint() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSiteSubstitutionInExpressionConstraints() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncorporationWithEqualsBoundsSubstitution() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testOuterCallConflictResolution() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testVarargsOnNonPertinentPlace() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawTypeFromParent() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawTypeFromParentArrayType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferFromConditionalExpressionCondition() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPrimitiveWrapperConditionInReturnConstraint() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA128174() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA128101() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testOuterCallOverloads() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA127928() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
public void testIDEA128766() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSameMethodNestedChainedCallsNearFunctionInterfaces() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInfiniteTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA126163() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncompatibleBoundsFromAssignment() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFreshVariablesCreatedDuringResolveDependingOnAlreadyResolvedVariables() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCallToGenericMethodsOfNonGenericClassInsideRawInheritor() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA130549() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA130547() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUncheckedConversionWithRecursiveTypeParams() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA132725() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA134277() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSameMethodCalledWithDifferentArgsResultingInDependenciesBetweenSameTypeParams() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNestedMethodCallsWithVarargs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDisjunctionTypeEquality() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNestedConditionalExpressions() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testOuterMethodCallOnRawType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA143390() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIntersectionWithArray() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncorporationWithCaptureCalcGlbToGetOneTypeParameterBound() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEnumConstantInference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReturnConstraintsWithCaptureIncorporationOfFreshVariables() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testArrayTypeAssignability() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAcceptFirstPairOfCommonSupertypesDuringUpUpIncorporation() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDiamondWithExactMethodReferenceInside() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRecursiveCallsWithNestedInference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncorporationWithRawSubstitutors() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncorporationOfBoundsAsTypeArguments() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEliminateIntersectionTypeWildcardElimination() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDoNotIgnoreConflictingUpperBounds() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCapturedWildcardWithArrayTypeBound() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPolyConditionalExpressionWithTargetPrimitive() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCaptureConstraint() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPullUncheckedWarningNotionThroughNestedCalls() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA149774() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDisjunctionTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPushErasedStateToArguments() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testStopAtStandaloneConditional() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTransitiveInferenceVariableDependencies() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferenceVariablesErasure() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUncheckedWarningConvertingToInferenceVariable() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUncheckedWarningDuringStrictSubtyping() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA150688() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testGlbValidityWithCapturedWildcards() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCapturedVariablesAcceptance() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPullingErrorMessagesFromSubExpressionsToTheTopLevel() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testHighlightArgumentWithProblem() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA153632() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPartialRawSubstitutionToAvoidInferringObjectsWhenRawExpected() throws Exception {
|
||||
final UncheckedWarningLocalInspection localInspection = new UncheckedWarningLocalInspection();
|
||||
enableInspectionTool(localInspection);
|
||||
private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/graphInference/";
|
||||
|
||||
public void testNestedCalls() { doTest(); }
|
||||
public void testNestedCallsSameMethod() { doTest(); }
|
||||
public void testChainedInference() { doTest(); }
|
||||
public void testChainedInference1() { doTest(); }
|
||||
public void testReturnStmt() { doTest(); }
|
||||
public void testInferenceFromSiblings() { doTest(); }
|
||||
public void testChainedInferenceTypeParamsOrderIndependent() { doTest(); }
|
||||
public void testCyclicParamsDependency() { doTest(); }
|
||||
public void testInferenceForFirstArg() { doTest(); }
|
||||
public void testConditionalExpressionsInference() { doTest(); }
|
||||
public void testInferenceFromTypeParamsBounds() { doTest(); }
|
||||
public void testInferenceFromNotEqualTypeParamsBounds() { doTest(); }
|
||||
public void testSOEDuringInferenceFromParamBounds() { doTest(); }
|
||||
public void testDiamondsUsedToDetectArgumentType() { doTest(); }
|
||||
public void testInferFromTypeArgs() { doTest(); }
|
||||
public void testDefaultConstructorAsArgument() { doTest(); }
|
||||
public void testAfterAbstractPipeline() { doTest(); }
|
||||
public void testCapturedReturnTypes() { doTest(); }
|
||||
public void testClsCapturedReturnTypes() { doTest(); }
|
||||
public void testOverloadChooserOfReturnType() { doTest(); }
|
||||
public void testIDEA98866() { doTest(); }
|
||||
public void testIncompleteSubstitution() { doTest(); }
|
||||
public void testJDK8028774() { doTest(); }
|
||||
public void testErasedByReturnConstraint() { doTest(); }
|
||||
public void testIDEA104429() { doTest(); }
|
||||
public void testTargetTypeByOverloadedMethod() { doTest(); }
|
||||
public void testTargetTypeByOverloadedMethod2() { doTest(); }
|
||||
public void testGrandParentTypeParams() { doTest(); }
|
||||
public void testDeepCallsChain() { doTest(); }
|
||||
public void testArrayPassedToVarargsMethod() { doTest(); }
|
||||
public void testIDEA121055() { doTest(); }
|
||||
public void testTargetTypeByAnonymousClass() { doTest(); }
|
||||
public void testStaticInheritorsAmbiguity() { doTest(); }
|
||||
public void testNestedCalls1() { doTest(); }
|
||||
public void testMostSpecificVarargsCase() { doTest(); }
|
||||
public void testLiftedCaptureToOuterCall() { doTest(); }
|
||||
public void testSiteSubstitutionForReturnConstraint() { doTest(); }
|
||||
public void testSiteSubstitutionInExpressionConstraints() { doTest(); }
|
||||
public void testIncorporationWithEqualsBoundsSubstitution() { doTest(); }
|
||||
public void testOuterCallConflictResolution() { doTest(); }
|
||||
public void testVarargsOnNonPertinentPlace() { doTest(); }
|
||||
public void testRawTypeFromParent() { doTest(); }
|
||||
public void testRawTypeFromParentArrayType() { doTest(); }
|
||||
public void testInferFromConditionalExpressionCondition() { doTest(); }
|
||||
public void testPrimitiveWrapperConditionInReturnConstraint() { doTest(); }
|
||||
public void testIDEA128174() { doTest(); }
|
||||
public void testIDEA128101() { doTest(); }
|
||||
public void testOuterCallOverloads() { doTest(); }
|
||||
public void testIDEA127928() { doTest(); }
|
||||
public void testIDEA128766() { doTest(); }
|
||||
public void testSameMethodNestedChainedCallsNearFunctionInterfaces() { doTest(); }
|
||||
public void testInfiniteTypes() { doTest(); }
|
||||
public void testIDEA126163() { doTest(); }
|
||||
public void testIncompatibleBoundsFromAssignment() { doTest(); }
|
||||
public void testFreshVariablesCreatedDuringResolveDependingOnAlreadyResolvedVariables() { doTest(); }
|
||||
public void testCallToGenericMethodsOfNonGenericClassInsideRawInheritor() { doTest(); }
|
||||
public void testIDEA130549() { doTest(); }
|
||||
public void testIDEA130547() { doTest(); }
|
||||
public void testUncheckedConversionWithRecursiveTypeParams() { doTest(); }
|
||||
public void testIDEA132725() { doTest(); }
|
||||
public void testIDEA134277() { doTest(); }
|
||||
public void testSameMethodCalledWithDifferentArgsResultingInDependenciesBetweenSameTypeParams() { doTest(); }
|
||||
public void testNestedMethodCallsWithVarargs() { doTest(); }
|
||||
public void testDisjunctionTypeEquality() { doTest(); }
|
||||
public void testNestedConditionalExpressions() { doTest(); }
|
||||
public void testOuterMethodCallOnRawType() { doTest(); }
|
||||
public void testIDEA143390() { doTest(); }
|
||||
public void testIntersectionWithArray() { doTest(); }
|
||||
public void testIncorporationWithCaptureCalcGlbToGetOneTypeParameterBound() { doTest(); }
|
||||
public void testEnumConstantInference() { doTest(); }
|
||||
public void testReturnConstraintsWithCaptureIncorporationOfFreshVariables() { doTest(); }
|
||||
public void testArrayTypeAssignability() { doTest(); }
|
||||
public void testAcceptFirstPairOfCommonSupertypesDuringUpUpIncorporation() { doTest(); }
|
||||
public void testDiamondWithExactMethodReferenceInside() { doTest(); }
|
||||
public void testRecursiveCallsWithNestedInference() { doTest(); }
|
||||
public void testIncorporationWithRawSubstitutors() { doTest(); }
|
||||
public void testIncorporationOfBoundsAsTypeArguments() { doTest(); }
|
||||
public void testEliminateIntersectionTypeWildcardElimination() { doTest(); }
|
||||
public void testDoNotIgnoreConflictingUpperBounds() { doTest(); }
|
||||
public void testCapturedWildcardWithArrayTypeBound() { doTest(); }
|
||||
public void testPolyConditionalExpressionWithTargetPrimitive() { doTest(); }
|
||||
public void testCaptureConstraint() { doTest(); }
|
||||
public void testPullUncheckedWarningNotionThroughNestedCalls() { doTest(); }
|
||||
public void testIDEA149774() { doTest(); }
|
||||
public void testDisjunctionTypes() { doTest(); }
|
||||
public void testPushErasedStateToArguments() { doTest(); }
|
||||
public void testStopAtStandaloneConditional() { doTest(); }
|
||||
public void testTransitiveInferenceVariableDependencies() { doTest(); }
|
||||
public void testInferenceVariablesErasure() { doTest(); }
|
||||
public void testUncheckedWarningConvertingToInferenceVariable() { doTest(); }
|
||||
public void testUncheckedWarningDuringStrictSubtyping() { doTest(); }
|
||||
public void testIDEA150688() { doTest(); }
|
||||
public void testGlbValidityWithCapturedWildcards() { doTest(); }
|
||||
public void testCapturedVariablesAcceptance() { doTest(); }
|
||||
public void testPullingErrorMessagesFromSubExpressionsToTheTopLevel() { doTest(); }
|
||||
public void testHighlightArgumentWithProblem() { doTest(); }
|
||||
public void testIDEA153632() { doTest(); }
|
||||
|
||||
public void testPartialRawSubstitutionToAvoidInferringObjectsWhenRawExpected() {
|
||||
enableInspectionTool(new UncheckedWarningLocalInspection());
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testIDEA154278() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPrimitiveTypeInReturnConstraintWithUncheckedConversion() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPolyMethodCallOnLeftSideOfAssignment() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTreatConditionalExpressionAsPolyIfNewExpressionWithDiamondsIsUsed() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
public void testIDEA154278() { doTest(); }
|
||||
public void testPrimitiveTypeInReturnConstraintWithUncheckedConversion() { doTest(); }
|
||||
public void testPolyMethodCallOnLeftSideOfAssignment() { doTest(); }
|
||||
public void testTreatConditionalExpressionAsPolyIfNewExpressionWithDiamondsIsUsed() { doTest(); }
|
||||
|
||||
public void testVariableNamesOfNestedCalls() throws Exception {
|
||||
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
|
||||
String filePath = BASE_PATH + "/" + getTestName(false) + ".java";
|
||||
String filePath = BASE_PATH + getTestName(false) + ".java";
|
||||
configureByFile(filePath);
|
||||
Collection<HighlightInfo> infos = doHighlighting();
|
||||
|
||||
List<String> tooltips = new ArrayList<>();
|
||||
|
||||
for (HighlightInfo info : infos) {
|
||||
if (info.getSeverity() == HighlightSeverity.ERROR) {
|
||||
tooltips.add(info.getToolTip());
|
||||
@@ -467,48 +164,22 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
}
|
||||
}
|
||||
|
||||
public void testCreateFreshVariablesOnlyForWildcardPlacesDuringReturnTypeProcessing() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
public void testCreateFreshVariablesOnlyForWildcardPlacesDuringReturnTypeProcessing() { doTest(); }
|
||||
public void testCapturedConversionDuringDirectSuperCheck() { doTest(); }
|
||||
//public void _testResolutionOrderForVariableCycles() { doTest(); }
|
||||
public void testPostponeUnresolvedVariables() { doTest(); }
|
||||
public void testErasureOfReturnTypeIffUncheckedConversionWasNecessaryDuringApplicabilityCheckOnly() { doTest(); }
|
||||
public void testTwoDifferentParameterizationCheckWithInterfaceTypeArguments() { doTest(); }
|
||||
public void testUncheckedConversionDuringProperTypeExpressionConstraintResolution() { doTest(); }
|
||||
//public void _testAssignabilityOfStandaloneExpressionsDuringApplicabilityCheck() { doTest(); }
|
||||
public void testRecursiveTypeWithCapture() { doTest(); }
|
||||
|
||||
public void testCapturedConversionDuringDirectSuperCheck() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void _testResolutionOrderForVariableCycles() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPostponeUnresolvedVariables() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testErasureOfReturnTypeIffUncheckedConversionWasNecessaryDuringApplicabilityCheckOnly() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTwoDifferentParameterizationCheckWithInterfaceTypeArguments() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUncheckedConversionDuringProperTypeExpressionConstraintResolution() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void _testAssignabilityOfStandaloneExpressionsDuringApplicabilityCheck() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRecursiveTypeWithCapture() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
private void doTest(final boolean checkWarnings) throws Exception {
|
||||
private void doTest(final boolean checkWarnings) {
|
||||
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false);
|
||||
doTest(BASE_PATH + getTestName(false) + ".java", checkWarnings, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
-21
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -17,10 +17,9 @@ package com.intellij.codeInsight.daemon.lambda;
|
||||
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
@NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/highlighting";
|
||||
private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/highlighting/";
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
@@ -30,7 +29,7 @@ public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
|
||||
public void testStaticAccess() { doTest(); }
|
||||
public void testEffectiveFinal() { doTest(); }
|
||||
public void testFieldInitializedUsedInLambda() {doTest();}
|
||||
public void testFieldInitializedUsedInLambda() { doTest(); }
|
||||
public void testReassignUsedVars() { doTest(); }
|
||||
public void testLambdaContext() { doTest(); }
|
||||
public void testReturnTypeCompatibility() { doTest(); }
|
||||
@@ -87,26 +86,26 @@ public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testDeclaredTypeParameterBoundsAndUnboundedWildcard() { doTest(); }
|
||||
public void testConflictResolution() { doTest(); }
|
||||
public void testIDEA108195() { doTest(); }
|
||||
public void testDiamondInference() { doTest();}
|
||||
public void testFunctionalInterfaceCheck() { doTest();}
|
||||
public void testUnderscores() { doTest(true);}
|
||||
public void testReturnTypeAmbiguity() { doTest();}
|
||||
public void testWildcardsAndFormalLambdaParams() {doTest();}
|
||||
public void testFinalInitializer() {doTest();}
|
||||
public void testBreakContinueInside() {doTest();}
|
||||
public void testSameLambdaParamNames() {doTest();}
|
||||
public void testIDEA123308() {doTest();}
|
||||
public void testIntersection() {doTest();}
|
||||
public void testNoBoxingInLambdaFormalParams() {doTest();}
|
||||
public void testGenericNotGenericInterfaceMethod() {doTest();}
|
||||
public void testInferredFromCast() {doTest();}
|
||||
public void testReferencedFromSelf() {doTest();}
|
||||
public void testDiamondInference() { doTest(); }
|
||||
public void testFunctionalInterfaceCheck() { doTest(); }
|
||||
public void testUnderscores() { doTest(true); }
|
||||
public void testReturnTypeAmbiguity() { doTest(); }
|
||||
public void testWildcardsAndFormalLambdaParams() { doTest(); }
|
||||
public void testFinalInitializer() { doTest(); }
|
||||
public void testBreakContinueInside() { doTest(); }
|
||||
public void testSameLambdaParamNames() { doTest(); }
|
||||
public void testIDEA123308() { doTest(); }
|
||||
public void testIntersection() { doTest(); }
|
||||
public void testNoBoxingInLambdaFormalParams() { doTest(); }
|
||||
public void testGenericNotGenericInterfaceMethod() { doTest(); }
|
||||
public void testInferredFromCast() { doTest(); }
|
||||
public void testReferencedFromSelf() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
private void doTest(final boolean checkWarnings) {
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false);
|
||||
private void doTest(boolean checkWarnings) {
|
||||
doTest(BASE_PATH + getTestName(false) + ".java", checkWarnings, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-36
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -19,10 +19,9 @@ import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
@NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/methodRef";
|
||||
private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/methodRef/";
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
@@ -77,37 +76,14 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testVarargsMethodRef() { doTest(); }
|
||||
public void testExprReceiver() { doTest(); }
|
||||
public void testVoidReturnTypeAmbiguity() { doTest(true); }
|
||||
|
||||
public void testTypeParameterWithExtendsList() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA112323() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testExactReferencesToArrayCreation() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUnknownQualifierClass() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testQualifiersInStaticContext() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
public void testInvalidFunctionalTypeInReturnStmt() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA127765() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIntersectionTypesInReceiverPosition() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
public void testTypeParameterWithExtendsList() { doTest(); }
|
||||
public void testIDEA112323() { doTest(); }
|
||||
public void testExactReferencesToArrayCreation() { doTest(); }
|
||||
public void testUnknownQualifierClass() { doTest(); }
|
||||
public void testQualifiersInStaticContext() { doTest(); }
|
||||
public void testInvalidFunctionalTypeInReturnStmt() { doTest(); }
|
||||
public void testIDEA127765() { doTest(); }
|
||||
public void testIntersectionTypesInReceiverPosition() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
@@ -115,6 +91,6 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
|
||||
private void doTest(boolean warnings) {
|
||||
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false);
|
||||
doTest(BASE_PATH + getTestName(false) + ".java", warnings, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
+67
-269
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -19,10 +19,9 @@ import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
@NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/newLambda";
|
||||
private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/newLambda/";
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
@@ -90,274 +89,73 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testNestedLambdaExpressionsNoFormalParams1() { doTest(); }
|
||||
public void testDeepNestedLambdaExpressionsNoFormalParams() { doTest(); }
|
||||
public void testNestedLambdaExpressionsNoFormalParamsStopAtStandalone() { doTest(); }
|
||||
|
||||
public void testNestedLambdaCheckedExceptionsConstraints() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNestedLambdaWithInferenceVariableAsTargetType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA127596() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA124983() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA123951() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA124190() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
public void testIDEA127124comment() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testParenthesizedExpressionsDuringConstrainsCollection() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA126778() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEnsureGroundTypeToGetLambdaParameterType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSameParametrizationCheckTakesTypeParametersIntoAccount() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCheckedExceptionsConstraintsSubstitutions() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCheckedExceptionsConstraintsSubstitutions1() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCheckedExceptionsConstraintsSubstitutions2() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCheckedExceptionsConstraintsSubstitutionsDeepInBody() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA130129() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA130920() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testExpectedReturnTypeInAnonymousInsideLambda() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA131700() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPropertiesInsteadOfSiteSubstitutorIfAny() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA127124() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA123987() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA136759() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInfiniteLoopAndValueCompatibility() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAcceptInferredVariablesBeforeAdditionalConstraintsLeadToFail() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEnsureNoCaptureIsPerformedOverTargetTypeOfCastExpressionWhichMarksFunctionalExpression() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCaptureInReturnStatementOfLambdaExpression() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testControlFlowAnalysisFailedValueCompatibilityUnchanged() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNonAccessibleFunctionalInterfaceTypeArguments() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
//JDK-8043374
|
||||
public void testIntersectionTypeOfDifferentParameterizationOfTheSameClassInNonWildcardParameterization() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPreserveCapturedWildcardsDuringNonWildcardParameterization() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA136401() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA133920() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA132253() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA144840() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRecursiveAtSiteSubstitutorsWithAdditionalConstraints() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA136325() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA127215() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testGroundTargetTypeForExpectedReturnTypeOfLambdaExpression() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA149224() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA149670() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA149709() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testResolveOrderShouldTakeIntoAccountDependenciesOfAlreadyResolvedVars() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCodeBlockLambdaWithIsValueCompatibleChecks() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCodeBlockLambdaWithoutParamsIsValueCompatibleChecks() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferenceFromReturnLambdaStatementWhereContainingMethodNonGeneric() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCLikeArrayDeclarationInLambdaWithExplicitTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAdditionalConstraintsOrderWhenOutputVariablesAlreadyHaveProperEqualBound() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA153284() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAvoidPartlyRawTypesAsTheyWontBeTreatedAsWildcardParameterizedAnyway() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeepChainOfNestedLambdasOverCachedTopLevel() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA153999() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFieldReferencedFromLambdaInitializations() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawSiteSubstitutorWithExpectedGenericsParameterType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPreserveCapturedWildcardAsLambdaParameterType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDontWarnAboutNestedLambdaForAProblemInOuter() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUncheckedPartial() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testVarargMethodWithThrownTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testExceptionInLambdaBodyCheck() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testHighlightFaultyLambdaReturnExpression() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUncheckedConstraintOnInferenceVariableWithProperUpperBound() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCollectLambdaAdditionalConstraintsByGroundType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferTypeParametersFromFunctionalInterfaceInputs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testGroundTargetTypeWhenAbstractMethodInSuperclass() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
public void testNestedLambdaCheckedExceptionsConstraints() { doTest(); }
|
||||
public void testNestedLambdaWithInferenceVariableAsTargetType() { doTest(); }
|
||||
public void testIDEA127596() { doTest(); }
|
||||
public void testIDEA124983() { doTest(); }
|
||||
public void testIDEA123951() { doTest(); }
|
||||
public void testIDEA124190() { doTest(); }
|
||||
public void testIDEA127124comment() { doTest(); }
|
||||
public void testParenthesizedExpressionsDuringConstrainsCollection() { doTest(); }
|
||||
public void testIDEA126778() { doTest(); }
|
||||
public void testEnsureGroundTypeToGetLambdaParameterType() { doTest(); }
|
||||
public void testSameParametrizationCheckTakesTypeParametersIntoAccount() { doTest(); }
|
||||
public void testCheckedExceptionsConstraintsSubstitutions() { doTest(); }
|
||||
public void testCheckedExceptionsConstraintsSubstitutions1() { doTest(); }
|
||||
public void testCheckedExceptionsConstraintsSubstitutions2() { doTest(); }
|
||||
public void testCheckedExceptionsConstraintsSubstitutionsDeepInBody() { doTest(); }
|
||||
public void testIDEA130129() { doTest(); }
|
||||
public void testIDEA130920() { doTest(); }
|
||||
public void testExpectedReturnTypeInAnonymousInsideLambda() { doTest(); }
|
||||
public void testIDEA131700() { doTest(); }
|
||||
public void testPropertiesInsteadOfSiteSubstitutorIfAny() { doTest(); }
|
||||
public void testIDEA127124() { doTest(); }
|
||||
public void testIDEA123987() { doTest(); }
|
||||
public void testIDEA136759() { doTest(); }
|
||||
public void testInfiniteLoopAndValueCompatibility() { doTest(); }
|
||||
public void testAcceptInferredVariablesBeforeAdditionalConstraintsLeadToFail() { doTest(); }
|
||||
public void testEnsureNoCaptureIsPerformedOverTargetTypeOfCastExpressionWhichMarksFunctionalExpression() { doTest(); }
|
||||
public void testCaptureInReturnStatementOfLambdaExpression() { doTest(); }
|
||||
public void testControlFlowAnalysisFailedValueCompatibilityUnchanged() { doTest(); }
|
||||
public void testNonAccessibleFunctionalInterfaceTypeArguments() { doTest(); }
|
||||
public void testIntersectionTypeOfDifferentParameterizationOfTheSameClassInNonWildcardParameterization() { doTest(); /* JDK-8043374 */ }
|
||||
public void testPreserveCapturedWildcardsDuringNonWildcardParameterization() { doTest(); }
|
||||
public void testIDEA136401() { doTest(); }
|
||||
public void testIDEA133920() { doTest(); }
|
||||
public void testIDEA132253() { doTest(); }
|
||||
public void testIDEA144840() { doTest(); }
|
||||
public void testRecursiveAtSiteSubstitutorsWithAdditionalConstraints() { doTest(); }
|
||||
public void testIDEA136325() { doTest(); }
|
||||
public void testIDEA127215() { doTest(); }
|
||||
public void testGroundTargetTypeForExpectedReturnTypeOfLambdaExpression() { doTest(); }
|
||||
public void testIDEA149224() { doTest(); }
|
||||
public void testIDEA149670() { doTest(); }
|
||||
public void testIDEA149709() { doTest(); }
|
||||
public void testResolveOrderShouldTakeIntoAccountDependenciesOfAlreadyResolvedVars() { doTest(); }
|
||||
public void testCodeBlockLambdaWithIsValueCompatibleChecks() { doTest(); }
|
||||
public void testCodeBlockLambdaWithoutParamsIsValueCompatibleChecks() { doTest(); }
|
||||
public void testInferenceFromReturnLambdaStatementWhereContainingMethodNonGeneric() { doTest(); }
|
||||
public void testCLikeArrayDeclarationInLambdaWithExplicitTypes() { doTest(); }
|
||||
public void testAdditionalConstraintsOrderWhenOutputVariablesAlreadyHaveProperEqualBound() { doTest(); }
|
||||
public void testIDEA153284() { doTest(); }
|
||||
public void testAvoidPartlyRawTypesAsTheyWontBeTreatedAsWildcardParameterizedAnyway() { doTest(); }
|
||||
public void testDeepChainOfNestedLambdasOverCachedTopLevel() { doTest(); }
|
||||
public void testIDEA153999() { doTest(); }
|
||||
public void testFieldReferencedFromLambdaInitializations() { doTest(); }
|
||||
public void testRawSiteSubstitutorWithExpectedGenericsParameterType() { doTest(); }
|
||||
public void testPreserveCapturedWildcardAsLambdaParameterType() { doTest(); }
|
||||
public void testDontWarnAboutNestedLambdaForAProblemInOuter() { doTest(); }
|
||||
public void testUncheckedPartial() { doTest(); }
|
||||
public void testVarargMethodWithThrownTypes() { doTest(); }
|
||||
public void testExceptionInLambdaBodyCheck() { doTest(); }
|
||||
public void testHighlightFaultyLambdaReturnExpression() { doTest(); }
|
||||
public void testUncheckedConstraintOnInferenceVariableWithProperUpperBound() { doTest(); }
|
||||
public void testCollectLambdaAdditionalConstraintsByGroundType() { doTest(); }
|
||||
public void testInferTypeParametersFromFunctionalInterfaceInputs() { doTest(); }
|
||||
public void testGroundTargetTypeWhenAbstractMethodInSuperclass() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false);
|
||||
doTest(BASE_PATH + getTestName(false) + ".java", false, false);
|
||||
}
|
||||
|
||||
/*
|
||||
public static Test suite() {
|
||||
final TestSuite suite = new TestSuite();
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
suite.addTestSuite(NewLambdaHighlightingTest.class);
|
||||
}
|
||||
return suite;
|
||||
}*/
|
||||
}
|
||||
+132
-512
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -21,11 +21,10 @@ import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
|
||||
import com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
@NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef";
|
||||
private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/";
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
@@ -41,513 +40,134 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
};
|
||||
}
|
||||
|
||||
public void testIDEA93587() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testIDEA106522() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA112574() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA113558() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testAfterDistinctOps() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testUncheckedWarningWithRawSecondSearchAndMethodFromSuper() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testWildcardReturns() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testInexactMethodReferencePrimitiveBound() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testAfterCollectors1() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testAfterCollectors2() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testIDEA116359() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testAfterSliceOps() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testAssertNumberOfParameters() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testGenericArrayCreation() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testWildcardsInClassTypeQualifier() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawConstructorReferenceWithTypeParams() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCheckReturnTypeForExactRefs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPotentialApplicability() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testLiftMethodReferenceTypeParams() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testHighlightReferenceWhenContradictBoundsAreInferred() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAfterBounds() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncludeContainingClassParamsInResolveSetForConstructorRefs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testContainingClassTypeParamsForBounds() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCapturingReturnValue() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA117311() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeepWildcardEliminating() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void _testLambdaExercise() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA118437() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA113297() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA120376() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA120370() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testExcludeContainingClassTypeParamsFromInference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEnsureTypeParametersAreNotModifiedDuringGroundTypeEvaluation() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncorrectArrayCreationSignature() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawTargetType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReturnTypeCheckForRawReceiver() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testStaticNonStaticReferenceTypeAmbiguity() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSuperClassPotentiallyApplicableMembers() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testExactMethodReferencePertinentToApplicabilityCheck() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAmbiguityVarargs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawInnerClassQualifier() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA122100() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA122509() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA122681() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA112191() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA122018comment() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA123223() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA123248() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA123366() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA123366comment() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFromReferenceWithTypeArgs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRefOnStaticInterfaceMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUncheckedMethodReference() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testIDEA124148() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA124613() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCollectingApplicabilityConstraints() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA126062() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRejectReceiverTypesForConstructorRefs() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEnumValuesMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMissedApplicableMemberContainingClassSubstitution() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA126969() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA127506() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA127275() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA127275_() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUnresolvedMethodReference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA128534() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA128712() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAdditionalConstraints3Level() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testWildcardParametrization() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReceiverTypeSubstitution() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTypeParametersInitOrder() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA132560() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEnsureThatCapturedWildcardsAreNotOpenWithoutAnyReason() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testVarargsParametersCountComparison() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testPotentialCompatibilityWithInvalidShape() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testSiteSubstitutionOfNonReceiverReference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawReferenceTypeWithReceiver() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMethodReferenceTypeArgumentsApplicability() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTypeNameInterfaceSuperMethodReferenceApplicability() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNewParameterizedReferenceOnRawType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testArrayTypeNewReifiable() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReturnTypeApplocabilityIfCapturedWildcardInferred() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA133935() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA132379() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA136581() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSuperSubstitutorInNormalCase() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testSecondSearchIfFirstParameterIsASubtypeOfReferenceTypeFromExpressionDeclaration() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEnsureNotResolvedMethodRefsAreNotMarkedAsExact() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReceiverSubstitutorForExactReferenceInMethodReferenceConstraint() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSkipCheckedExceptionsHandledByInterfaceMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testConstraintsFromNonRawReceiverType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSubstitutionForReturnTypeConstraintsForTargetGenericMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA140586() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUnhandledExceptionsInQualifier() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawClassTypeOnConstructorReference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncompleteCodeWithMethodReferenceOverLambdaParameter() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncompleteMethodReferenceWithUncheckedWarningInspection() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCapturedReturnTypeOfMethodReference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEnumConstantsAsContext() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA138752() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA136708() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testContainingClassTypeParametersShouldNotBeInferredDuringMethodReferenceProcessing() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA147511() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRawInferredTypeCheck() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA147873() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA148553() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA148093() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA148841() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCapturedTypesOfImplicitParameterTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testApplicabilityConflictMessage() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testQualifierOfCapturedWildcardType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCapturedWildcardInReceiverPosition() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testGetClassReturnTypeInMethodReference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCaptureTypeOfNewArrayExpression() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA152659() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFreshVariableLowerBoundsDuringSuptypeChecks() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTypeParameterInstantiation() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIgnoreForeignVariables() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChainedCallsWithMethodReferenceInside() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testApplicabilityErrorVisibleWhenConstraintsFromFunctionalExpressionsProvideValidSubstitutor() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMethodReferenceSecondSearchDontInfluenceTopSiteSubstitutor() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCheckReturnTypeOfMethodReferenceWhenTheRestIsGood() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEnsureResolveToClassInConstructorRefs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReturnTypeCompatibilityConstraintForSecondSearchCase() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMethodInInheritorFoundBySecondSearch() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNonExactMethodReferenceOnRawClassType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMethodREfToContainingMethodWithGenericParam() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
public void testIDEA93587() { doTest(true); }
|
||||
|
||||
public void testIDEA106522() { doTest(); }
|
||||
public void testIDEA112574() { doTest(); }
|
||||
public void testIDEA113558() { doTest(true); }
|
||||
public void testAfterDistinctOps() { doTest(true); }
|
||||
public void testUncheckedWarningWithRawSecondSearchAndMethodFromSuper() { doTest(true); }
|
||||
public void testWildcardReturns() { doTest(false); }
|
||||
public void testInexactMethodReferencePrimitiveBound() { doTest(false); }
|
||||
public void testAfterCollectors1() { doTest(false); }
|
||||
public void testAfterCollectors2() { doTest(false); }
|
||||
public void testIDEA116359() { doTest(false); }
|
||||
public void testAfterSliceOps() { doTest(false); }
|
||||
public void testAssertNumberOfParameters() { doTest(false); }
|
||||
public void testGenericArrayCreation() { doTest(true); }
|
||||
public void testWildcardsInClassTypeQualifier() { doTest(); }
|
||||
public void testRawConstructorReferenceWithTypeParams() { doTest(); }
|
||||
public void testCheckReturnTypeForExactRefs() { doTest(); }
|
||||
public void testPotentialApplicability() { doTest(); }
|
||||
public void testLiftMethodReferenceTypeParams() { doTest(); }
|
||||
public void testHighlightReferenceWhenContradictBoundsAreInferred() { doTest(); }
|
||||
public void testAfterBounds() { doTest(); }
|
||||
public void testIncludeContainingClassParamsInResolveSetForConstructorRefs() { doTest(); }
|
||||
public void testContainingClassTypeParamsForBounds() { doTest(); }
|
||||
public void testCapturingReturnValue() { doTest(); }
|
||||
public void testIDEA117311() { doTest(); }
|
||||
public void testDeepWildcardEliminating() { doTest(); }
|
||||
//public void testLambdaExercise() { doTest(); }
|
||||
public void testIDEA118437() { doTest(); }
|
||||
public void testIDEA113297() { doTest(); }
|
||||
public void testIDEA120376() { doTest(); }
|
||||
public void testIDEA120370() { doTest(); }
|
||||
public void testExcludeContainingClassTypeParamsFromInference() { doTest(); }
|
||||
public void testEnsureTypeParametersAreNotModifiedDuringGroundTypeEvaluation() { doTest(); }
|
||||
public void testIncorrectArrayCreationSignature() { doTest(); }
|
||||
public void testRawTargetType() { doTest(); }
|
||||
public void testReturnTypeCheckForRawReceiver() { doTest(); }
|
||||
public void testStaticNonStaticReferenceTypeAmbiguity() { doTest(); }
|
||||
public void testSuperClassPotentiallyApplicableMembers() { doTest(); }
|
||||
public void testExactMethodReferencePertinentToApplicabilityCheck() { doTest(); }
|
||||
public void testAmbiguityVarargs() { doTest(); }
|
||||
public void testRawInnerClassQualifier() { doTest(); }
|
||||
public void testIDEA122100() { doTest(); }
|
||||
public void testIDEA122509() { doTest(); }
|
||||
public void testIDEA122681() { doTest(); }
|
||||
public void testIDEA112191() { doTest(); }
|
||||
public void testIDEA122018comment() { doTest(); }
|
||||
public void testIDEA123223() { doTest(); }
|
||||
public void testIDEA123248() { doTest(); }
|
||||
public void testIDEA123366() { doTest(); }
|
||||
public void testIDEA123366comment() { doTest(); }
|
||||
public void testFromReferenceWithTypeArgs() { doTest(); }
|
||||
public void testRefOnStaticInterfaceMethod() { doTest(); }
|
||||
public void testUncheckedMethodReference() { doTest(true); }
|
||||
public void testIDEA124148() { doTest(); }
|
||||
public void testIDEA124613() { doTest(); }
|
||||
public void testCollectingApplicabilityConstraints() { doTest(); }
|
||||
public void testIDEA126062() { doTest(); }
|
||||
public void testRejectReceiverTypesForConstructorRefs() { doTest(); }
|
||||
public void testEnumValuesMethod() { doTest(); }
|
||||
public void testMissedApplicableMemberContainingClassSubstitution() { doTest(); }
|
||||
public void testIDEA126969() { doTest(); }
|
||||
public void testIDEA127506() { doTest(); }
|
||||
public void testIDEA127275() { doTest(); }
|
||||
public void testIDEA127275_() { doTest(); }
|
||||
public void testUnresolvedMethodReference() { doTest(); }
|
||||
public void testIDEA128534() { doTest(); }
|
||||
public void testIDEA128712() { doTest(); }
|
||||
public void testAdditionalConstraints3Level() { doTest(); }
|
||||
public void testWildcardParametrization() { doTest(); }
|
||||
public void testReceiverTypeSubstitution() { doTest(); }
|
||||
public void testTypeParametersInitOrder() { doTest(); }
|
||||
public void testIDEA132560() { doTest(); }
|
||||
public void testEnsureThatCapturedWildcardsAreNotOpenWithoutAnyReason() { doTest(); }
|
||||
public void testVarargsParametersCountComparison() { doTest(true); }
|
||||
public void testPotentialCompatibilityWithInvalidShape() { doTest(true); }
|
||||
public void testSiteSubstitutionOfNonReceiverReference() { doTest(); }
|
||||
public void testRawReferenceTypeWithReceiver() { doTest(); }
|
||||
public void testMethodReferenceTypeArgumentsApplicability() { doTest(); }
|
||||
public void testTypeNameInterfaceSuperMethodReferenceApplicability() { doTest(); }
|
||||
public void testNewParameterizedReferenceOnRawType() { doTest(); }
|
||||
public void testArrayTypeNewReifiable() { doTest(); }
|
||||
public void testReturnTypeApplicabilityIfCapturedWildcardInferred() { doTest(); }
|
||||
public void testIDEA133935() { doTest(); }
|
||||
public void testIDEA132379() { doTest(); }
|
||||
public void testIDEA136581() { doTest(); }
|
||||
public void testSuperSubstitutorInNormalCase() { doTest(false); }
|
||||
public void testSecondSearchIfFirstParameterIsASubtypeOfReferenceTypeFromExpressionDeclaration() { doTest(); }
|
||||
public void testEnsureNotResolvedMethodRefsAreNotMarkedAsExact() { doTest(); }
|
||||
public void testReceiverSubstitutorForExactReferenceInMethodReferenceConstraint() { doTest(); }
|
||||
public void testSkipCheckedExceptionsHandledByInterfaceMethod() { doTest(); }
|
||||
public void testConstraintsFromNonRawReceiverType() { doTest(); }
|
||||
public void testSubstitutionForReturnTypeConstraintsForTargetGenericMethod() { doTest(); }
|
||||
public void testIDEA140586() { doTest(); }
|
||||
public void testUnhandledExceptionsInQualifier() { doTest(); }
|
||||
public void testRawClassTypeOnConstructorReference() { doTest(); }
|
||||
public void testIncompleteCodeWithMethodReferenceOverLambdaParameter() { doTest(); }
|
||||
public void testIncompleteMethodReferenceWithUncheckedWarningInspection() { doTest(); }
|
||||
public void testCapturedReturnTypeOfMethodReference() { doTest(); }
|
||||
public void testEnumConstantsAsContext() { doTest(); }
|
||||
public void testIDEA138752() { doTest(); }
|
||||
public void testIDEA136708() { doTest(); }
|
||||
public void testContainingClassTypeParametersShouldNotBeInferredDuringMethodReferenceProcessing() { doTest(); }
|
||||
public void testIDEA147511() { doTest(); }
|
||||
public void testRawInferredTypeCheck() { doTest(); }
|
||||
public void testIDEA147873() { doTest(); }
|
||||
public void testIDEA148553() { doTest(); }
|
||||
public void testIDEA148093() { doTest(); }
|
||||
public void testIDEA148841() { doTest(); }
|
||||
public void testCapturedTypesOfImplicitParameterTypes() { doTest(); }
|
||||
public void testApplicabilityConflictMessage() { doTest(); }
|
||||
public void testQualifierOfCapturedWildcardType() { doTest(); }
|
||||
public void testCapturedWildcardInReceiverPosition() { doTest(); }
|
||||
public void testGetClassReturnTypeInMethodReference() { doTest(); }
|
||||
public void testCaptureTypeOfNewArrayExpression() { doTest(); }
|
||||
public void testIDEA152659() { doTest(); }
|
||||
public void testFreshVariableLowerBoundsDuringSuperTypeChecks() { doTest(); }
|
||||
public void testTypeParameterInstantiation() { doTest(); }
|
||||
public void testIgnoreForeignVariables() { doTest(); }
|
||||
public void testChainedCallsWithMethodReferenceInside() { doTest(); }
|
||||
public void testApplicabilityErrorVisibleWhenConstraintsFromFunctionalExpressionsProvideValidSubstitutor() { doTest(); }
|
||||
public void testMethodReferenceSecondSearchDontInfluenceTopSiteSubstitutor() { doTest(); }
|
||||
public void testCheckReturnTypeOfMethodReferenceWhenTheRestIsGood() { doTest(); }
|
||||
public void testEnsureResolveToClassInConstructorRefs() { doTest(); }
|
||||
public void testReturnTypeCompatibilityConstraintForSecondSearchCase() { doTest(); }
|
||||
public void testMethodInInheritorFoundBySecondSearch() { doTest(); }
|
||||
public void testNonExactMethodReferenceOnRawClassType() { doTest(); }
|
||||
public void testMethodREfToContainingMethodWithGenericParam() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
@@ -555,6 +175,6 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
|
||||
private void doTest(boolean warnings) {
|
||||
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false);
|
||||
doTest(BASE_PATH + getTestName(false) + ".java", warnings, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -17,11 +17,10 @@ package com.intellij.codeInspection;
|
||||
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.codeInspection.redundantCast.RedundantCastInspection;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class RedundantCast18Test extends LightDaemonAnalyzerTestCase {
|
||||
@NonNls static final String BASE_PATH = "/inspection/redundantCast/lambda";
|
||||
private static final String BASE_PATH = "/inspection/redundantCast/lambda/";
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -32,14 +31,14 @@ public class RedundantCast18Test extends LightDaemonAnalyzerTestCase {
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", true, false);
|
||||
doTest(BASE_PATH + getTestName(false) + ".java", true, false);
|
||||
}
|
||||
|
||||
public void testLambdaContext() throws Exception { doTest(); }
|
||||
public void testMethodRefContext() throws Exception { doTest(); }
|
||||
public void testExpectedSupertype() throws Exception { doTest(); }
|
||||
public void testForeachValue() throws Exception { doTest(); }
|
||||
public void testConditional() throws Exception { doTest(); }
|
||||
public void testInferApplicabilityError() throws Exception { doTest(); }
|
||||
public void testCastToRawType() throws Exception { doTest(); }
|
||||
public void testLambdaContext() { doTest(); }
|
||||
public void testMethodRefContext() { doTest(); }
|
||||
public void testExpectedSupertype() { doTest(); }
|
||||
public void testForeachValue() { doTest(); }
|
||||
public void testConditional() { doTest(); }
|
||||
public void testInferApplicabilityError() { doTest(); }
|
||||
public void testCastToRawType() { doTest(); }
|
||||
}
|
||||
+29
-43
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -29,20 +29,17 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 3/16/11
|
||||
* @author anna
|
||||
* @since 16.03.2011
|
||||
*/
|
||||
public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTest {
|
||||
|
||||
private static final String BASE_PATH = "/refactoring/inplaceIntroduceConstant/";
|
||||
|
||||
public void testReplaceAll() throws Exception {
|
||||
|
||||
public void testReplaceAll() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
inplaceIntroduceFieldPopup.setReplaceAllOccurrences(true);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -58,19 +55,16 @@ public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTe
|
||||
return expr instanceof PsiLiteralExpression ? expr : null;
|
||||
}
|
||||
|
||||
public void testReplaceAllInsideParenthesized() throws Exception {
|
||||
|
||||
public void testReplaceAllInsideParenthesized() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
inplaceIntroduceFieldPopup.setReplaceAllOccurrences(true);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testReplaceAllWithClassRefType() throws Exception {
|
||||
|
||||
public void testReplaceAllWithClassRefType() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
@@ -79,8 +73,8 @@ public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTe
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testReplaceAllWithBrokenIdentifier() throws Exception {
|
||||
|
||||
public void testReplaceAllWithBrokenIdentifier() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
@@ -90,8 +84,7 @@ public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTe
|
||||
});
|
||||
}
|
||||
|
||||
public void testReplaceAllFromSecondOccurrence() throws Exception {
|
||||
|
||||
public void testReplaceAllFromSecondOccurrence() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
@@ -101,8 +94,7 @@ public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTe
|
||||
});
|
||||
}
|
||||
|
||||
public void testReplaceAllFromLiteral() throws Exception {
|
||||
|
||||
public void testReplaceAllFromLiteral() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
@@ -112,31 +104,26 @@ public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTe
|
||||
});
|
||||
}
|
||||
|
||||
public void testConflictingConstantName() throws Exception {
|
||||
|
||||
public void testConflictingConstantName() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
}
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) { }
|
||||
});
|
||||
}
|
||||
|
||||
public void testNoConflictingConstantName() throws Exception {
|
||||
|
||||
public void testNoConflictingConstantName() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
}
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) { }
|
||||
});
|
||||
}
|
||||
|
||||
public void testEnsureVisibilityForAnno() throws Exception {
|
||||
public void testEnsureVisibilityForAnno() {
|
||||
JavaRefactoringSettings.getInstance().INTRODUCE_CONSTANT_VISIBILITY = PsiModifier.PRIVATE;
|
||||
try {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
}
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) { }
|
||||
});
|
||||
}
|
||||
finally {
|
||||
@@ -144,8 +131,7 @@ public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTe
|
||||
}
|
||||
}
|
||||
|
||||
public void testCorrectFinalPosition() throws Exception {
|
||||
|
||||
public void testCorrectFinalPosition() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
@@ -153,21 +139,21 @@ public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTe
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testCorrectConstantPosition() throws Exception {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
type("R");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testEscapePosition() throws Exception {
|
||||
public void testCorrectConstantPosition() {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
type("R");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testEscapePosition() {
|
||||
doTestEscape();
|
||||
}
|
||||
|
||||
public void testEscapePositionOnLocal() throws Exception {
|
||||
public void testEscapePositionOnLocal() {
|
||||
doTestEscape();
|
||||
}
|
||||
|
||||
@@ -192,4 +178,4 @@ public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTe
|
||||
return super.invokeImpl(project, localVariable, editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,8 +239,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
doTest(new MockIntroduceVariableHandler("str", false, false, false, "int"));
|
||||
}
|
||||
catch (Exception e) {
|
||||
assertEquals(e.getMessage(), "Error message:Cannot perform refactoring.\n" +
|
||||
"Selected block should represent an expression");
|
||||
assertEquals("Error message:Cannot perform refactoring.\nSelected block should represent an expression", e.getMessage());
|
||||
return;
|
||||
}
|
||||
fail("Should not be able to perform refactoring");
|
||||
@@ -279,8 +278,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
doTest(new MockIntroduceVariableHandler("strs", false, false, false, "java.lang.String[]"));
|
||||
}
|
||||
catch (Exception e) {
|
||||
assertEquals(e.getMessage(), "Error message:Cannot perform refactoring.\n" +
|
||||
"Selected block should represent an expression");
|
||||
assertEquals("Error message:Cannot perform refactoring.\nSelected block should represent an expression", e.getMessage());
|
||||
return;
|
||||
}
|
||||
fail("Should not be able to perform refactoring");
|
||||
@@ -291,8 +289,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
doTest(new MockIntroduceVariableHandler("strs", false, false, false, "java.lang.String[]"));
|
||||
}
|
||||
catch (Exception e) {
|
||||
assertEquals(e.getMessage(), "Error message:Cannot perform refactoring.\n" +
|
||||
"Selected block should represent an expression");
|
||||
assertEquals("Error message:Cannot perform refactoring.\nSelected block should represent an expression", e.getMessage());
|
||||
return;
|
||||
}
|
||||
fail("Should not be able to perform refactoring");
|
||||
@@ -396,8 +393,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
doTest(new MockIntroduceVariableHandler("sum", true, true, false, "int"){
|
||||
@Override
|
||||
protected void showErrorMessage(Project project, Editor editor, String message) {
|
||||
assertEquals("Cannot perform refactoring.\n" +
|
||||
"Extracting selected expression would change the semantic of the whole expression.", message);
|
||||
assertEquals("Cannot perform refactoring.\nExtracting selected expression would change the semantic of the whole expression.", message);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -407,8 +403,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
doTest(new MockIntroduceVariableHandler("toString", false, false, false, CommonClassNames.JAVA_LANG_STRING));
|
||||
}
|
||||
catch (Exception e) {
|
||||
assertEquals(e.getMessage(), "Error message:Cannot perform refactoring.\n" +
|
||||
"Selected block should represent an expression");
|
||||
assertEquals("Error message:Cannot perform refactoring.\nSelected block should represent an expression", e.getMessage());
|
||||
return;
|
||||
}
|
||||
fail("Should not be able to perform refactoring");
|
||||
@@ -492,7 +487,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
public void testPutInLambdaBodyVoidValueConflict() {
|
||||
doTest(new MockIntroduceVariableHandler("c", false, false, false, "int"));
|
||||
}
|
||||
|
||||
|
||||
public void testPutInLambdaBodyVoid() {
|
||||
doTest(new MockIntroduceVariableHandler("s", false, false, false, "java.lang.String"));
|
||||
}
|
||||
@@ -571,4 +566,4 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
testMe.invoke(getProject(), getEditor(), getFile(), null);
|
||||
checkResultByFile(baseName + ".after.java");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user