mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
notnull
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ public final class ShellCommand {
|
||||
|
||||
private final GeneralCommandLine myCommandLine;
|
||||
|
||||
public ShellCommand(@Nullable List<String> commandLine, @Nullable String dir, @Nullable Charset charset) {
|
||||
if (commandLine == null || commandLine.isEmpty()) {
|
||||
public ShellCommand(@NotNull List<String> commandLine, @Nullable String dir, @Nullable Charset charset) {
|
||||
if (commandLine.isEmpty()) {
|
||||
throw new IllegalArgumentException("commandLine is empty");
|
||||
}
|
||||
myCommandLine = new GeneralCommandLine(commandLine);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user