bodewig     2005/02/18 03:04:28

  Modified:    .        Tag: ANT_16_BRANCH WHATSNEW
               src/main/org/apache/tools/ant/taskdefs/optional/net Tag:
                        ANT_16_BRANCH RExecTask.java TelnetTask.java
  Log:
  merge
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.503.2.177 +4 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.176
  retrieving revision 1.503.2.177
  diff -u -r1.503.2.176 -r1.503.2.177
  --- WHATSNEW  14 Feb 2005 22:05:31 -0000      1.503.2.176
  +++ WHATSNEW  18 Feb 2005 11:04:28 -0000      1.503.2.177
  @@ -200,6 +200,10 @@
     <exec>, <apply>, or <java> tasks was always logged to System.out
     instead of to the managing Task.
   
  +* <telnet> and <rexec> would try to disconnect from servers they never
  +  connetced to, potentially leading to exceptions in commons-net.
  +  Bugzilla Report 33618.
  +
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===================================
   
  
  
  
  No                   revision
  No                   revision
  1.4.2.5   +10 -10    
ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java
  
  Index: RExecTask.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java,v
  retrieving revision 1.4.2.4
  retrieving revision 1.4.2.5
  diff -u -r1.4.2.4 -r1.4.2.5
  --- RExecTask.java    23 Jun 2004 12:32:03 -0000      1.4.2.4
  +++ RExecTask.java    18 Feb 2005 11:04:28 -0000      1.4.2.5
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2003-2004 The Apache Software Foundation
  + * Copyright  2003-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -342,15 +342,15 @@
               /** Keep reading input stream until end of it or time-out */
               rexec.waitForEOF(defaultTimeout);
          } finally {
  -           if (rexec != null) {
  -               try {
  -                   rexec.disconnect();
  -               } catch (IOException e) {
  -                   throw new BuildException("Error disconnecting from " 
  -                                            + server);
  -               }
  -           }
  -       }
  +            if (rexec != null && rexec.isConnected()) {
  +                try {
  +                    rexec.disconnect();
  +                } catch (IOException e) {
  +                    throw new BuildException("Error disconnecting from "
  +                                             + server);
  +                }
  +            }
  +        }
       }
       /**
        *  Process a 'typical' login.  If it differs, use the read
  
  
  
  1.20.2.7  +3 -3      
ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
  
  Index: TelnetTask.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java,v
  retrieving revision 1.20.2.6
  retrieving revision 1.20.2.7
  diff -u -r1.20.2.6 -r1.20.2.7
  --- TelnetTask.java   23 Jun 2004 12:26:35 -0000      1.20.2.6
  +++ TelnetTask.java   18 Feb 2005 11:04:28 -0000      1.20.2.7
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000,2002-2004 The Apache Software Foundation
  + * Copyright  2000,2002-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -114,7 +114,7 @@
                  task.execute(telnet);
              }
          } finally {
  -           if (telnet != null) {
  +           if (telnet != null && telnet.isConnected()) {
                  try {
                      telnet.disconnect();
                  } catch (IOException e) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to