rename: simplify error processing
authorAnna.Kozlova <anna.kozlova@jetbrains.com>
Thu, 17 Nov 2016 13:09:01 +0000 (14:09 +0100)
committerAnna.Kozlova <anna.kozlova@jetbrains.com>
Thu, 17 Nov 2016 13:29:36 +0000 (14:29 +0100)
platform/lang-impl/src/com/intellij/refactoring/rename/RenameProcessor.java

index 63c3065f4b749c3f4bfe1e94525ebfb477923b11..5869fead47d0bdc4102ac05174c832faa921bce9 100644 (file)
@@ -201,7 +201,6 @@ public class RenameProcessor extends BaseRefactoringProcessor {
     }
 
     final int[] choice = myAllRenames.size() > 1 ? new int[]{-1} : null;
-    String message = null;
     try {
       for (Iterator<Map.Entry<PsiElement, String>> iterator = myAllRenames.entrySet().iterator(); iterator.hasNext(); ) {
         Map.Entry<PsiElement, String> entry = iterator.next();
@@ -217,11 +216,7 @@ public class RenameProcessor extends BaseRefactoringProcessor {
       }
     }
     catch (IncorrectOperationException e) {
-      message = e.getMessage();
-    }
-
-    if (message != null) {
-      CommonRefactoringUtil.showErrorMessage(RefactoringBundle.message("rename.title"), message, getHelpID(), myProject);
+      CommonRefactoringUtil.showErrorMessage(RefactoringBundle.message("rename.title"), e.getMessage(), getHelpID(), myProject);
       return false;
     }