ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r577765 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs: ProcessDestroyer.java Redirector.java optional/net/TelnetTask.java optional/splash/SplashTask.java optional/ssh/SSHExec.java
Date Thu, 20 Sep 2007 14:26:16 GMT
Author: jhm
Date: Thu Sep 20 07:26:16 2007
New Revision: 577765

URL: http://svn.apache.org/viewvc?rev=577765&view=rev
Log:
Use better constant names.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Redirector.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java?rev=577765&r1=577764&r2=577765&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java Thu Sep 20
07:26:16 2007
@@ -29,7 +29,7 @@
  * @since Ant 1.5
  */
 class ProcessDestroyer implements Runnable {
-    private static final int TWENTY_SECONDS = 20000;
+    private static final int THREAD_DIE_TIMEOUT = 20000;
     private Vector processes = new Vector();
     // methods to register and unregister shutdown hooks
     private Method addShutdownHookMethod;
@@ -150,7 +150,7 @@
             }
             // this should return quickly, since it basically is a NO-OP.
             try {
-                destroyProcessThread.join(TWENTY_SECONDS);
+                destroyProcessThread.join(THREAD_DIE_TIMEOUT);
             } catch (InterruptedException ie) {
                 // the thread didn't die in time
                 // it should not kill any processes unexpectedly

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Redirector.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Redirector.java?rev=577765&r1=577764&r2=577765&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Redirector.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Redirector.java Thu Sep 20 07:26:16
2007
@@ -53,7 +53,7 @@
  * @since Ant 1.6
  */
 public class Redirector {
-    private static final int ONE_SECOND = 1000;
+    private static final int STREAMPUMPER_WAIT_INTERVAL = 1000;
 
     private static final String DEFAULT_ENCODING
         = System.getProperty("file.encoding");
@@ -780,7 +780,7 @@
                         // Ignore exception
                     }
                 }
-                wait(ONE_SECOND);
+                wait(STREAMPUMPER_WAIT_INTERVAL);
             } catch (InterruptedException eyeEx) {
                 Thread[] thread = new Thread[threadGroup.activeCount()];
                 threadGroup.enumerate(thread);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java?rev=577765&r1=577764&r2=577765&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java Thu
Sep 20 07:26:16 2007
@@ -35,7 +35,7 @@
  */
 
 public class TelnetTask extends Task {
-    private static final int QUARTER_SECOND = 250;
+    private static final int WAIT_INTERVAL = 250;
     private static final int TELNET_PORT = 23;
 
     /**
@@ -350,7 +350,7 @@
                     while (sb.toString().indexOf(s) == -1) {
                         while (Calendar.getInstance().before(endTime)
                                && is.available() == 0) {
-                            Thread.sleep(QUARTER_SECOND);
+                            Thread.sleep(WAIT_INTERVAL);
                         }
                         if (is.available() == 0) {
                             log("Read before running into timeout: "

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java?rev=577765&r1=577764&r2=577765&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
Thu Sep 20 07:26:16 2007
@@ -38,14 +38,14 @@
  * @since Ant1.5
  */
 public class SplashTask extends Task {
-    private static final int FIVE_SECONDS = 5000;
+    private static final int DEFAULT_SHOW_DURATION = 5000;
 
     private String imgurl = null;
     private String proxy = null;
     private String user = null;
     private String password = null;
     private String port = "80";
-    private int showDuration = FIVE_SECONDS;
+    private int showDuration = DEFAULT_SHOW_DURATION;
     private boolean useProxy = false;
 
     private static SplashScreen splash = null;

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java?rev=577765&r1=577764&r2=577765&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java Thu Sep
20 07:26:16 2007
@@ -45,7 +45,7 @@
 public class SSHExec extends SSHBase {
 
     private static final int BUFFER_SIZE = 8192;
-    private static final int HALF_SECOND = 500;
+    private static final int RETRY_INTERVAL = 500;
 
     /** the command to execute via ssh */
     private String command = null;
@@ -195,7 +195,7 @@
                                 return;
                             }
                             try {
-                                sleep(HALF_SECOND);
+                                sleep(RETRY_INTERVAL);
                             } catch (Exception e) {
                                 // ignored
                             }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message