ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r677571 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java
Date Thu, 17 Jul 2008 12:51:50 GMT
Author: bodewig
Date: Thu Jul 17 05:51:49 2008
New Revision: 677571

URL: http://svn.apache.org/viewvc?rev=677571&view=rev
Log:
Swallow stacktrace of timeout exception.  PR 32853.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java?rev=677571&r1=677570&r2=677571&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java Thu Jul 17 05:51:49 2008
@@ -76,6 +76,9 @@
     private boolean spawn = false;
     private boolean incompatibleWithSpawn = false;
 
+    private static final String TIMEOUT_MESSAGE = 
+        "Timeout: killed the sub-process";
+
     /**
      * Normal constructor
      */
@@ -228,7 +231,11 @@
             if (failOnError) {
                 throw e;
             } else {
-                log(e);
+                if (TIMEOUT_MESSAGE.equals(e.getMessage())) {
+                    log(TIMEOUT_MESSAGE);
+                } else {
+                    log(e);
+                }
                 return -1;
             }
         } catch (ThreadDeath t) {
@@ -764,7 +771,7 @@
             exe.execute(getProject());
             redirector.complete();
             if (exe.killedProcess()) {
-                throw new BuildException("Timeout: killed the sub-process");
+                throw new BuildException(TIMEOUT_MESSAGE);
             }
         } catch (IOException e) {
             throw new BuildException(e);
@@ -784,7 +791,7 @@
             int rc = exe.execute();
             redirector.complete();
             if (exe.killedProcess()) {
-                throw new BuildException("Timeout: killed the sub-process");
+                throw new BuildException(TIMEOUT_MESSAGE);
             }
             return rc;
         } catch (IOException e) {



Mime
View raw message