diff --git a/pom.xml b/pom.xml index 593aa4e..18185ec 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 net.helenus helenus-core - 2.0.36-SNAPSHOT + 2.0.38-SNAPSHOT jar helenus diff --git a/src/main/java/net/helenus/core/UnitOfWork.java b/src/main/java/net/helenus/core/UnitOfWork.java index 8635f43..c947c12 100644 --- a/src/main/java/net/helenus/core/UnitOfWork.java +++ b/src/main/java/net/helenus/core/UnitOfWork.java @@ -52,14 +52,14 @@ public class UnitOfWork implements AutoCloseable { } public Set cacheLookup(String key) { - UnitOfWork p = this; - do { - Set r = p.getCache().get(key); - if (r != null) { - return r; + Set r = getCache().get(key); + if (r != null) { + return r; + } else { + if (parent != null) { + return parent.cacheLookup(key); } - p = parent; - } while(p != null); + } return null; } diff --git a/src/main/java/net/helenus/core/operation/AbstractOptionalOperation.java b/src/main/java/net/helenus/core/operation/AbstractOptionalOperation.java index f4bf79b..8083785 100644 --- a/src/main/java/net/helenus/core/operation/AbstractOptionalOperation.java +++ b/src/main/java/net/helenus/core/operation/AbstractOptionalOperation.java @@ -23,7 +23,6 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import java.util.HashSet; -import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.concurrent.CompletableFuture;