Skip to content

Commit

Permalink
stleary#838 - Updated the relevant code in JSONObject to use the over…
Browse files Browse the repository at this point in the history
…ridden toString() method for enum values instead of name().
  • Loading branch information
ThestralWarrior committed Dec 14, 2023
1 parent 6dba722 commit 051a5f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/json/JSONObject.java
Expand Up @@ -2653,7 +2653,7 @@ static final Writer writeValue(Writer writer, Object value,
} else if (value instanceof Boolean) {
writer.write(value.toString());
} else if (value instanceof Enum<?>) {
writer.write(quote(((Enum<?>)value).name()));
writer.write(quote(value.toString()));
} else if (value instanceof JSONObject) {
((JSONObject) value).write(writer, indentFactor, indent);
} else if (value instanceof JSONArray) {
Expand Down

0 comments on commit 051a5f1

Please sign in to comment.