• Bug
  • Status: Closed
  • Resolution: Fixed
  • drb
  • Reporter: sourceforgetracker
  • September 21, 2009
  • 0
  • Watchers: 0
  • September 22, 2009
  • September 22, 2009


With a small test case app, I’m seeing NullPointerExceptions when then disk store tries to persist. AFAICT, the cause is in LfuPolicy.leastHit(), which returns the field “justAdded”, which is set to null.

Backtrace and test case attached. Sourceforge Ticket ID: 1759740 - Opened By: jamesshaw - 24 Jul 2007 15:21 UTC


Sourceforge Tracker 2009-09-21

Logged In: YES user_id=693320 Originator: NO


Nice test case. I have added it to LfuMemoryStoreTest. The thing that triggers it is the max disk store size of 1. The issue does not happen if the max disk store size is 2 or higher.

I changed the offending line to if (sampledElements.length == 1 && justAdded != null).

The fix is in trunk and will be in ehcache-1.4.

Greg Comment by: gregluck - 15 Aug 2007 07:14 UTC

Fiona OShea 2009-09-22

Re-opening so that I can properly close out these issues and have correct Resolution status in Jira