From 7d443bfb62eec6730d39d230dcdd0aa02268b489 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Wed, 9 Sep 2015 15:49:06 +0300 Subject: [PATCH] [git] cleanup: formatting, notnull --- .../git4idea/stash/GitStashChangesSaver.java | 19 +++++++++++++------ .../src/git4idea/stash/GitStashUtils.java | 6 ------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/plugins/git4idea/src/git4idea/stash/GitStashChangesSaver.java b/plugins/git4idea/src/git4idea/stash/GitStashChangesSaver.java index e8d90fa80e96..8e96d571f8ad 100644 --- a/plugins/git4idea/src/git4idea/stash/GitStashChangesSaver.java +++ b/plugins/git4idea/src/git4idea/stash/GitStashChangesSaver.java @@ -26,6 +26,7 @@ import com.intellij.openapi.vcs.history.VcsRevisionNumber; import com.intellij.openapi.vcs.merge.MergeDialogCustomizer; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.util.containers.ContainerUtil; import git4idea.GitPlatformFacade; import git4idea.commands.Git; import git4idea.commands.GitCommandResult; @@ -40,22 +41,28 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.event.HyperlinkEvent; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Set; public class GitStashChangesSaver extends GitChangesSaver { private static final Logger LOG = Logger.getInstance(GitStashChangesSaver.class); - private final Set myStashedRoots = new HashSet(); // save stashed roots to unstash only them - @NotNull private final GitRepositoryManager myRepositoryManager; - public GitStashChangesSaver(@NotNull Project project, @NotNull GitPlatformFacade platformFacade, @NotNull Git git, - @NotNull ProgressIndicator progressIndicator, @NotNull String stashMessage) { + @NotNull private final GitRepositoryManager myRepositoryManager; + @NotNull private final Set myStashedRoots = ContainerUtil.newHashSet(); // save stashed roots to unstash only them + + public GitStashChangesSaver(@NotNull Project project, + @NotNull GitPlatformFacade platformFacade, + @NotNull Git git, + @NotNull ProgressIndicator progressIndicator, + @NotNull String stashMessage) { super(project, platformFacade, git, progressIndicator, stashMessage); myRepositoryManager = platformFacade.getRepositoryManager(project); } @Override - protected void save(Collection rootsToSave) throws VcsException { + protected void save(@NotNull Collection rootsToSave) throws VcsException { LOG.info("saving " + rootsToSave); for (VirtualFile root : rootsToSave) { diff --git a/plugins/git4idea/src/git4idea/stash/GitStashUtils.java b/plugins/git4idea/src/git4idea/stash/GitStashUtils.java index 4c26894f8ca5..39dc492e45cc 100644 --- a/plugins/git4idea/src/git4idea/stash/GitStashUtils.java +++ b/plugins/git4idea/src/git4idea/stash/GitStashUtils.java @@ -15,7 +15,6 @@ */ package git4idea.stash; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vfs.VirtualFile; @@ -30,13 +29,8 @@ import org.jetbrains.annotations.NotNull; import java.nio.charset.Charset; -/** - * The class contains utilities for creating and removing stashes. - */ public class GitStashUtils { - private static final Logger LOG = Logger.getInstance(GitStashUtils.class); - private GitStashUtils() { }