From 86808041f626e7cd426c49b996bf5c0f2cc639cf Mon Sep 17 00:00:00 2001 From: Adrian Todt Date: Sat, 7 Mar 2020 16:04:12 -0300 Subject: [PATCH] Small Connection refactor --- src/main/java/com/rethinkdb/net/Connection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rethinkdb/net/Connection.java b/src/main/java/com/rethinkdb/net/Connection.java index 1765d385..f04b6872 100644 --- a/src/main/java/com/rethinkdb/net/Connection.java +++ b/src/main/java/com/rethinkdb/net/Connection.java @@ -11,6 +11,7 @@ import com.rethinkdb.model.OptArgs; import com.rethinkdb.model.Server; import com.rethinkdb.utils.Internals; +import com.rethinkdb.utils.Types; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -198,7 +199,7 @@ public boolean isOpen() { public @NotNull CompletableFuture serverAsync() { return sendQuery(Query.createServerInfo(nextToken.incrementAndGet())).thenApply(res -> { if (res.type.equals(ResponseType.SERVER_INFO)) { - return Internals.toPojo(res.data.get(0), new TypeReference() {}); + return Internals.toPojo(res.data.get(0), Types.of(Server.class)); } throw new ReqlDriverError("Did not receive a SERVER_INFO response."); }); @@ -397,7 +398,6 @@ protected void handleOptArgs(@NotNull OptArgs optArgs) { // builder - /** * Builder should be used to build a Connection instance. */