You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/03/20 17:27:22 UTC

[commons-lang] branch master updated: Fix unintended commit.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a5ef83  Fix unintended commit.
4a5ef83 is described below

commit 4a5ef835ccb3cf8f765ee1e95962bf0863af8ce8
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Mar 20 13:27:18 2022 -0400

    Fix unintended commit.
---
 src/main/java/org/apache/commons/lang3/concurrent/Memoizer.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/lang3/concurrent/Memoizer.java b/src/main/java/org/apache/commons/lang3/concurrent/Memoizer.java
index 5e3ff9e..4dacac0 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/Memoizer.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/Memoizer.java
@@ -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) {