james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r772770 - in /james/imap/trunk: api/src/main/java/org/apache/james/imap/api/process/ processor/src/main/java/org/apache/james/imap/processor/ processor/src/main/java/org/apache/james/imap/processor/base/ seda/src/test/resources/org/apache/j...
Date Thu, 07 May 2009 20:54:28 GMT
Author: rdonkin
Date: Thu May  7 20:54:28 2009
New Revision: 772770

URL: http://svn.apache.org/viewvc?rev=772770&view=rev
Log:
Fixed ordering bug in EXPUNGE. IMAP-78 https://issues.apache.org/jira/browse/IMAP-78

Modified:
    james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
    james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/AppendExpunge.test
    james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/ExpungeBasics.test

Modified: james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java?rev=772770&r1=772769&r2=772770&view=diff
==============================================================================
--- james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java
(original)
+++ james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java
Thu May  7 20:54:28 2009
@@ -60,7 +60,13 @@
 
     public Collection<Long> expungedUids();
 
-    public void expunged(Collection<Long> expungedUids);
+    /**
+     * Removes the given UID.
+     * @param uid not null
+     * @return the message sequence number that the UID held before
+     * being expunged
+     */
+    public int remove(Long uid);
 
     public Collection<Long> flagUpdateUids();
 }
\ No newline at end of file

Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java?rev=772770&r1=772769&r2=772770&view=diff
==============================================================================
--- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
(original)
+++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
Thu May  7 20:54:28 2009
@@ -164,12 +164,11 @@
         final Collection<Long> expungedUids = selected.expungedUids();
         for (final Long uid: expungedUids) {
             final long uidValue = uid.longValue();
-            final int msn = selected.msn(uidValue);
+            final int msn = selected.remove(uidValue);
             // TODO: use factory
             ExpungeResponse response = new ExpungeResponse(msn);
             responder.respond(response);
         }
-        selected.expunged(expungedUids);
     }
 
     private void addFlagsResponses(final ImapSession session, final SelectedMailbox selected,


Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java?rev=772770&r1=772769&r2=772770&view=diff
==============================================================================
--- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
(original)
+++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
Thu May  7 20:54:28 2009
@@ -143,11 +143,10 @@
         return events.expungedUids();
     }
 
-    public void expunged(Collection<Long> expungedUids) {
-        for (final Long uid: expungedUids) {
-            final long uidValue = uid.longValue();
-            converter.expunge(uidValue);
-        }
+    public int remove(Long uid) {
+        final int result = msn(uid);
+        converter.expunge(uid);
+        return result;
     }
 
     public Collection<Long> flagUpdateUids() {

Modified: james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/AppendExpunge.test
URL: http://svn.apache.org/viewvc/james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/AppendExpunge.test?rev=772770&r1=772769&r2=772770&view=diff
==============================================================================
--- james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/AppendExpunge.test
(original)
+++ james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/AppendExpunge.test
Thu May  7 20:54:28 2009
@@ -80,7 +80,7 @@
 
 C: A007 EXPUNGE
 S: \* 1 EXPUNGE
-S: \* 2 EXPUNGE
+S: \* 1 EXPUNGE
 S: \* \d+ RECENT
 S: A007 OK EXPUNGE completed.
 

Modified: james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/ExpungeBasics.test
URL: http://svn.apache.org/viewvc/james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/ExpungeBasics.test?rev=772770&r1=772769&r2=772770&view=diff
==============================================================================
--- james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/ExpungeBasics.test
(original)
+++ james/imap/trunk/seda/src/test/resources/org/apache/james/imap/scripts/ExpungeBasics.test
Thu May  7 20:54:28 2009
@@ -696,8 +696,8 @@
 S: A17 OK STORE completed.
 C: A18 EXPUNGE
 S: \* 4 EXPUNGE
-S: \* 6 EXPUNGE
-S: \* 7 EXPUNGE
+S: \* 5 EXPUNGE
+S: \* 5 EXPUNGE
 S: \* 7 RECENT
 S: A18 OK EXPUNGE completed.
 C: A19 SELECT testmailbox



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