james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1078874 - in /james/mailbox/trunk/store: pom.xml src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
Date Mon, 07 Mar 2011 18:08:12 GMT
Author: felixk
Date: Mon Mar  7 18:08:11 2011
New Revision: 1078874

URL: http://svn.apache.org/viewvc?rev=1078874&view=rev
Log:
This seems to cause the mailbox-integration-test failures.
"public Iterator<MessageResult> getMessages(...)" may now return a null
value, which wasn't the case before commit 1078490 [1]. It should IMO at least an
EmptyIterator instead of a null value.

[1] http://svn.apache.org/viewvc?rev=1078490&view=rev

Modified:
    james/mailbox/trunk/store/pom.xml
    james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java

Modified: james/mailbox/trunk/store/pom.xml
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/pom.xml?rev=1078874&r1=1078873&r2=1078874&view=diff
==============================================================================
--- james/mailbox/trunk/store/pom.xml (original)
+++ james/mailbox/trunk/store/pom.xml Mon Mar  7 18:08:11 2011
@@ -53,6 +53,10 @@
       <artifactId>lucene-analyzers</artifactId>
     </dependency>
     <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java?rev=1078874&r1=1078873&r2=1078874&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
(original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
Mon Mar  7 18:08:11 2011
@@ -38,6 +38,7 @@ import javax.mail.Flags;
 import javax.mail.Flags.Flag;
 import javax.mail.util.SharedFileInputStream;
 
+import org.apache.commons.collections.iterators.EmptyIterator;
 import org.apache.james.mailbox.MailboxException;
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxSession;
@@ -485,7 +486,11 @@ public abstract class StoreMessageManage
                 iterator = it;
             }
 
+            @SuppressWarnings("unchecked")
             public Iterator<MessageResult> getIterator() {
+        	if (iterator == null) {
+        	    return (Iterator<MessageResult>)EmptyIterator.INSTANCE;
+        	}
                 return iterator;
             }
         }



---------------------------------------------------------------------
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