geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r702234 - /geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java
Date Mon, 06 Oct 2008 19:25:42 GMT
Author: rickmcguire
Date: Mon Oct  6 12:25:41 2008
New Revision: 702234

URL: http://svn.apache.org/viewvc?rev=702234&view=rev
Log:
GERONIMO-4339 Calling MimeMessage#setRecipients with empty array causes ArrayOutOfBoundsException
Patch provided by Andreas Velthen


Modified:
    geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java

Modified: geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java?rev=702234&r1=702233&r2=702234&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java
(original)
+++ geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java
Mon Oct  6 12:25:41 2008
@@ -579,18 +579,19 @@
      * @param addresses The list of addresses to set.
      */
     void setHeader(String name, Address[] addresses) {
-        // if this is empty, then ew need to replace this
+        // if this is empty, then we need to replace this
         if (addresses.length == 0) {
             removeHeader(name);
-        }
-
-        // replace the first header
-        setHeader(name, addresses[0].toString());
-
-        // now add the rest as extra headers.
-        for (int i = 1; i < addresses.length; i++) {
-            Address address = addresses[i];
-            addHeader(name, address.toString());
+        } else {
+    
+            // replace the first header
+            setHeader(name, addresses[0].toString());
+    
+            // now add the rest as extra headers.
+            for (int i = 1; i < addresses.length; i++) {
+                Address address = addresses[i];
+                addHeader(name, address.toString());
+            }
         }
     }
 



Mime
View raw message