diff --git a/java/execution/impl/src/com/intellij/execution/junit/JUnitProcessHandler.java b/java/execution/impl/src/com/intellij/execution/junit/JUnitProcessHandler.java index 01132371ae04..a4a1695baf42 100644 --- a/java/execution/impl/src/com/intellij/execution/junit/JUnitProcessHandler.java +++ b/java/execution/impl/src/com/intellij/execution/junit/JUnitProcessHandler.java @@ -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(); diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/RmiStubsGenerator.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/RmiStubsGenerator.java index 02c5cc1c1c30..fffb87931d36 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/RmiStubsGenerator.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/RmiStubsGenerator.java @@ -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); } }; diff --git a/platform/platform-impl/src/com/intellij/remote/BaseRemoteProcessHandler.java b/platform/platform-impl/src/com/intellij/remote/BaseRemoteProcessHandler.java index 684cfbb87971..8fc9c731b2c9 100644 --- a/platform/platform-impl/src/com/intellij/remote/BaseRemoteProcessHandler.java +++ b/platform/platform-impl/src/com/intellij/remote/BaseRemoteProcessHandler.java @@ -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 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 extends AbstractR notifyTextAvailable(text, ProcessOutputTypes.STDERR); } + @NotNull @Override - protected Future executeOnPooledThread(Runnable runnable) { + protected Future executeOnPooledThread(@NotNull Runnable runnable) { return BaseRemoteProcessHandler.executeOnPooledThread(runnable); } }; diff --git a/platform/util/src/com/intellij/util/io/BaseDataReader.java b/platform/util/src/com/intellij/util/io/BaseDataReader.java index 974939dc4d42..b0287abd2955 100644 --- a/platform/util/src/com/intellij/util/io/BaseDataReader.java +++ b/platform/util/src/com/intellij/util/io/BaseDataReader.java @@ -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; diff --git a/platform/util/testSrc/com/intellij/util/io/BaseOutputReaderTest.java b/platform/util/testSrc/com/intellij/util/io/BaseOutputReaderTest.java index 2c696b50fde6..c18ecde779b3 100644 --- a/platform/util/testSrc/com/intellij/util/io/BaseOutputReaderTest.java +++ b/platform/util/testSrc/com/intellij/util/io/BaseOutputReaderTest.java @@ -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); } } diff --git a/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/ForkedGroovyc.java b/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/ForkedGroovyc.java index 0cc76b796353..81a1c3749f53 100644 --- a/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/ForkedGroovyc.java +++ b/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/ForkedGroovyc.java @@ -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); } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandProcessHandler.java b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandProcessHandler.java index 7a88a49117f0..f5c2aa4ac961 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandProcessHandler.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandProcessHandler.java @@ -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); } } 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 95441c8600f4..04c82ade65bd 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnProcessHandler.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/SvnProcessHandler.java @@ -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); } } diff --git a/python/pydevSrc/com/jetbrains/python/debugger/pydev/RemoteDebugger.java b/python/pydevSrc/com/jetbrains/python/debugger/pydev/RemoteDebugger.java index 7963431673f2..a1d25fb333d4 100644 --- a/python/pydevSrc/com/jetbrains/python/debugger/pydev/RemoteDebugger.java +++ b/python/pydevSrc/com/jetbrains/python/debugger/pydev/RemoteDebugger.java @@ -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); }