mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
change signature: conflict if deleted parameter is used in method body, excluding javadoc (IDEA-157603)
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
void f<caret>oo(int i) {}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
void foo(int i) {
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,13 @@ public class ChangeSignatureGestureTest extends LightCodeInsightFixtureTestCase
|
||||
}
|
||||
|
||||
public void testDeleteParamInSuperUsed() {
|
||||
doDeleteTest();
|
||||
try {
|
||||
BaseRefactoringProcessor.ConflictsInTestsException.setTestIgnore(true);
|
||||
doDeleteTest();
|
||||
}
|
||||
finally {
|
||||
BaseRefactoringProcessor.ConflictsInTestsException.setTestIgnore(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void doDeleteTest() {
|
||||
|
||||
@@ -68,6 +68,14 @@ public class ChangeSignatureTest extends ChangeSignatureBaseTest {
|
||||
catch (BaseRefactoringProcessor.ConflictsInTestsException ignored) { }
|
||||
}
|
||||
|
||||
public void testConflictForUsedParametersInMethodBody() throws Exception {
|
||||
try {
|
||||
doTest(null, new ParameterInfoImpl[0], true);
|
||||
fail("Conflict expected");
|
||||
}
|
||||
catch (BaseRefactoringProcessor.ConflictsInTestsException ignored) { }
|
||||
}
|
||||
|
||||
public void testGenericTypes() {
|
||||
doTest(null, null, "T", method -> new ParameterInfoImpl[]{
|
||||
new ParameterInfoImpl(-1, "x", myFactory.createTypeFromText("T", method.getParameterList()), "null"),
|
||||
|
||||
Reference in New Issue
Block a user