Author: norman
Date: Thu Sep 29 17:27:46 2011
New Revision: 1177375
URL: http://svn.apache.org/viewvc?rev=1177375&view=rev
Log:
Do not synchronize on objects that may be reused. See MAILBOX-141
Modified:
james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
Modified:
james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
URL:
http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java?rev=1177375&r1=1177374&r2=1177375&view=diff
==============================================================================
---
james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
(original)
+++
james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
Thu Sep 29 17:27:46 2011
@@ -44,7 +44,7 @@ import org.apache.james.mailbox.store.ma
public class LazyMessageSearchIndex<Id> extends
ListeningMessageSearchIndex<Id> {
private ListeningMessageSearchIndex<Id> index;
- private final ConcurrentHashMap<Id, Boolean> indexed = new
ConcurrentHashMap<Id, Boolean>();
+ private final ConcurrentHashMap<Id, Object> indexed = new
ConcurrentHashMap<Id, Object>();
public LazyMessageSearchIndex(ListeningMessageSearchIndex<Id> index) {
@@ -74,10 +74,10 @@ public class LazyMessageSearchIndex<Id>
public Iterator<Long> search(final MailboxSession session, final
Mailbox<Id> mailbox, SearchQuery searchQuery) throws MailboxException {
Id id = mailbox.getMailboxId();
- Boolean done = indexed.get(id);
+ Object done = indexed.get(id);
if (done == null) {
- done = new Boolean(true);
- Boolean oldDone = indexed.putIfAbsent(id, done);
+ done = new Object();
+ Object oldDone = indexed.putIfAbsent(id, done);
if (oldDone != null) {
done = oldDone;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]