james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1225507 - in /james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j: dom/Message.java field/Fields.java message/AbstractMessage.java message/MessageImpl.java
Date Thu, 29 Dec 2011 12:33:09 GMT
Author: olegk
Date: Thu Dec 29 12:33:08 2011
New Revision: 1225507

URL: http://svn.apache.org/viewvc?rev=1225507&view=rev
Log:
Fixed the use of generic collection parameters in Message and related classes

Modified:
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Message.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageImpl.java

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Message.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Message.java?rev=1225507&r1=1225506&r2=1225507&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Message.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Message.java Thu Dec
29 12:33:08 2011
@@ -199,7 +199,7 @@ public interface Message extends Entity,
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
      */
-    void setTo(Collection<Address> to);
+    void setTo(Collection<? extends Address> to);
 
     /**
      * Returns the value of the <i>Cc</i> header field of this message as
@@ -238,7 +238,7 @@ public interface Message extends Entity,
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
      */
-    void setCc(Collection<Address> cc);
+    void setCc(Collection<? extends Address> cc);
 
     /**
      * Returns the value of the <i>Bcc</i> header field of this message as
@@ -277,7 +277,7 @@ public interface Message extends Entity,
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
      */
-    void setBcc(Collection<Address> bcc);
+    void setBcc(Collection<? extends Address> bcc);
 
     /**
      * Returns the value of the <i>Reply-To</i> header field of this message
as
@@ -316,6 +316,6 @@ public interface Message extends Entity,
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
      */
-    void setReplyTo(Collection<Address> replyTo);
+    void setReplyTo(Collection<? extends Address> replyTo);
 
 }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java?rev=1225507&r1=1225506&r2=1225507&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java Thu Dec
29 12:33:08 2011
@@ -561,7 +561,7 @@ public class Fields {
      * @return the newly created address-list field.
      */
     public static AddressListField addressList(String fieldName,
-            Iterable<Address> addresses) {
+            Iterable<? extends Address> addresses) {
         checkValidFieldName(fieldName);
         return addressList0(fieldName, addresses);
     }
@@ -584,7 +584,7 @@ public class Fields {
     }
 
     private static AddressListField addressList0(String fieldName,
-            Iterable<Address> addresses) {
+            Iterable<? extends Address> addresses) {
         String fieldValue = encodeAddresses(addresses);
         return parse(AddressListFieldImpl.PARSER, fieldName, fieldValue);
     }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java?rev=1225507&r1=1225506&r2=1225507&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java
Thu Dec 29 12:33:08 2011
@@ -271,7 +271,7 @@ public abstract class AbstractMessage ex
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
      */
-    public void setTo(Collection<Address> to) {
+    public void setTo(Collection<? extends Address> to) {
         setAddressList(FieldName.TO, to);
     }
 
@@ -318,7 +318,7 @@ public abstract class AbstractMessage ex
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
      */
-    public void setCc(Collection<Address> cc) {
+    public void setCc(Collection<? extends Address> cc) {
         setAddressList(FieldName.CC, cc);
     }
 
@@ -365,7 +365,7 @@ public abstract class AbstractMessage ex
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
      */
-    public void setBcc(Collection<Address> bcc) {
+    public void setBcc(Collection<? extends Address> bcc) {
         setAddressList(FieldName.BCC, bcc);
     }
 
@@ -412,7 +412,7 @@ public abstract class AbstractMessage ex
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
      */
-    public void setReplyTo(Collection<Address> replyTo) {
+    public void setReplyTo(Collection<? extends Address> replyTo) {
         setAddressList(FieldName.REPLY_TO, replyTo);
     }
 
@@ -480,7 +480,7 @@ public abstract class AbstractMessage ex
                 .asList(addresses));
     }
 
-    private void setAddressList(String fieldName, Collection<Address> addresses) {
+    private void setAddressList(String fieldName, Collection<? extends Address> addresses)
{
         Header header = obtainHeader();
 
         if (addresses == null || addresses.isEmpty()) {
@@ -490,7 +490,7 @@ public abstract class AbstractMessage ex
         }
     }
 
-    protected abstract AddressListField newAddressList(String fieldName, Collection<Address>
addresses);
+    protected abstract AddressListField newAddressList(String fieldName, Collection<?
extends Address> addresses);
 
     protected abstract UnstructuredField newSubject(String subject);
 

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageImpl.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageImpl.java?rev=1225507&r1=1225506&r2=1225507&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageImpl.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageImpl.java
Thu Dec 29 12:33:08 2011
@@ -88,7 +88,7 @@ public class MessageImpl extends Abstrac
 
     @Override
     protected AddressListField newAddressList(String fieldName,
-            Collection<Address> addresses) {
+            Collection<? extends Address> addresses) {
         return Fields.addressList(fieldName, addresses);
     }
 



Mime
View raw message