safe delete: fixed delete from the top of the hierarchy

This commit is contained in:
anna
2011-03-11 15:47:34 +01:00
parent d1b5fd26f8
commit 0d2ea7efa4
8 changed files with 36 additions and 1 deletions
@@ -111,7 +111,11 @@ public class JavaSafeDeleteProcessor implements SafeDeleteProcessorDelegate {
final Set<PsiParameter> parametersToDelete = new HashSet<PsiParameter>();
parametersToDelete.add((PsiParameter) element);
final int parameterIndex = method.getParameterList().getParameterIndex((PsiParameter) element);
for (PsiMethod superMethod : method.findDeepestSuperMethods()) {
final List<PsiMethod> superMethods = new ArrayList<PsiMethod>(Arrays.asList(method.findDeepestSuperMethods()));
if (superMethods.isEmpty()) {
superMethods.add(method);
}
for (PsiMethod superMethod : superMethods) {
parametersToDelete.add(superMethod.getParameterList().getParameters()[parameterIndex]);
OverridingMethodsSearch.search(superMethod).forEach(new Processor<PsiMethod>() {
public boolean process(PsiMethod overrider) {