diff --git a/plugins/git4idea/src/git4idea/checkin/GitCheckinHandlerFactory.java b/plugins/git4idea/src/git4idea/checkin/GitCheckinHandlerFactory.java index 10a4ec211208..49453308f39f 100644 --- a/plugins/git4idea/src/git4idea/checkin/GitCheckinHandlerFactory.java +++ b/plugins/git4idea/src/git4idea/checkin/GitCheckinHandlerFactory.java @@ -61,7 +61,6 @@ import java.util.concurrent.atomic.AtomicReference; /** * Prohibits committing with an empty messages, warns if committing into detached HEAD, checks if user name and correct CRLF attributes * are set. - * @author Kirill Likhodedov */ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { @@ -77,7 +76,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { return new MyCheckinHandler(panel); } - private class MyCheckinHandler extends CheckinHandler { + private static class MyCheckinHandler extends CheckinHandler { @NotNull private final CheckinProjectPanel myPanel; @NotNull private final Project myProject; @@ -119,7 +118,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { final Collection files = myPanel.getVirtualFiles(); // deleted files aren't included, but for them we don't care about CRLFs. final AtomicReference crlfHelper = new AtomicReference<>(); ProgressManager.getInstance().run( - new Task.Modal(myProject, "Checking for line separator issues...", true) { + new Task.Modal(myProject, "Checking for Line Separator Issues", true) { @Override public void run(@NotNull ProgressIndicator indicator) { crlfHelper.set(GitCrlfProblemsDetector.detect(GitCheckinHandlerFactory.MyCheckinHandler.this.myProject, @@ -211,11 +210,11 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { } @NotNull - private Map> getDefinedUserNames(@NotNull final Project project, - @NotNull final Collection roots, - final boolean stopWhenFoundFirst) { + private static Map> getDefinedUserNames(@NotNull final Project project, + @NotNull final Collection roots, + final boolean stopWhenFoundFirst) { final Map> defined = ContainerUtil.newHashMap(); - ProgressManager.getInstance().run(new Task.Modal(project, "Checking Git user name...", true) { + ProgressManager.getInstance().run(new Task.Modal(project, "Checking Git User Name", true) { @Override public void run(@NotNull ProgressIndicator pi) { for (VirtualFile root : roots) { @@ -276,7 +275,8 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { } @NotNull - private Couple getUserNameAndEmailFromGitConfig(@NotNull Project project, @NotNull VirtualFile root) throws VcsException { + private static Couple getUserNameAndEmailFromGitConfig(@NotNull Project project, + @NotNull VirtualFile root) throws VcsException { String name = GitConfigUtil.getValue(project, root, GitConfigUtil.USER_NAME); String email = GitConfigUtil.getValue(project, root, GitConfigUtil.USER_EMAIL); return Couple.of(name, email); @@ -339,11 +339,12 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { } } - private boolean commitOrCommitAndPush(@Nullable CommitExecutor executor) { + private static boolean commitOrCommitAndPush(@Nullable CommitExecutor executor) { return executor == null || executor instanceof GitCommitAndPushExecutor; } - private String readMore(String link, String message) { + @NotNull + private static String readMore(@NotNull String link, @NotNull String message) { return String.format("%s.", link, message); } @@ -381,7 +382,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { return result; } - private class DetachedRoot { + private static class DetachedRoot { final VirtualFile myRoot; final boolean myRebase; // rebase in progress, or just detached due to a checkout of a commit. @@ -390,7 +391,5 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory { myRebase = rebase; } } - } - }