From 9efd225310ef0eab0c86897b9269cbac3f20b5f1 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Sun, 28 Dec 2014 15:05:39 +0300 Subject: [PATCH] [git] cleanup: yellow code, NotNulls, formatting --- .../src/git4idea/update/GitRebaseUpdater.java | 16 ++++++++++------ .../git4idea/src/git4idea/update/GitUpdater.java | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/git4idea/src/git4idea/update/GitRebaseUpdater.java b/plugins/git4idea/src/git4idea/update/GitRebaseUpdater.java index e22c15076170..0e48a94e5b5b 100644 --- a/plugins/git4idea/src/git4idea/update/GitRebaseUpdater.java +++ b/plugins/git4idea/src/git4idea/update/GitRebaseUpdater.java @@ -31,7 +31,6 @@ import git4idea.rebase.GitRebaser; import git4idea.repo.GitRepository; import org.jetbrains.annotations.NotNull; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; @@ -43,22 +42,27 @@ public class GitRebaseUpdater extends GitUpdater { private static final Logger LOG = Logger.getInstance(GitRebaseUpdater.class.getName()); private final GitRebaser myRebaser; - public GitRebaseUpdater(@NotNull Project project, @NotNull Git git, @NotNull VirtualFile root, + public GitRebaseUpdater(@NotNull Project project, + @NotNull Git git, + @NotNull VirtualFile root, @NotNull final Map trackedBranches, - ProgressIndicator progressIndicator, - UpdatedFiles updatedFiles) { + @NotNull ProgressIndicator progressIndicator, + @NotNull UpdatedFiles updatedFiles) { super(project, git, root, trackedBranches, progressIndicator, updatedFiles); myRebaser = new GitRebaser(myProject, git, myProgressIndicator); } - @Override public boolean isSaveNeeded() { + @Override + public boolean isSaveNeeded() { return true; } + @NotNull + @Override protected GitUpdateResult doUpdate() { LOG.info("doUpdate "); String remoteBranch = getRemoteBranchToMerge(); - List params = Arrays.asList(remoteBranch); + List params = Collections.singletonList(remoteBranch); return myRebaser.rebase(myRoot, params, new Runnable() { @Override public void run() { diff --git a/plugins/git4idea/src/git4idea/update/GitUpdater.java b/plugins/git4idea/src/git4idea/update/GitUpdater.java index ccc3fd625a94..dda4ccb63b77 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdater.java +++ b/plugins/git4idea/src/git4idea/update/GitUpdater.java @@ -153,6 +153,7 @@ public abstract class GitUpdater { /** * Performs update (via rebase or merge - depending on the implementing classes). */ + @NotNull protected abstract GitUpdateResult doUpdate(); protected void markStart(VirtualFile root) throws VcsException {