Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Dec 22, 2024
1 parent abe6e9b commit dc3c02b
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ abstract class AbstractTieredCache<V extends MoshiExchange> implements TieredCac
* The value associated with the specified key, or {@code null} otherwise
*/
V getOrCompute(String key, Function<String,V> loader, Duration ttl) {

final provisioner = (String k)-> {
final v=loader.apply(k);
v!=null ? new Tuple2<V,Duration>(v,ttl) : null
if( loader==null ) {
return getOrCompute(key, null, null)
}

getOrCompute(key, loader!=null ? provisioner : null)
return getOrCompute(key, (String k)-> {
V v = loader.apply(key)
return v != null ? new Tuple2<>(v, ttl) : null
})
}

/**
Expand Down

0 comments on commit dc3c02b

Please sign in to comment.