Fix cache lookup.
This commit is contained in:
parent
895921c598
commit
f9ab9f91a1
3 changed files with 8 additions and 9 deletions
2
pom.xml
2
pom.xml
|
@ -5,7 +5,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.helenus</groupId>
|
||||
<artifactId>helenus-core</artifactId>
|
||||
<version>2.0.36-SNAPSHOT</version>
|
||||
<version>2.0.38-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>helenus</name>
|
||||
|
|
|
@ -52,14 +52,14 @@ public class UnitOfWork<T extends Exception> implements AutoCloseable {
|
|||
}
|
||||
|
||||
public Set<Object> cacheLookup(String key) {
|
||||
UnitOfWork<T> p = this;
|
||||
do {
|
||||
Set<Object> r = p.getCache().get(key);
|
||||
if (r != null) {
|
||||
return r;
|
||||
Set<Object> r = getCache().get(key);
|
||||
if (r != null) {
|
||||
return r;
|
||||
} else {
|
||||
if (parent != null) {
|
||||
return parent.cacheLookup(key);
|
||||
}
|
||||
p = parent;
|
||||
} while(p != null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue