Skip to content

Commit 964a934

Browse files
committed
Removed unnecessary null check and CompletionStage constant
1 parent 5e9ce3f commit 964a934

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

driver/src/main/java/org/neo4j/driver/internal/NetworkSession.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import org.neo4j.driver.v1.exceptions.ClientException;
4747
import org.neo4j.driver.v1.types.TypeSystem;
4848

49-
import static org.neo4j.driver.internal.util.Futures.completedWithFalse;
5049
import static org.neo4j.driver.internal.util.Futures.completedWithNull;
5150
import static org.neo4j.driver.internal.util.Futures.failedFuture;
5251
import static org.neo4j.driver.v1.Values.value;
@@ -275,10 +274,6 @@ public TypeSystem typeSystem()
275274

276275
CompletionStage<Boolean> currentConnectionIsOpen()
277276
{
278-
if ( connectionStage == null )
279-
{
280-
return completedWithFalse();
281-
}
282277
return connectionStage.handle( ( connection, error ) ->
283278
error == null && // no acquisition error
284279
connection != null && // some connection has actually been acquired

driver/src/main/java/org/neo4j/driver/internal/util/Futures.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
public final class Futures
3636
{
3737
private static final CompletableFuture<?> COMPLETED_WITH_NULL = completedFuture( null );
38-
private static final CompletableFuture<Boolean> COMPLETED_WITH_FALSE = completedFuture( false );
3938

4039
private Futures()
4140
{
@@ -47,11 +46,6 @@ public static <T> CompletableFuture<T> completedWithNull()
4746
return (CompletableFuture) COMPLETED_WITH_NULL;
4847
}
4948

50-
public static CompletableFuture<Boolean> completedWithFalse()
51-
{
52-
return COMPLETED_WITH_FALSE;
53-
}
54-
5549
public static <T> CompletionStage<T> asCompletionStage( io.netty.util.concurrent.Future<T> future )
5650
{
5751
CompletableFuture<T> result = new CompletableFuture<>();

0 commit comments

Comments
 (0)