Do you have a null price Element in your cache? (Ehcache allows you to store an Element with null values, but I'm not sure if there are any restrictions there).
Looking at the Cache.searchInStoreWithStats code (object key) in version 2.5.3, it seems that there is an error:
- A test that determines whether to increase
inMemoryMisses , use the containsKey() derivative, - whereas the test for incrementing
cacheMisses null checks the result of the get() derivative.
So, every time you look for a key that exists in InMemoryStore but is null , it will increment cacheMisses , but not inMemoryMisses .
So, I could be completely off, but it smells to me. What do you think?
Edit: I realized that my interpretation was wrong - the element cannot be null (but its "value" can be null). I will leave this answer here, one way or another, if it raises any other ideas.
laher
source share