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. */