Merge branch 'master' into changeSignature
[idea/community.git] / java / java-impl / src / com / intellij / refactoring / changeSignature / ChangeSignatureProcessor.java
index e351932529dc486be13ceb6f1c42d28c9231151b..2b624ad14c110ffe0bdf520d86841e201adb36a7 100644 (file)
@@ -31,6 +31,7 @@ import com.intellij.psi.codeStyle.CodeStyleManager;
 import com.intellij.psi.util.*;
 import com.intellij.refactoring.BaseRefactoringProcessor;
 import com.intellij.refactoring.RefactoringBundle;
+import com.intellij.refactoring.rename.RenameUtil;
 import com.intellij.refactoring.ui.ConflictsDialog;
 import com.intellij.refactoring.util.CanonicalTypes;
 import com.intellij.usageView.UsageInfo;
@@ -137,9 +138,15 @@ public class ChangeSignatureProcessor extends BaseRefactoringProcessor {
       }
     }
 
-    final Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(refUsages.get()));
+    final UsageInfo[] usagesIn = refUsages.get();
+    Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(usagesIn));
+    RenameUtil.removeConflictUsages(usagesSet);
     if (myPrepareSuccessfulSwingThreadCallback != null && !conflictDescriptions.isEmpty()) {
-      ConflictsDialog dialog = new ConflictsDialog(myProject, conflictDescriptions);
+      ConflictsDialog dialog = new ConflictsDialog(myProject, conflictDescriptions, new Runnable(){
+        public void run() {
+          execute(usagesIn);
+        }
+      });
       dialog.show();
       if (!dialog.isOK()) {
         if (dialog.isShowConflicts()) prepareSuccessful();