This commit is contained in:
Alexey Kudravtsev
2015-10-27 14:20:29 +03:00
parent 6a684d52d4
commit af4057ba81
9 changed files with 39 additions and 11 deletions
@@ -48,11 +48,13 @@ public class JUnitProcessHandler extends KillableColoredProcessHandler {
});
}
@NotNull
@Override
protected Reader createProcessOutReader() {
return myOut.createReader();
}
@NotNull
@Override
protected Reader createProcessErrReader() {
return myErr.createReader();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 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.
@@ -140,8 +140,9 @@ public class RmiStubsGenerator extends ClassProcessingBuilder {
);
final Process process = Runtime.getRuntime().exec(ArrayUtil.toStringArray(cmdLine));
final BaseOSProcessHandler handler = new BaseOSProcessHandler(process, null, null) {
@NotNull
@Override
protected Future<?> executeOnPooledThread(Runnable task) {
protected Future<?> executeOnPooledThread(@NotNull Runnable task) {
return SharedThreadPool.getInstance().executeOnPooledThread(task);
}
};
@@ -1,3 +1,18 @@
/*
* 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.remote;
import com.intellij.execution.TaskExecutor;
@@ -64,8 +79,9 @@ public class BaseRemoteProcessHandler<T extends RemoteProcess> extends AbstractR
notifyTextAvailable(text, ProcessOutputTypes.STDOUT);
}
@NotNull
@Override
protected Future<?> executeOnPooledThread(Runnable runnable) {
protected Future<?> executeOnPooledThread(@NotNull Runnable runnable) {
return BaseRemoteProcessHandler.executeOnPooledThread(runnable);
}
};
@@ -76,8 +92,9 @@ public class BaseRemoteProcessHandler<T extends RemoteProcess> extends AbstractR
notifyTextAvailable(text, ProcessOutputTypes.STDERR);
}
@NotNull
@Override
protected Future<?> executeOnPooledThread(Runnable runnable) {
protected Future<?> executeOnPooledThread(@NotNull Runnable runnable) {
return BaseRemoteProcessHandler.executeOnPooledThread(runnable);
}
};
@@ -17,6 +17,7 @@ package com.intellij.util.io;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.TimeoutUtil;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
@@ -48,7 +49,8 @@ public abstract class BaseDataReader {
}
}
protected abstract Future<?> executeOnPooledThread(Runnable runnable);
@NotNull
protected abstract Future<?> executeOnPooledThread(@NotNull Runnable runnable);
public interface SleepingPolicy {
int sleepTimeWhenWasActive = 1;
@@ -58,8 +58,9 @@ public class BaseOutputReaderTest {
myLines.add(text);
}
@NotNull
@Override
protected Future<?> executeOnPooledThread(Runnable runnable) {
protected Future<?> executeOnPooledThread(@NotNull Runnable runnable) {
return ourExecutor.submit(runnable);
}
}
@@ -25,6 +25,7 @@ import com.intellij.util.SystemProperties;
import com.intellij.util.containers.ContainerUtilRt;
import com.intellij.util.lang.UrlClassLoader;
import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.groovy.compiler.rt.GroovyRtConstants;
import org.jetbrains.jps.ModuleChunk;
import org.jetbrains.jps.cmdline.ClasspathBootstrap;
@@ -96,8 +97,9 @@ class ForkedGroovyc implements GroovycFlavor {
);
final Process process = Runtime.getRuntime().exec(ArrayUtil.toStringArray(cmd));
ProcessHandler handler = new BaseOSProcessHandler(process, null, null) {
@NotNull
@Override
protected Future<?> executeOnPooledThread(Runnable task) {
protected Future<?> executeOnPooledThread(@NotNull Runnable task) {
return SharedThreadPool.getInstance().executeOnPooledThread(task);
}
@@ -61,8 +61,9 @@ class HgCommandProcessHandler extends OSProcessHandler {
myBinaryOutput.write(data, 0, size);
}
@NotNull
@Override
protected Future<?> executeOnPooledThread(Runnable runnable) {
protected Future<?> executeOnPooledThread(@NotNull Runnable runnable) {
return HgCommandProcessHandler.this.executeOnPooledThread(runnable);
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 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.
@@ -80,8 +80,9 @@ public class SvnProcessHandler extends OSProcessHandler {
myBinaryOutput.write(data, 0, size);
}
@NotNull
@Override
protected Future<?> executeOnPooledThread(Runnable runnable) {
protected Future<?> executeOnPooledThread(@NotNull Runnable runnable) {
return SvnProcessHandler.this.executeOnPooledThread(runnable);
}
}
@@ -626,8 +626,9 @@ public class RemoteDebugger implements ProcessDebugger {
return ProtocolParser.parseThread(frame.getPayload(), myDebugProcess.getPositionConverter());
}
@NotNull
@Override
protected Future<?> executeOnPooledThread(Runnable runnable) {
protected Future<?> executeOnPooledThread(@NotNull Runnable runnable) {
return ApplicationManager.getApplication().executeOnPooledThread(runnable);
}