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
commit 033cd48313d7bd2e767d72804e160b2a190643f5 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Mar 20 13:25:59 2022 -0400 Javadoc typo. --- src/main/java/org/apache/commons/lang3/concurrent/Memoizer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 2dff568..5e3ff9e 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/Memoizer.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/Memoizer.java @@ -98,7 +98,7 @@ public class Memoizer<I, O> implements Computable<I, O> { * </p> * <p> * This cache will also cache exceptions that occur during the computation - * if the {@code recalculate} parameter is the constructor was set to + * if the {@code recalculate} parameter in the constructor was set to * {@code false}, or not set. Otherwise, if an exception happened on the * previous calculation, the method will attempt again to generate a value. * </p> @@ -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.get(arg); + Future<O> future = cache.computeIfAbsent(arg, k->{return null;}); if (future == null) { final FutureTask<O> futureTask = new FutureTask<>(() -> computable.compute(arg)); future = cache.putIfAbsent(arg, futureTask);