Allow UOW to be null in {a}sync(UnitOfWork uow).
This commit is contained in:
parent
8c165a689b
commit
97f74776d5
3 changed files with 5 additions and 7 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.34-SNAPSHOT</version>
|
||||
<version>2.0.35-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>helenus</name>
|
||||
|
|
|
@ -67,7 +67,7 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
|
|||
}
|
||||
|
||||
public Optional<E> sync(UnitOfWork uow) {
|
||||
Objects.requireNonNull(uow, "Unit of Work should not be null.");
|
||||
if (uow == null) return sync();
|
||||
|
||||
final Timer.Context context = requestLatency.time();
|
||||
try {
|
||||
|
@ -112,8 +112,7 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
|
|||
}
|
||||
|
||||
public CompletableFuture<Optional<E>> async(UnitOfWork uow) {
|
||||
Objects.requireNonNull(uow, "Unit of Work should not be null.");
|
||||
|
||||
if (uow == null) return async();
|
||||
return CompletableFuture.<Optional<E>>supplyAsync(() -> sync(uow));
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
|
|||
}
|
||||
|
||||
public Stream<E> sync(UnitOfWork uow) {
|
||||
Objects.requireNonNull(uow, "Unit of Work should not be null.");
|
||||
if (uow == null) return sync();
|
||||
|
||||
final Timer.Context context = requestLatency.time();
|
||||
try {
|
||||
|
@ -110,8 +110,7 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
|
|||
}
|
||||
|
||||
public CompletableFuture<Stream<E>> async(UnitOfWork uow) {
|
||||
Objects.requireNonNull(uow, "Unit of Work should not be null.");
|
||||
|
||||
if (uow == null) return async();
|
||||
return CompletableFuture.<Stream<E>>supplyAsync(() -> sync(uow));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue