Fix compatibility with older Gson versions
This commit is contained in:
+2
-2
@@ -74,7 +74,7 @@ public class ContextSetJsonSerializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JsonObject context = gson.fromJson(json, JsonObject.class);
|
JsonObject context = gson.fromJson(json, JsonObject.class);
|
||||||
if (context == null || context.size() == 0) {
|
if (context == null) {
|
||||||
return ContextSet.empty();
|
return ContextSet.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ public class ContextSetJsonSerializer {
|
|||||||
Preconditions.checkArgument(element.isJsonObject());
|
Preconditions.checkArgument(element.isJsonObject());
|
||||||
JsonObject data = element.getAsJsonObject();
|
JsonObject data = element.getAsJsonObject();
|
||||||
|
|
||||||
if (data.size() == 0) {
|
if (data.entrySet().isEmpty()) {
|
||||||
return ContextSet.empty();
|
return ContextSet.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user