Browse Source

Swallow stacktrace of timeout exception. PR 32853.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@677571 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
7ecb89e1df
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      src/main/org/apache/tools/ant/taskdefs/Java.java

+ 10
- 3
src/main/org/apache/tools/ant/taskdefs/Java.java View File

@@ -76,6 +76,9 @@ public class Java extends Task {
private boolean spawn = false; private boolean spawn = false;
private boolean incompatibleWithSpawn = false; private boolean incompatibleWithSpawn = false;


private static final String TIMEOUT_MESSAGE =
"Timeout: killed the sub-process";

/** /**
* Normal constructor * Normal constructor
*/ */
@@ -228,7 +231,11 @@ public class Java extends Task {
if (failOnError) { if (failOnError) {
throw e; throw e;
} else { } else {
log(e);
if (TIMEOUT_MESSAGE.equals(e.getMessage())) {
log(TIMEOUT_MESSAGE);
} else {
log(e);
}
return -1; return -1;
} }
} catch (ThreadDeath t) { } catch (ThreadDeath t) {
@@ -764,7 +771,7 @@ public class Java extends Task {
exe.execute(getProject()); exe.execute(getProject());
redirector.complete(); redirector.complete();
if (exe.killedProcess()) { if (exe.killedProcess()) {
throw new BuildException("Timeout: killed the sub-process");
throw new BuildException(TIMEOUT_MESSAGE);
} }
} catch (IOException e) { } catch (IOException e) {
throw new BuildException(e); throw new BuildException(e);
@@ -784,7 +791,7 @@ public class Java extends Task {
int rc = exe.execute(); int rc = exe.execute();
redirector.complete(); redirector.complete();
if (exe.killedProcess()) { if (exe.killedProcess()) {
throw new BuildException("Timeout: killed the sub-process");
throw new BuildException(TIMEOUT_MESSAGE);
} }
return rc; return rc;
} catch (IOException e) { } catch (IOException e) {


Loading…
Cancel
Save