#863 undo wrong optimisation, fixing failing test

This commit is contained in:
Simulant 2024-02-24 21:35:29 +01:00
parent d672b44a25
commit e2194bc190

View File

@ -2716,7 +2716,7 @@ public class JSONObject {
} catch (Exception e) {
throw new JSONException(e);
}
writer.write(o != null ? o.toString() : "\"\"");
writer.write(o != null ? o.toString() : quote(value.toString()));
} else if (value instanceof Number) {
// not all Numbers may match actual JSON Numbers. i.e. fractions or Imaginary
final String numberAsString = numberToString((Number) value);