From 62c3169657f1db445caf51361a8a1a5daee960c4 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Mon, 30 Jul 2018 17:43:05 +0300 Subject: [PATCH] git: cleanup --- .../src/git4idea/commands/GitBinaryHandler.java | 2 +- .../git4idea/src/git4idea/commands/GitHandler.java | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/plugins/git4idea/src/git4idea/commands/GitBinaryHandler.java b/plugins/git4idea/src/git4idea/commands/GitBinaryHandler.java index 4f0621ebd08a..f0db4847d85e 100644 --- a/plugins/git4idea/src/git4idea/commands/GitBinaryHandler.java +++ b/plugins/git4idea/src/git4idea/commands/GitBinaryHandler.java @@ -42,7 +42,7 @@ public class GitBinaryHandler extends GitHandler { @NotNull private final Semaphore mySteamSemaphore = new Semaphore(0); // The semaphore that waits for stream processing @NotNull private final AtomicReference myException = new AtomicReference<>(); - public GitBinaryHandler(final Project project, final VirtualFile vcsRoot, final GitCommand command) { + public GitBinaryHandler(@NotNull Project project, @NotNull VirtualFile vcsRoot, @NotNull GitCommand command) { super(project, vcsRoot, command, Collections.emptyList()); } diff --git a/plugins/git4idea/src/git4idea/commands/GitHandler.java b/plugins/git4idea/src/git4idea/commands/GitHandler.java index 50ca29c66b6d..3860b2bc824f 100644 --- a/plugins/git4idea/src/git4idea/commands/GitHandler.java +++ b/plugins/git4idea/src/git4idea/commands/GitHandler.java @@ -135,7 +135,7 @@ public abstract class GitHandler { } @NotNull - static List getConfigParameters(@Nullable Project project, @NotNull List requestedConfigParameters) { + private static List getConfigParameters(@Nullable Project project, @NotNull List requestedConfigParameters) { if (project == null || !GitVersionSpecialty.CAN_OVERRIDE_GIT_CONFIG_FOR_COMMAND.existsIn(project)) { return Collections.emptyList(); } @@ -185,7 +185,7 @@ public abstract class GitHandler { * * @param listener a listener */ - protected void addListener(ProcessEventListener listener) { + protected void addListener(@NotNull ProcessEventListener listener) { myListeners.addListener(listener); } @@ -205,7 +205,6 @@ public abstract class GitHandler { * * @param parameters a parameters to add */ - @SuppressWarnings({"WeakerAccess"}) public void addParameters(@NonNls @NotNull String... parameters) { addParameters(Arrays.asList(parameters)); } @@ -254,7 +253,6 @@ public abstract class GitHandler { * @param filePaths a parameters to add * @throws IllegalArgumentException if some path is not under root. */ - @SuppressWarnings({"WeakerAccess"}) public void addRelativePaths(@NotNull final Collection filePaths) { checkNotStarted(); for (FilePath path : filePaths) { @@ -273,7 +271,6 @@ public abstract class GitHandler { * @param files a parameters to add * @throws IllegalArgumentException if some path is not under root. */ - @SuppressWarnings({"WeakerAccess"}) public void addRelativeFiles(@NotNull final Collection files) { checkNotStarted(); for (VirtualFile file : files) { @@ -341,7 +338,6 @@ public abstract class GitHandler { * * @param charset a character set */ - @SuppressWarnings({"SameParameterValue"}) public void setCharset(@NotNull Charset charset) { myCommandLine.setCharset(charset); } @@ -535,13 +531,13 @@ public abstract class GitHandler { @Deprecated private Integer myExitCode; // exit code or null if exit code is not yet available @Deprecated - private final List myLastOutput = Collections.synchronizedList(new ArrayList()); + private final List myLastOutput = Collections.synchronizedList(new ArrayList<>()); @Deprecated private final int LAST_OUTPUT_SIZE = 5; @Deprecated private boolean myProgressParameterAllowed = false; @Deprecated - private final List myErrors = Collections.synchronizedList(new ArrayList()); + private final List myErrors = Collections.synchronizedList(new ArrayList<>()); /** * Adds "--progress" parameter. Usable for long operations, such as clone or fetch.