Fix compatibility with older Gson versions

This commit is contained in:
Luck 2017-12-09 11:26:12 +00:00
parent a5e41e479a
commit bbb2897d20
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -74,7 +74,7 @@ public class ContextSetJsonSerializer {
}
JsonObject context = gson.fromJson(json, JsonObject.class);
if (context == null || context.size() == 0) {
if (context == null) {
return ContextSet.empty();
}
@ -85,7 +85,7 @@ public class ContextSetJsonSerializer {
Preconditions.checkArgument(element.isJsonObject());
JsonObject data = element.getAsJsonObject();
if (data.size() == 0) {
if (data.entrySet().isEmpty()) {
return ContextSet.empty();
}