change signature: propagate parameters change to lambda expressions (IDEA-150138)

This commit is contained in:
Anna Kozlova
2016-01-13 16:54:58 +01:00
parent ef59b92a12
commit b56e7e0c20
10 changed files with 131 additions and 45 deletions
@@ -15,23 +15,19 @@
*/
package com.intellij.codeInsight.daemon.lambda;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.PsiType;
import com.intellij.refactoring.BaseRefactoringProcessor;
import com.intellij.refactoring.ChangeSignatureBaseTest;
import com.intellij.refactoring.changeSignature.ParameterInfoImpl;
import com.intellij.refactoring.changeSignature.ThrownExceptionInfo;
import com.intellij.testFramework.IdeaTestUtil;
public class ChangeSignatureTouchLambdaTest extends ChangeSignatureBaseTest {
public void testVariableDeclaration() {
doTestConflict();
doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN)}, new ThrownExceptionInfo[0], false);
}
public void testMethodArgument() throws Exception {
doTestConflict();
doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN)}, new ThrownExceptionInfo[0], false);
}
public void testDefaultMethodTouched() throws Exception {
@@ -42,14 +38,6 @@ public class ChangeSignatureTouchLambdaTest extends ChangeSignatureBaseTest {
doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN, "false")}, new ThrownExceptionInfo[0], true);
}
private void doTestConflict() {
try {
doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN)}, new ThrownExceptionInfo[0], false);
fail("Conflict expected");
}
catch (BaseRefactoringProcessor.ConflictsInTestsException ignored) { }
}
@Override
protected String getRelativePath() {
return "/codeInsight/daemonCodeAnalyzer/lambda/changeSignature/";