You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2005/05/21 23:14:15 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/condition IsReachable.java

stevel      2005/05/21 14:14:15

  Modified:    src/main/org/apache/tools/ant/taskdefs/condition
                        IsReachable.java
  Log:
  more diagnostics, corrected method name, but not working. Bug#35006
  
  Revision  Changes    Path
  1.2       +3 -1      ant/src/main/org/apache/tools/ant/taskdefs/condition/IsReachable.java
  
  Index: IsReachable.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/IsReachable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IsReachable.java	10 Mar 2005 23:20:03 -0000	1.1
  +++ IsReachable.java	21 May 2005 21:14:15 -0000	1.2
  @@ -81,6 +81,7 @@
       public static final String MSG_NO_REACHABLE_TEST = "cannot do a proper reachability test on this Java version";
       public static final String ERROR_BAD_URL = "Bad URL ";
       public static final String ERROR_NO_HOST_IN_URL = "No hostname in URL ";
  +    private static final String METHOD_NAME = "isReachable";
   
       /**
        * The host to ping.
  @@ -168,7 +169,7 @@
           //Java1.5: reachable = address.isReachable(timeout * 1000);
           Method reachableMethod = null;
           try {
  -            reachableMethod = InetAddress.class.getMethod("reachable",
  +            reachableMethod = InetAddress.class.getMethod(METHOD_NAME,
                       parameterTypes);
               Object[] params = new Object[1];
               params[0] = new Integer(timeout * 1000);
  @@ -187,6 +188,7 @@
               }
           } catch (NoSuchMethodException e) {
               //java1.4 or earlier
  +            log("Not found: InetAddress."+METHOD_NAME,Project.MSG_VERBOSE);
               log(MSG_NO_REACHABLE_TEST);
               reachable = true;
   
  
  
  

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