[CCACHE-28] SoftCache NullPointerException in has? with many threads Created: 24/Oct/12 Updated: 09/Feb/13
Linux, Oracle JRE 1.6
"cell" can be null on this call to SoftReference.get():
If the cache did not contain "item" in the call to (get cache item) in the let binding, but another thread pre-empts and adds it before the subsequent call to contains?, we'll attempt to call .get() on nil.
Would it perhaps be sufficient to just check whether cell is nil instead of calling contains? in the check on the previous line?
|Comment by Paul Stadig [ 09/Feb/13 6:13 AM ]|
This is rather simple to reproduce:
The attached patch fixes the issue, by not referring back to the cache after attempting to pull out a SoftReference.