From 420e6f7a2f75dd1bd35502ccff0a1855f9a6202f Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 2 Oct 2013 16:58:49 +0200 Subject: [PATCH] cleanup --- .../src/com/intellij/openapi/vcs/AbstractVcs.java | 2 -- .../intellij/openapi/vcs/changes/ChangesUtil.java | 14 ++++++++++---- .../vcs/checkin/BaseCheckinHandlerFactory.java | 9 --------- .../openapi/vcs/checkin/CheckinHandlerFactory.java | 2 +- .../vcs/checkin/VcsCheckinHandlerFactory.java | 5 ----- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcs.java b/platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcs.java index efc5a62500ad..7b054fc4c85e 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcs.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcs.java @@ -16,7 +16,6 @@ package com.intellij.openapi.vcs; import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diff.impl.patch.formove.FilePathComparator; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.UnnamedConfigurable; @@ -59,7 +58,6 @@ import java.util.List; public abstract class AbstractVcs extends StartedActivated { // true is default private static final String USE_ANNOTATION_CACHE = "vcs.use.annotation.cache"; - private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.AbstractVcs"); @NonNls protected static final String ourIntegerPattern = "\\d+"; diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/ChangesUtil.java b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/ChangesUtil.java index 81374013ff26..6a97c41245ac 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/ChangesUtil.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/ChangesUtil.java @@ -27,7 +27,7 @@ import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vcs.*; import com.intellij.openapi.vcs.actions.VcsContextFactory; import com.intellij.openapi.vfs.LocalFileSystem; -import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.pom.Navigatable; import org.jetbrains.annotations.NotNull; @@ -40,7 +40,7 @@ import java.util.*; * @author max */ public class ChangesUtil { - private static final Key INTERNAL_OPERATION_KEY = Key.create("internal vcs operation"); + private static final Key INTERNAL_OPERATION_KEY = Key.create("internal vcs operation"); private ChangesUtil() {} @@ -148,7 +148,7 @@ public class ChangesUtil { } } } - return VfsUtil.toVirtualFileArray(files); + return VfsUtilCore.toVirtualFileArray(files); } public static Navigatable[] getNavigatableArray(final Project project, final VirtualFile[] selectedFiles) { @@ -207,6 +207,7 @@ public class ChangesUtil { public static FilePath getLocalPath(final Project project, final FilePath filePath) { // check if the file has just been renamed (IDEADEV-15494) Change change = ApplicationManager.getApplication().runReadAction(new Computable() { + @Override @Nullable public Change compute() { if (project.isDisposed()) throw new ProcessCanceledException(); @@ -255,6 +256,7 @@ public class ChangesUtil { private static VirtualFile getValidParentUnderReadAction(final FilePath filePath) { return ApplicationManager.getApplication().runReadAction(new Computable() { + @Override public VirtualFile compute() { return findValidParent(filePath); } @@ -326,6 +328,7 @@ public class ChangesUtil { final Map> changesByVcs = new HashMap>(); ApplicationManager.getApplication().runReadAction(new Runnable() { + @Override public void run() { for (T item : items) { final AbstractVcs vcs = separator.getVcsFor(item); @@ -348,6 +351,7 @@ public class ChangesUtil { public static void processChangesByVcs(final Project project, Collection changes, PerVcsProcessor processor) { processItemsByVcs(changes, new VcsSeparator() { + @Override public AbstractVcs getVcsFor(final Change item) { return getVcsForChange(item, project); } @@ -356,6 +360,7 @@ public class ChangesUtil { public static void processVirtualFilesByVcs(final Project project, Collection files, PerVcsProcessor processor) { processItemsByVcs(files, new VcsSeparator() { + @Override public AbstractVcs getVcsFor(final VirtualFile item) { return getVcsForFile(item, project); } @@ -364,6 +369,7 @@ public class ChangesUtil { public static void processFilePathsByVcs(final Project project, Collection files, PerVcsProcessor processor) { processItemsByVcs(files, new VcsSeparator() { + @Override public AbstractVcs getVcsFor(final FilePath item) { return getVcsForFile(item.getIOFile(), project); } @@ -380,7 +386,7 @@ public class ChangesUtil { public static boolean hasFileChanges(final Collection changes) { for(Change change: changes) { - FilePath path = ChangesUtil.getFilePath(change); + FilePath path = getFilePath(change); if (!path.isDirectory()) { return true; } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BaseCheckinHandlerFactory.java b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BaseCheckinHandlerFactory.java index c20465318fb2..69773607fb7b 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BaseCheckinHandlerFactory.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BaseCheckinHandlerFactory.java @@ -21,21 +21,12 @@ import com.intellij.openapi.vcs.changes.CommitContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -/** - * @author irengrig - * Date: 1/28/11 - * Time: 3:09 PM - * - * just interface for checkin handlers creation - */ public interface BaseCheckinHandlerFactory { /** * Creates a handler for a single Checkin Project or Checkin File operation. * - * * @param panel the class which can be used to retrieve information about the files to be committed, * and to get or set the commit message. - * @param commitContext * @return the handler instance. */ @NotNull diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/CheckinHandlerFactory.java b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/CheckinHandlerFactory.java index 1b40af7ff9f6..9fce242a683f 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/CheckinHandlerFactory.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/CheckinHandlerFactory.java @@ -31,7 +31,6 @@ import org.jetbrains.annotations.NotNull; * and unregistered in {@link com.intellij.openapi.vcs.AbstractVcs#deactivate()} * * @author lesya - * @see com.intellij.openapi.vcs.ProjectLevelVcsManager#registerCheckinHandlerFactory(BaseCheckinHandlerFactory) * @since 5.1 */ public abstract class CheckinHandlerFactory implements BaseCheckinHandlerFactory { @@ -44,6 +43,7 @@ public abstract class CheckinHandlerFactory implements BaseCheckinHandlerFactory * and to get or set the commit message. * @return the handler instance. */ + @Override @NotNull public abstract CheckinHandler createHandler(final CheckinProjectPanel panel, CommitContext commitContext); diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/VcsCheckinHandlerFactory.java b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/VcsCheckinHandlerFactory.java index c58a08893b8d..7a46fd9bbe8e 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/VcsCheckinHandlerFactory.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/VcsCheckinHandlerFactory.java @@ -22,11 +22,6 @@ import com.intellij.openapi.vcs.VcsKey; import com.intellij.openapi.vcs.changes.CommitContext; import org.jetbrains.annotations.NotNull; -/** - * @author irengrig - * Date: 1/28/11 - * Time: 3:49 PM - */ public abstract class VcsCheckinHandlerFactory implements BaseCheckinHandlerFactory { public static final ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.vcsCheckinHandlerFactory");