mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not write output message if timeout is zero
This commit is contained in:
@@ -448,11 +448,15 @@ public class AndroidUtils {
|
||||
@Nullable Integer timeout) throws ExecutionException {
|
||||
LOG.info(commandLine.getCommandLineString());
|
||||
OSProcessHandler handler = new OSProcessHandler(commandLine.createProcess(), "");
|
||||
handler.addProcessListener(new ProcessAdapter() {
|
||||
public void onTextAvailable(final ProcessEvent event, final Key outputType) {
|
||||
messageBuilder.append(event.getText());
|
||||
}
|
||||
});
|
||||
|
||||
if (timeout != null && timeout != 0) {
|
||||
handler.addProcessListener(new ProcessAdapter() {
|
||||
public void onTextAvailable(final ProcessEvent event, final Key outputType) {
|
||||
messageBuilder.append(event.getText());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
handler.startNotify();
|
||||
try {
|
||||
if (timeout != null) {
|
||||
@@ -472,8 +476,11 @@ public class AndroidUtils {
|
||||
return ExecutionStatus.TIMEOUT;
|
||||
}
|
||||
|
||||
String message = messageBuilder.toString();
|
||||
LOG.info(message);
|
||||
if (timeout != null && timeout != 0) {
|
||||
String message = messageBuilder.toString();
|
||||
LOG.info(message);
|
||||
}
|
||||
|
||||
int exitCode = handler.getProcess().exitValue();
|
||||
return exitCode == 0 ? ExecutionStatus.SUCCESS : ExecutionStatus.ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user