james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1177963 - /james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
Date Sat, 01 Oct 2011 11:07:48 GMT
Author: norman
Date: Sat Oct  1 11:07:48 2011
New Revision: 1177963

URL: http://svn.apache.org/viewvc?rev=1177963&view=rev
Log:
Lock the right mailbox when copy messages. See MAILBOX-145

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

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=1177963&r1=1177962&r2=1177963&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
Sat Oct  1 11:07:48 2011
@@ -25,7 +25,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -522,10 +521,10 @@ public class StoreMessageManager<Id> imp
      */
     public List<MessageRange> copyTo(final MessageRange set, final StoreMessageManager<Id>
toMailbox, final MailboxSession session) throws MailboxException {
         if (!toMailbox.isWriteable(session)) {
-            throw new ReadOnlyException(new StoreMailboxPath<Id>(getMailboxEntity()),session.getPathDelimiter());
+            throw new ReadOnlyException(new StoreMailboxPath<Id>(toMailbox.getMailboxEntity()),session.getPathDelimiter());
         }
         
-        return locker.executeWithLock(session, new StoreMailboxPath<Id>(getMailboxEntity()),
new MailboxPathLocker.LockAwareExecution<List<MessageRange>>() {
+        return locker.executeWithLock(session, new StoreMailboxPath<Id>(toMailbox.getMailboxEntity()),
new MailboxPathLocker.LockAwareExecution<List<MessageRange>>() {
 
             @Override
             public List<MessageRange> execute() throws MailboxException {



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