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

Description

FindBugs 1.2.0-dev finds a “High Priority Correctness” Bug in ehcache 1.2.4:

The method update(final Object key) of UpdatingSelfPopulatingCache passes a known null value of the local variable element to the method refreshElement of SelfPopulatingCache.

The local variable element is known null at line 103 and 104, but the variable is passed at line 108 to refreshElement of SelfPopulatingCache which leads to a NPE at line 196 (Object key = element.getObjectKey();). Sourceforge Ticket ID: 1667718 - Opened By: lars_koeln - 24 Feb 2007 10:03 UTC

Comments

Sourceforge Tracker 2009-09-21

Logged In: YES user_id=693320 Originator: NO

Lars

I agree the logging method looks a bit strange. I have added a return to the null guard to clean it up. It is not however a bug. The calling method get(final Object key) checks for null and only calls update if the key is non-null. I have added a null test to UpdatingSelfPopulatingCacheTest#testFetchAndUpdate

I see that you are a committer to OSCache. Your bug reports, patches and other contributions are most welcome.

Greg Luck Comment by: gregluck - 26 Feb 2007 07:40 UTC

Fiona OShea 2009-09-22

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