Browse Source

Use better constant names.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@577765 13f79535-47bb-0310-9956-ffa450edef68
master
Jan Materne 18 years ago
parent
commit
79c6e8371a
5 changed files with 10 additions and 10 deletions
  1. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
  2. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Redirector.java
  3. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
  4. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
  5. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java

+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java View File

@@ -29,7 +29,7 @@ import java.util.Vector;
* @since Ant 1.5 * @since Ant 1.5
*/ */
class ProcessDestroyer implements Runnable { class ProcessDestroyer implements Runnable {
private static final int TWENTY_SECONDS = 20000;
private static final int THREAD_DIE_TIMEOUT = 20000;
private Vector processes = new Vector(); private Vector processes = new Vector();
// methods to register and unregister shutdown hooks // methods to register and unregister shutdown hooks
private Method addShutdownHookMethod; private Method addShutdownHookMethod;
@@ -150,7 +150,7 @@ class ProcessDestroyer implements Runnable {
} }
// this should return quickly, since it basically is a NO-OP. // this should return quickly, since it basically is a NO-OP.
try { try {
destroyProcessThread.join(TWENTY_SECONDS);
destroyProcessThread.join(THREAD_DIE_TIMEOUT);
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
// the thread didn't die in time // the thread didn't die in time
// it should not kill any processes unexpectedly // it should not kill any processes unexpectedly


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Redirector.java View File

@@ -53,7 +53,7 @@ import org.apache.tools.ant.util.KeepAliveOutputStream;
* @since Ant 1.6 * @since Ant 1.6
*/ */
public class Redirector { public class Redirector {
private static final int ONE_SECOND = 1000;
private static final int STREAMPUMPER_WAIT_INTERVAL = 1000;


private static final String DEFAULT_ENCODING private static final String DEFAULT_ENCODING
= System.getProperty("file.encoding"); = System.getProperty("file.encoding");
@@ -780,7 +780,7 @@ public class Redirector {
// Ignore exception // Ignore exception
} }
} }
wait(ONE_SECOND);
wait(STREAMPUMPER_WAIT_INTERVAL);
} catch (InterruptedException eyeEx) { } catch (InterruptedException eyeEx) {
Thread[] thread = new Thread[threadGroup.activeCount()]; Thread[] thread = new Thread[threadGroup.activeCount()];
threadGroup.enumerate(thread); threadGroup.enumerate(thread);


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java View File

@@ -35,7 +35,7 @@ import org.apache.tools.ant.Task;
*/ */


public class TelnetTask extends Task { 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; private static final int TELNET_PORT = 23;


/** /**
@@ -350,7 +350,7 @@ public class TelnetTask extends Task {
while (sb.toString().indexOf(s) == -1) { while (sb.toString().indexOf(s) == -1) {
while (Calendar.getInstance().before(endTime) while (Calendar.getInstance().before(endTime)
&& is.available() == 0) { && is.available() == 0) {
Thread.sleep(QUARTER_SECOND);
Thread.sleep(WAIT_INTERVAL);
} }
if (is.available() == 0) { if (is.available() == 0) {
log("Read before running into timeout: " log("Read before running into timeout: "


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java View File

@@ -38,14 +38,14 @@ import org.apache.tools.ant.util.Base64Converter;
* @since Ant1.5 * @since Ant1.5
*/ */
public class SplashTask extends Task { 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 imgurl = null;
private String proxy = null; private String proxy = null;
private String user = null; private String user = null;
private String password = null; private String password = null;
private String port = "80"; private String port = "80";
private int showDuration = FIVE_SECONDS;
private int showDuration = DEFAULT_SHOW_DURATION;
private boolean useProxy = false; private boolean useProxy = false;


private static SplashScreen splash = null; private static SplashScreen splash = null;


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java View File

@@ -45,7 +45,7 @@ import com.jcraft.jsch.Session;
public class SSHExec extends SSHBase { public class SSHExec extends SSHBase {


private static final int BUFFER_SIZE = 8192; 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 */ /** the command to execute via ssh */
private String command = null; private String command = null;
@@ -195,7 +195,7 @@ public class SSHExec extends SSHBase {
return; return;
} }
try { try {
sleep(HALF_SECOND);
sleep(RETRY_INTERVAL);
} catch (Exception e) { } catch (Exception e) {
// ignored // ignored
} }


Loading…
Cancel
Save