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: [email protected]
For additional commands, e-mail: [email protected]