commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/smtp SMTP.java
Date Tue, 05 Oct 2004 17:40:25 GMT
dfs         2004/10/05 10:40:25

  Modified:    net/src/java/examples mail.java
               net/src/java/org/apache/commons/net
                        ProtocolCommandSupport.java
               net/src/java/org/apache/commons/net/ftp FTP.java
               net/src/java/org/apache/commons/net/pop3 POP3.java
                        POP3Client.java
               net/src/java/org/apache/commons/net/smtp SMTP.java
  Log:
  I changed all variables named 'enum' to 'en' to enable compilation
  under JDK 1.5, where enum is a reserved word.  This issue was brought
  to light by http://issues.apache.org/bugzilla/show_bug.cgi?id=31516.
  After making the changes, I built the source from scratch using JDK
  1.5 and it compiled without errors.
  
  Revision  Changes    Path
  1.9       +4 -4      jakarta-commons/net/src/java/examples/mail.java
  
  Index: mail.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/examples/mail.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mail.java	29 Feb 2004 10:26:53 -0000	1.8
  +++ mail.java	5 Oct 2004 17:40:24 -0000	1.9
  @@ -48,7 +48,7 @@
           Writer writer;
           SimpleSMTPHeader header;
           SMTPClient client;
  -        Enumeration enum;
  +        Enumeration en;
   
           if (args.length < 1)
           {
  @@ -127,10 +127,10 @@
               client.setSender(sender);
               client.addRecipient(recipient);
   
  -            enum = ccList.elements();
  +            en = ccList.elements();
   
  -            while (enum.hasMoreElements())
  -                client.addRecipient((String)enum.nextElement());
  +            while (en.hasMoreElements())
  +                client.addRecipient((String)en.nextElement());
   
               writer = client.sendMessageData();
   
  
  
  
  1.8       +8 -8      jakarta-commons/net/src/java/org/apache/commons/net/ProtocolCommandSupport.java
  
  Index: ProtocolCommandSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ProtocolCommandSupport.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ProtocolCommandSupport.java	29 Jun 2004 04:54:30 -0000	1.7
  +++ ProtocolCommandSupport.java	5 Oct 2004 17:40:24 -0000	1.8
  @@ -62,17 +62,17 @@
        ***/
       public void fireCommandSent(String command, String message)
       {
  -        Enumeration enum;
  +        Enumeration en;
           ProtocolCommandEvent event;
           ProtocolCommandListener listener;
   
  -        enum = __listeners.getListeners();
  +        en = __listeners.getListeners();
   
           event = new ProtocolCommandEvent(__source, command, message);
   
  -        while (enum.hasMoreElements())
  +        while (en.hasMoreElements())
           {
  -            listener = (ProtocolCommandListener)enum.nextElement();
  +            listener = (ProtocolCommandListener)en.nextElement();
               listener.protocolCommandSent(event);
           }
       }
  @@ -92,17 +92,17 @@
        ***/
       public void fireReplyReceived(int replyCode, String message)
       {
  -        Enumeration enum;
  +        Enumeration en;
           ProtocolCommandEvent event;
           ProtocolCommandListener listener;
   
  -        enum = __listeners.getListeners();
  +        en = __listeners.getListeners();
   
           event = new ProtocolCommandEvent(__source, replyCode, message);
   
  -        while (enum.hasMoreElements())
  +        while (en.hasMoreElements())
           {
  -            listener = (ProtocolCommandListener)enum.nextElement();
  +            listener = (ProtocolCommandListener)en.nextElement();
               listener.protocolReplyReceived(event);
           }
       }
  
  
  
  1.17      +4 -4      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTP.java
  
  Index: FTP.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTP.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- FTP.java	8 Aug 2004 20:38:35 -0000	1.16
  +++ FTP.java	5 Oct 2004 17:40:24 -0000	1.17
  @@ -580,17 +580,17 @@
        ***/
       public String getReplyString()
       {
  -        Enumeration enum;
  +        Enumeration en;
           StringBuffer buffer;
   
           if (!_newReplyString)
               return _replyString;
   
           buffer = new StringBuffer(256);
  -        enum = _replyLines.elements();
  -        while (enum.hasMoreElements())
  +        en = _replyLines.elements();
  +        while (en.hasMoreElements())
           {
  -            buffer.append((String)enum.nextElement());
  +            buffer.append((String)en.nextElement());
               buffer.append(SocketClient.NETASCII_EOL);
           }
   
  
  
  
  1.11      +4 -4      jakarta-commons/net/src/java/org/apache/commons/net/pop3/POP3.java
  
  Index: POP3.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/pop3/POP3.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- POP3.java	29 Jun 2004 04:54:31 -0000	1.10
  +++ POP3.java	5 Oct 2004 17:40:24 -0000	1.11
  @@ -337,13 +337,13 @@
        ***/
       public String getReplyString()
       {
  -        Enumeration enum;
  +        Enumeration en;
           StringBuffer buffer = new StringBuffer(256);
   
  -        enum = _replyLines.elements();
  -        while (enum.hasMoreElements())
  +        en = _replyLines.elements();
  +        while (en.hasMoreElements())
           {
  -            buffer.append((String)enum.nextElement());
  +            buffer.append((String)en.nextElement());
               buffer.append(SocketClient.NETASCII_EOL);
           }
   
  
  
  
  1.10      +8 -8      jakarta-commons/net/src/java/org/apache/commons/net/pop3/POP3Client.java
  
  Index: POP3Client.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/pop3/POP3Client.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- POP3Client.java	29 Jun 2004 04:54:31 -0000	1.9
  +++ POP3Client.java	5 Oct 2004 17:40:24 -0000	1.10
  @@ -366,7 +366,7 @@
       public POP3MessageInfo[] listMessages() throws IOException
       {
           POP3MessageInfo[] messages;
  -        Enumeration enum;
  +        Enumeration en;
           int line;
   
           if (getState() != TRANSACTION_STATE)
  @@ -377,14 +377,14 @@
   
           // This could be a zero length array if no messages present
           messages = new POP3MessageInfo[_replyLines.size() - 2];
  -        enum = _replyLines.elements();
  +        en = _replyLines.elements();
   
           // Skip first line
  -        enum.nextElement();
  +        en.nextElement();
   
           // Fetch lines.
           for (line = 0; line < messages.length; line++)
  -            messages[line] = __parseStatus((String)enum.nextElement());
  +            messages[line] = __parseStatus((String)en.nextElement());
   
           return messages;
       }
  @@ -438,7 +438,7 @@
       public POP3MessageInfo[] listUniqueIdentifiers() throws IOException
       {
           POP3MessageInfo[] messages;
  -        Enumeration enum;
  +        Enumeration en;
           int line;
   
           if (getState() != TRANSACTION_STATE)
  @@ -449,14 +449,14 @@
   
           // This could be a zero length array if no messages present
           messages = new POP3MessageInfo[_replyLines.size() - 2];
  -        enum = _replyLines.elements();
  +        en = _replyLines.elements();
   
           // Skip first line
  -        enum.nextElement();
  +        en.nextElement();
   
           // Fetch lines.
           for (line = 0; line < messages.length; line++)
  -            messages[line] = __parseUID((String)enum.nextElement());
  +            messages[line] = __parseUID((String)en.nextElement());
   
           return messages;
       }
  
  
  
  1.13      +4 -4      jakarta-commons/net/src/java/org/apache/commons/net/smtp/SMTP.java
  
  Index: SMTP.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/smtp/SMTP.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SMTP.java	29 Jun 2004 04:54:31 -0000	1.12
  +++ SMTP.java	5 Oct 2004 17:40:24 -0000	1.13
  @@ -438,17 +438,17 @@
        ***/
       public String getReplyString()
       {
  -        Enumeration enum;
  +        Enumeration en;
           StringBuffer buffer;
   
           if (!_newReplyString)
               return _replyString;
   
           buffer = new StringBuffer(256);
  -        enum = _replyLines.elements();
  -        while (enum.hasMoreElements())
  +        en = _replyLines.elements();
  +        while (en.hasMoreElements())
           {
  -            buffer.append((String)enum.nextElement());
  +            buffer.append((String)en.nextElement());
               buffer.append(SocketClient.NETASCII_EOL);
           }
   
  
  
  

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


Mime
View raw message