mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
change signature: add warning if new signature duplicates method in overrider (IDEA-157659)
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
class A {
|
||||
void fo<caret>o() {}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
void foo() {}
|
||||
void foo(int i) {}
|
||||
}
|
||||
@@ -60,6 +60,14 @@ public class ChangeSignatureTest extends ChangeSignatureBaseTest {
|
||||
catch (BaseRefactoringProcessor.ConflictsInTestsException ignored) { }
|
||||
}
|
||||
|
||||
public void testDuplicatedSignatureInInheritor() throws Exception {
|
||||
try {
|
||||
doTest(null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "i", PsiType.INT)}, 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