Skip to content

Commit 30b011c

Browse files
mmerdesrtroilo
authored andcommitted
#470: simplify nullability handling with Optional
1 parent 63780c8 commit 30b011c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

oshdb-api-ignite/src/main/java/org/heigit/ohsome/oshdb/api/db/OSHDBIgnite.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,7 @@ public OSHDBIgnite onClose(IgniteRunnable action) {
207207
* @return the currently set onClose callback
208208
*/
209209
public Optional<IgniteRunnable> onClose() {
210-
if (this.onCloseCallback == null) {
211-
return Optional.empty();
212-
} else {
213-
return Optional.of(this.onCloseCallback);
214-
}
210+
return Optional.ofNullable(this.onCloseCallback);
215211
}
212+
216213
}

0 commit comments

Comments
 (0)