Fix unintended commit.

This commit is contained in:
Gary Gregory 2022-03-20 13:27:18 -04:00
parent 033cd48313
commit 4a5ef835cc
1 changed files with 2 additions and 1 deletions

View File

@ -112,7 +112,7 @@ public class Memoizer<I, O> implements Computable<I, O> {
@Override
public O compute(final I arg) throws InterruptedException {
while (true) {
Future<O> future = cache.computeIfAbsent(arg, k->{return null;});
Future<O> future = cache.get(arg);
if (future == null) {
final FutureTask<O> futureTask = new FutureTask<>(() -> computable.compute(arg));
future = cache.putIfAbsent(arg, futureTask);
@ -121,6 +121,7 @@ public class Memoizer<I, O> implements Computable<I, O> {
futureTask.run();
}
}
try {
return future.get();
} catch (final CancellationException e) {