safe delete: allow to delete parameter in one method without hierarchy (IDEA-135686)

This commit is contained in:
Anna Kozlova
2015-01-27 20:00:39 +03:00
parent 5025e94962
commit 201e0dac79
@@ -147,8 +147,10 @@ public class JavaSafeDeleteProcessor extends SafeDeleteProcessorDelegateBase {
if (parametersToDelete.size() > 1 && !ApplicationManager.getApplication().isUnitTestMode()) {
String message = RefactoringBundle.message("0.is.a.part.of.method.hierarchy.do.you.want.to.delete.multiple.parameters", UsageViewUtil.getLongName(method));
if (Messages.showYesNoDialog(project, message, SafeDeleteHandler.REFACTORING_NAME,
Messages.getQuestionIcon()) != Messages.YES) return null;
int result = Messages.showYesNoCancelDialog(project, message, SafeDeleteHandler.REFACTORING_NAME,
Messages.getQuestionIcon());
if (result == Messages.CANCEL) return null;
if (result == Messages.NO) return Collections.singletonList(element);
}
return parametersToDelete;
}