mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-18 10:19:06 +00:00
Avoid calling JsonObject#size for compat with older gson versions (#2598)
This commit is contained in:
1 file changed
+3
-2
+3
-2
@@ -101,12 +101,13 @@ public final class ContextSetJsonSerializer {
|
||||
Preconditions.checkArgument(element.isJsonObject());
|
||||
JsonObject jsonObject = element.getAsJsonObject();
|
||||
|
||||
if (jsonObject.size() == 0) {
|
||||
Set<Map.Entry<String, JsonElement>> entries = jsonObject.entrySet();
|
||||
if (entries.isEmpty()) {
|
||||
return ImmutableContextSetImpl.EMPTY;
|
||||
}
|
||||
|
||||
MutableContextSet contextSet = new MutableContextSetImpl();
|
||||
for (Map.Entry<String, JsonElement> entry : jsonObject.entrySet()) {
|
||||
for (Map.Entry<String, JsonElement> entry : entries) {
|
||||
String k = entry.getKey();
|
||||
JsonElement v = entry.getValue();
|
||||
|
||||
|
||||
Reference in new issue
Block a user