AddExceptionToThrowsFix: less read-only dialogs (IDEA-CR-16373)

This commit is contained in:
peter
2016-11-29 13:58:02 +01:00
parent 44f0f3f754
commit 1e19ef0569
@@ -94,12 +94,12 @@ public class AddExceptionToThrowsFix extends BaseIntentionAction {
processSuperMethods = false;
}
if (!FileModificationService.getInstance().prepareFileForWrite(targetMethod.getContainingFile())) return;
List<PsiElement> toModify = new ArrayList<>();
toModify.add(targetMethod);
if (processSuperMethods) {
for (PsiMethod superMethod : superMethods) {
if (!FileModificationService.getInstance().prepareFileForWrite(superMethod.getContainingFile())) return;
}
Collections.addAll(toModify, superMethods);
}
if (!FileModificationService.getInstance().preparePsiElementsForWrite(toModify)) return;
WriteAction.run(() -> {
processMethod(project, targetMethod, unhandledExceptions);