Skip to content

Commit

Permalink
Serialization fix & warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubix327 committed Aug 28, 2023
1 parent 7fb1439 commit fb98eb6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>org.mineacademy</groupId>
<artifactId>Foundation</artifactId>
<version>6.2.5.8</version>
<version>6.2.5.10</version>
<packaging>jar</packaging>

<name>Foundation</name>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/mineacademy/fo/SerializeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ else if (classOf == CompChatColor.class)
else if (classOf == CompColor.class)
object = CompColor.valueOf(object.toString());

else if (classOf == ItemStack.class && mode == Mode.JSON)
else if (classOf == ItemStack.class)
object = deserializeItemStack(mode, object);

else if (classOf == UUID.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,8 @@ private static SerializedMap of(@NonNull Object object, Mode mode) {
if (object instanceof List && ((List<?>) object).isEmpty())
return new SerializedMap(mode);

throw new FoException("Cannot instantiate SerializedMap(" + mode + ") from " + object.getClass().getSimpleName() + ": " + object);
throw new FoException("Cannot instantiate SerializedMap(" + mode + ") from " + object.getClass().getSimpleName() + ": " + object + "\n" +
"If you are using this object as a key in your map, then it cannot be deserialized as a key. Use a custom class instead of a map.");
}

/**
Expand Down

0 comments on commit fb98eb6

Please sign in to comment.