safe delete: check hierarchy excluding current method (IDEA-150176)

This commit is contained in:
Anna Kozlova
2016-01-09 13:01:50 +01:00
parent 60433e51f3
commit 108c733015
4 changed files with 11 additions and 1 deletions
@@ -172,7 +172,7 @@ public class JavaSafeDeleteProcessor extends SafeDeleteProcessorDelegateBase {
return true;
}
});
if (!overriders.isEmpty()) {
if (overriders.size() > 1) {
String message = RefactoringBundle.message("0.is.a.part.of.method.hierarchy.do.you.want.to.delete.multiple.type.parameters", UsageViewUtil.getLongName(owner));
int result = ApplicationManager.getApplication().isUnitTestMode()
? Messages.YES :Messages.showYesNoCancelDialog(project, message, SafeDeleteHandler.REFACTORING_NAME, Messages.getQuestionIcon());
@@ -0,0 +1,3 @@
class A {
public <<caret>T> void foo() {}
}
@@ -0,0 +1,3 @@
class A {
public void foo() {}
}
@@ -280,6 +280,10 @@ public class SafeDeleteTest extends MultiFileTestCase {
public void testTypeParameterWithinMethodHierarchy() throws Exception {
doSingleFileTest();
}
public void testTypeParameterNoMethodHierarchy() throws Exception {
doSingleFileTest();
}
public void testClassWithInnerStaticImport() throws Exception {
doTest("ClassWithInnerStaticImport");