ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/net TelnetTask.java
Date Wed, 23 Jun 2004 12:25:05 GMT
bodewig     2004/06/23 05:25:05

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs/optional/net
                        TelnetTask.java
  Log:
  Indentation of telnet tasks, record bug fix
  
  Revision  Changes    Path
  1.628     +2 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.627
  retrieving revision 1.628
  diff -u -r1.627 -r1.628
  --- WHATSNEW	22 Jun 2004 19:38:02 -0000	1.627
  +++ WHATSNEW	23 Jun 2004 12:25:04 -0000	1.628
  @@ -151,6 +151,8 @@
   * <scp> now has (local|remote)tofile attributes to rename files on the
     fly.  Bugzilla Report 26758.
   
  +* <telnet> didn't close the session.  Bugzilla Report 25935.
  +
   Other changes:
   --------------
   * doc fix concerning the dependencies of the ftp task
  
  
  
  1.28      +18 -18    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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- TelnetTask.java	23 Jun 2004 12:23:22 -0000	1.27
  +++ TelnetTask.java	23 Jun 2004 12:25:05 -0000	1.28
  @@ -95,24 +95,24 @@
          AntTelnetClient telnet = null;
          try {
              telnet = new AntTelnetClient();
  -       try {
  -           telnet.connect(server, port);
  -       } catch (IOException e) {
  -           throw new BuildException("Can't connect to " + server);
  -       }
  -       /**  Login if userid and password were specified */
  -       if (userid != null && password != null) {
  -          login(telnet);
  -       }
  -       /**  Process each sub command */
  -       Enumeration tasksToRun = telnetTasks.elements();
  -       while (tasksToRun != null && tasksToRun.hasMoreElements()) {
  -           TelnetSubTask task = (TelnetSubTask) tasksToRun.nextElement();
  -           if (task instanceof TelnetRead && defaultTimeout != null) {
  -               ((TelnetRead) task).setDefaultTimeout(defaultTimeout);
  +           try {
  +               telnet.connect(server, port);
  +           } catch (IOException e) {
  +               throw new BuildException("Can't connect to " + server);
  +           }
  +           /**  Login if userid and password were specified */
  +           if (userid != null && password != null) {
  +               login(telnet);
  +           }
  +           /**  Process each sub command */
  +           Enumeration tasksToRun = telnetTasks.elements();
  +           while (tasksToRun != null && tasksToRun.hasMoreElements()) {
  +               TelnetSubTask task = (TelnetSubTask) tasksToRun.nextElement();
  +               if (task instanceof TelnetRead && defaultTimeout != null) {
  +                   ((TelnetRead) task).setDefaultTimeout(defaultTimeout);
  +               }
  +               task.execute(telnet);
              }
  -           task.execute(telnet);
  -       }
          } finally {
              if (telnet != null) {
                  try {
  
  
  

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


Mime
View raw message