diff --git a/platform/util/src/com/intellij/util/io/BinaryOutputReader.java b/platform/util/src/com/intellij/util/io/BinaryOutputReader.java index a80fb50796cd..e8e5bea20d40 100644 --- a/platform/util/src/com/intellij/util/io/BinaryOutputReader.java +++ b/platform/util/src/com/intellij/util/io/BinaryOutputReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,11 +24,10 @@ import java.io.InputStream; * @author Konstantin Kolosovsky. */ public abstract class BinaryOutputReader extends BaseDataReader { - @NotNull private final InputStream myStream; @NotNull private final byte[] myBuffer = new byte[8192]; - public BinaryOutputReader(@NotNull InputStream stream, SleepingPolicy sleepingPolicy) { + public BinaryOutputReader(@NotNull InputStream stream, @NotNull SleepingPolicy sleepingPolicy) { super(sleepingPolicy); myStream = stream; } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandProcessHandler.java b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandProcessHandler.java index f5c2aa4ac961..a0dad361bfbc 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandProcessHandler.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandProcessHandler.java @@ -21,7 +21,6 @@ import com.intellij.execution.process.OSProcessHandler; import com.intellij.util.io.BaseDataReader; import com.intellij.util.io.BinaryOutputReader; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -32,7 +31,7 @@ class HgCommandProcessHandler extends OSProcessHandler { private final boolean myBinary; private final ByteArrayOutputStream myBinaryOutput; - public HgCommandProcessHandler(@NotNull GeneralCommandLine commandLine, boolean binary) throws ExecutionException { + HgCommandProcessHandler(@NotNull GeneralCommandLine commandLine, boolean binary) throws ExecutionException { super(commandLine); myBinary = binary; myBinaryOutput = new ByteArrayOutputStream(); @@ -40,7 +39,7 @@ class HgCommandProcessHandler extends OSProcessHandler { @NotNull @Override - protected BaseDataReader createOutputDataReader(BaseDataReader.SleepingPolicy sleepingPolicy) { + protected BaseDataReader createOutputDataReader(@NotNull BaseDataReader.SleepingPolicy sleepingPolicy) { return myBinary ? new MyBinaryOutputReader(myProcess.getInputStream(), sleepingPolicy) : super.createOutputDataReader(sleepingPolicy); } @@ -50,8 +49,7 @@ class HgCommandProcessHandler extends OSProcessHandler { } private class MyBinaryOutputReader extends BinaryOutputReader { - - public MyBinaryOutputReader(@NotNull InputStream stream, @Nullable BaseDataReader.SleepingPolicy simple) { + private MyBinaryOutputReader(@NotNull InputStream stream, @NotNull BaseDataReader.SleepingPolicy simple) { super(stream, simple); start(); } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/ShellCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/ShellCommand.java index 568a56f72f94..c4d141b53ac6 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/ShellCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/ShellCommand.java @@ -35,8 +35,8 @@ public final class ShellCommand { private final GeneralCommandLine myCommandLine; - public ShellCommand(@Nullable List commandLine, @Nullable String dir, @Nullable Charset charset) { - if (commandLine == null || commandLine.isEmpty()) { + public ShellCommand(@NotNull List commandLine, @Nullable String dir, @Nullable Charset charset) { + if (commandLine.isEmpty()) { throw new IllegalArgumentException("commandLine is empty"); } myCommandLine = new GeneralCommandLine(commandLine); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnProcessHandler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnProcessHandler.java index 04c82ade65bd..6707bf3e44eb 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnProcessHandler.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnProcessHandler.java @@ -61,7 +61,7 @@ public class SvnProcessHandler extends OSProcessHandler { @NotNull @Override - protected BaseDataReader createOutputDataReader(BaseDataReader.SleepingPolicy sleepingPolicy) { + protected BaseDataReader createOutputDataReader(@NotNull BaseDataReader.SleepingPolicy sleepingPolicy) { if (myForceBinary) { return new SimpleBinaryOutputReader(myProcess.getInputStream(), sleepingPolicy); } @@ -69,8 +69,7 @@ public class SvnProcessHandler extends OSProcessHandler { } private class SimpleBinaryOutputReader extends BinaryOutputReader { - - public SimpleBinaryOutputReader(@NotNull InputStream stream, SleepingPolicy sleepingPolicy) { + private SimpleBinaryOutputReader(@NotNull InputStream stream, @NotNull SleepingPolicy sleepingPolicy) { super(stream, sleepingPolicy); start(); }