diff: remove unused parameter
authorAleksey Pivovarov <AMPivovarov@gmail.com>
Tue, 25 Aug 2015 15:14:47 +0000 (18:14 +0300)
committerAleksey Pivovarov <AMPivovarov@gmail.com>
Tue, 25 Aug 2015 16:04:19 +0000 (19:04 +0300)
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchAction.java

index fffaf894ca53d1a4dd3d663bf6c922a1b9d87f20..3a2a8ad5aefb8e7e4f6a716f482fd6a6791bd409 100644 (file)
@@ -167,7 +167,7 @@ public class ApplyPatchAction extends DumbAwareAction {
       return showMergeDialog(project, file, mergeData.getBase(), mergeData.getPatched(), reverse, leftPanelTitle, rightPanelTitle);
     }
     else {
-      return showBadDiffDialog(project, file, mergeData, false);
+      return showBadDiffDialog(project, file, mergeData);
     }
   }
 
@@ -250,8 +250,7 @@ public class ApplyPatchAction extends DumbAwareAction {
   @NotNull
   private static ApplyPatchStatus showBadDiffDialog(@Nullable Project project,
                                                     @NotNull VirtualFile file,
-                                                    @NotNull final ApplyPatchForBaseRevisionTexts texts,
-                                                    boolean readonly) {
+                                                    @NotNull final ApplyPatchForBaseRevisionTexts texts) {
     final Document document = FileDocumentManager.getInstance().getDocument(file);
     if (texts.getLocal() == null || document == null) return ApplyPatchStatus.FAILURE;
 
@@ -277,28 +276,26 @@ public class ApplyPatchAction extends DumbAwareAction {
     DiffUtil.addNotification(new DiffIsApproximateNotification(), request);
 
     final DiffDialogHints dialogHints = new DiffDialogHints(WindowWrapper.Mode.MODAL);
-    if (!readonly) {
-      dialogHints.setCancelAction(new BooleanGetter() {
-        @Override
-        public boolean get() {
-          ApplicationManager.getApplication().runWriteAction(new Runnable() {
-            @Override
-            public void run() {
-              document.setText(oldContent);
-              FileDocumentManager.getInstance().saveDocument(document);
-            }
-          });
-          return true;
-        }
-      });
-      dialogHints.setOkAction(new BooleanGetter() {
-        @Override
-        public boolean get() {
-          FileDocumentManager.getInstance().saveDocument(document);
-          return true;
-        }
-      });
-    }
+    dialogHints.setCancelAction(new BooleanGetter() {
+      @Override
+      public boolean get() {
+        ApplicationManager.getApplication().runWriteAction(new Runnable() {
+          @Override
+          public void run() {
+            document.setText(oldContent);
+            FileDocumentManager.getInstance().saveDocument(document);
+          }
+        });
+        return true;
+      }
+    });
+    dialogHints.setOkAction(new BooleanGetter() {
+      @Override
+      public boolean get() {
+        FileDocumentManager.getInstance().saveDocument(document);
+        return true;
+      }
+    });
 
     DiffManager.getInstance().showDiff(project, request, dialogHints);