james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r731267 - in /james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util: FetchGroupImpl.java MailboxListenerCollector.java
Date Sun, 04 Jan 2009 15:11:50 GMT
Author: rdonkin
Date: Sun Jan  4 07:11:50 2009
New Revision: 731267

URL: http://svn.apache.org/viewvc?rev=731267&view=rev
Log:
Switch to generics

Modified:
    james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/FetchGroupImpl.java
    james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxListenerCollector.java

Modified: james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/FetchGroupImpl.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/FetchGroupImpl.java?rev=731267&r1=731266&r2=731267&view=diff
==============================================================================
--- james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/FetchGroupImpl.java
(original)
+++ james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/FetchGroupImpl.java
Sun Jan  4 07:11:50 2009
@@ -55,7 +55,7 @@
 
     private int content = MessageResult.FetchGroup.MINIMAL;
 
-    private Set partContentDescriptors;
+    private Set<PartContentDescriptor> partContentDescriptors;
 
     public FetchGroupImpl() {
         super();
@@ -66,7 +66,7 @@
         this.content = content;
     }
 
-    public FetchGroupImpl(int content, Set partContentDescriptors) {
+    public FetchGroupImpl(int content, Set<PartContentDescriptor> partContentDescriptors)
{
         super();
         this.content = content;
         this.partContentDescriptors = partContentDescriptors;
@@ -90,7 +90,7 @@
      * @return <code>Set</code> of {@link FetchGroup.PartContentDescriptor},
      *         possibly null
      */
-    public Set getPartContentDescriptors() {
+    public Set<PartContentDescriptor> getPartContentDescriptors() {
         return partContentDescriptors;
     }
 
@@ -104,7 +104,7 @@
      */
     public void addPartContent(MimePath path, int content) {
         if (partContentDescriptors == null) {
-            partContentDescriptors = new HashSet();
+            partContentDescriptors = new HashSet<PartContentDescriptor>();
         }
         PartContentDescriptorImpl currentDescriptor = null;
         for (Iterator it = partContentDescriptors.iterator(); it.hasNext();) {

Modified: james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxListenerCollector.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxListenerCollector.java?rev=731267&r1=731266&r2=731267&view=diff
==============================================================================
--- james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxListenerCollector.java
(original)
+++ james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxListenerCollector.java
Sun Jan  4 07:11:50 2009
@@ -28,11 +28,11 @@
 
 public class MailboxListenerCollector implements MailboxListener {
 
-    protected List addedList = new ArrayList();
+    protected List<Long> addedList = new ArrayList<Long>();
 
-    protected List expungedList = new ArrayList();
+    protected List<Long> expungedList = new ArrayList<Long>();
 
-    protected List flaggedList = new ArrayList();
+    protected List<MessageFlags> flaggedList = new ArrayList<MessageFlags>();
 
     public void added(final long uid) {
         addedList.add(new Long(uid));
@@ -46,26 +46,26 @@
         flaggedList.add(new MessageFlags(uid, flags));
     }
 
-    public synchronized List getAddedList(boolean reset) {
-        List list = addedList;
+    public synchronized List<Long> getAddedList(boolean reset) {
+        final List<Long> list = addedList;
         if (reset) {
-            addedList = new ArrayList();
+            addedList = new ArrayList<Long>();
         }
         return list;
     }
 
-    public synchronized List getExpungedList(boolean reset) {
-        List list = expungedList;
+    public synchronized List<Long> getExpungedList(boolean reset) {
+        final List<Long> list = expungedList;
         if (reset) {
-            expungedList = new ArrayList();
+            expungedList = new ArrayList<Long>();
         }
         return list;
     }
 
-    public synchronized List getFlaggedList(boolean reset) {
-        List list = flaggedList;
+    public synchronized List<MessageFlags> getFlaggedList(boolean reset) {
+        final List<MessageFlags> list = flaggedList;
         if (reset) {
-            flaggedList = new ArrayList();
+            flaggedList = new ArrayList<MessageFlags>();
         }
         return list;
     }
@@ -88,7 +88,7 @@
             } else if (event instanceof Expunged) {
                 expunged(uid);
             } else if (event instanceof FlagsUpdated) {
-                FlagsUpdated flagsUpdated = (FlagsUpdated) messageEvent;
+                final FlagsUpdated flagsUpdated = (FlagsUpdated) messageEvent;
                 final Flags newFlags = flagsUpdated.getNewFlags();
                 flagsUpdated(uid, newFlags);
             }



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


Mime
View raw message