scijava-common icon indicating copy to clipboard operation
scijava-common copied to clipboard

CacheService.get(key, valueLoader) is incorrectly implemented

Open ctrueden opened this issue 6 years ago • 0 comments

The CacheService interface contains a bogus implementation of the method get(String key, Callable<V> valueLoader), which never actually invokes the valueLoader. Probably, the default implementation should invoke valueLoader.call() iff a call to get(key) returns null. Of course, null value is different than key missing, but at this level we cannot tell the difference.

As an aside, the Guava-based implementation in scijava-cache does use the valueLoader.

ctrueden avatar May 14 '19 20:05 ctrueden