You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2007/01/04 13:47:30 UTC
svn commit: r492550 -
/james/server/trunk/src/java/org/apache/james/mailrepository/MBoxMailRepository.java
Author: norman
Date: Thu Jan 4 04:47:29 2007
New Revision: 492550
URL: http://svn.apache.org/viewvc?view=rev&rev=492550
Log:
Fix class CastException, fix comment and replace a Vector with ArrayList. See JAMES-721
Modified:
james/server/trunk/src/java/org/apache/james/mailrepository/MBoxMailRepository.java
Modified: james/server/trunk/src/java/org/apache/james/mailrepository/MBoxMailRepository.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailrepository/MBoxMailRepository.java?view=diff&rev=492550&r1=492549&r2=492550
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailrepository/MBoxMailRepository.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailrepository/MBoxMailRepository.java Thu Jan 4 04:47:29 2007
@@ -604,10 +604,9 @@
* @see org.apache.james.services.MailRepository#remove(Mail)
*/
public void remove(Mail mail) {
- // Convert the message into a key
- Vector delVec = new Vector();
- delVec.addElement(mail);
- remove(delVec);
+ ArrayList remArray = new ArrayList();
+ remArray.add(mail);
+ remove(remArray);
}
/**
@@ -762,7 +761,7 @@
return; // No lock, so exit
}
ArrayList keys = new ArrayList();
- keys.add(key);
+ keys.add(retrieve(key));
this.remove(keys);
unlockMBox();
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: svn commit: r492550 - /james/server/trunk/src/java/org/apache/james/mailrepository/MBoxMailRepository.java
Posted by Stefano Bagnara <ap...@bago.org>.
norman@apache.org wrote:
> Fix class CastException, fix comment and replace a Vector with ArrayList. See JAMES-721
> [..]
> ArrayList keys = new ArrayList();
> - keys.add(key);
> + keys.add(retrieve(key));
Retrieving messages will slow down things.
Maybe the best thing is to create a loop and call remove for each single
String key instead of creating an ArrayList and calling the single
remove method.
Stefano
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: svn commit: r492550 - /james/server/trunk/src/java/org/apache/james/mailrepository/MBoxMailRepository.java
Posted by Norman Maurer <nm...@byteaction.de>.
Stefano Bagnara schrieb:
> norman@apache.org wrote:
>> Fix class CastException, fix comment and replace a Vector with
>> ArrayList. See JAMES-721
>> [..]
>> ArrayList keys = new ArrayList();
>> - keys.add(key);
>> + keys.add(retrieve(key));
>
> Retrieving messages will slow down things.
>
> Maybe the best thing is to create a loop and call remove for each
> single String key instead of creating an ArrayList and calling the
> single remove method.
>
> Stefano
>
I don't understand ... We have to retrieve anyway or im wrong ?
Anyway i whouldn't see this as critical because we should replace the
current MboxMailRepository anyway with mstor later.
bye
Norman
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org