mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
Mark blocking runProcess method as RequiresBackgroundThread.
GitOrigin-RevId: 6f6af40da83dc0183e45bf0bcfaf33ac796042f9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a5f20200bb
commit
a253b08348
@@ -185,7 +185,7 @@ public class WSLDistribution implements AbstractWslDistribution {
|
||||
* @param timeout timeout in ms
|
||||
* @param processHandlerConsumer consumes process handler just before execution, may be used for cancellation
|
||||
*/
|
||||
@RequiresBackgroundThread(generateAssertion = false)
|
||||
@RequiresBackgroundThread(generateAssertion = true)
|
||||
public @NotNull ProcessOutput executeOnWsl(@NotNull List<String> command,
|
||||
@NotNull WSLCommandLineOptions options,
|
||||
int timeout,
|
||||
@@ -204,7 +204,7 @@ public class WSLDistribution implements AbstractWslDistribution {
|
||||
return output;
|
||||
}
|
||||
|
||||
@RequiresBackgroundThread(generateAssertion = false)
|
||||
@RequiresBackgroundThread
|
||||
public @NotNull ProcessOutput executeOnWsl(int timeout, @NonNls String @NotNull ... command) throws ExecutionException {
|
||||
return executeOnWsl(Arrays.asList(command), new WSLCommandLineOptions(), timeout, null);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class CapturingProcessHandler extends OSProcessHandler {
|
||||
* Blocks until process finished, returns its output
|
||||
*/
|
||||
@NotNull
|
||||
@RequiresBackgroundThread(generateAssertion = false)
|
||||
@RequiresBackgroundThread
|
||||
public final ProcessOutput runProcess() {
|
||||
return myProcessRunner.runProcess();
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class CapturingProcessHandler extends OSProcessHandler {
|
||||
*
|
||||
* @param timeoutInMilliseconds non-positive means infinity
|
||||
*/
|
||||
@RequiresBackgroundThread(generateAssertion = false)
|
||||
@RequiresBackgroundThread
|
||||
public ProcessOutput runProcess(int timeoutInMilliseconds) {
|
||||
return myProcessRunner.runProcess(timeoutInMilliseconds);
|
||||
}
|
||||
|
||||
@@ -86,20 +86,20 @@ object ExecUtil {
|
||||
|
||||
@JvmStatic
|
||||
@Throws(ExecutionException::class)
|
||||
@RequiresBackgroundThread(generateAssertion = false)
|
||||
@RequiresBackgroundThread(generateAssertion = true)
|
||||
fun execAndGetOutput(commandLine: GeneralCommandLine): ProcessOutput {
|
||||
return CapturingProcessHandler(commandLine).runProcess()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@Throws(ExecutionException::class)
|
||||
@RequiresBackgroundThread(generateAssertion = false)
|
||||
@RequiresBackgroundThread(generateAssertion = true)
|
||||
fun execAndGetOutput(commandLine: GeneralCommandLine, timeoutInMilliseconds: Int): ProcessOutput {
|
||||
return CapturingProcessHandler(commandLine).runProcess(timeoutInMilliseconds)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@RequiresBackgroundThread(generateAssertion = false)
|
||||
@RequiresBackgroundThread(generateAssertion = true)
|
||||
fun execAndGetOutput(commandLine: GeneralCommandLine, stdin: String): String {
|
||||
return CapturingProcessHandler(commandLine).also { processHandler ->
|
||||
processHandler.addProcessListener(object : ProcessAdapter() {
|
||||
@@ -113,7 +113,7 @@ object ExecUtil {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@RequiresBackgroundThread(generateAssertion = false)
|
||||
@RequiresBackgroundThread(generateAssertion = true)
|
||||
fun execAndReadLine(commandLine: GeneralCommandLine): String? {
|
||||
return try {
|
||||
readFirstLine(commandLine.createProcess().inputStream, commandLine.charset)
|
||||
@@ -125,7 +125,7 @@ object ExecUtil {
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
@RequiresBackgroundThread(generateAssertion = false)
|
||||
@RequiresBackgroundThread(generateAssertion = true)
|
||||
@JvmStatic
|
||||
fun readFirstLine(stream: InputStream, cs: Charset?): String? {
|
||||
return try {
|
||||
|
||||
Reference in New Issue
Block a user