lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wendy Feng (JIRA)" <j...@apache.org>
Subject [jira] Created: (LUCENE-2520) Unsafe synchronization in CachingWrapperFilterHelper
Date Wed, 30 Jun 2010 01:50:50 GMT
Unsafe synchronization in CachingWrapperFilterHelper
----------------------------------------------------

                 Key: LUCENE-2520
                 URL: https://issues.apache.org/jira/browse/LUCENE-2520
             Project: Lucene - Java
          Issue Type: Bug
          Components: Search
    Affects Versions: 3.0.1
            Reporter: Wendy Feng


CachingWrapperFilterHelper has unsaft synchronization as follow:

 public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
    if (cache == null) {
      cache = new WeakHashMap();
    }
    
    synchronized (cache) {  
       ...
     }

It is not safe to assgine a new object to cache before synchronizing on. it may results sycnchronize
on two different object if the method is called concurrently when cache =null.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message