Revert "Merge pull request #877 from rikkarth/feat/871-strictMode"

This reverts commit d02ac0f2a3, reversing
changes made to cfd47615d0.
This commit is contained in:
Sean Leary
2024-11-03 09:50:08 -06:00
parent 61dc2644d8
commit 215ec9bb9c
6 changed files with 109 additions and 764 deletions

View File

@@ -220,12 +220,12 @@ public class JSONObject {
for (;;) {
c = x.nextClean();
switch (c) {
case 0:
throw x.syntaxError("A JSONObject text must end with '}'");
case '}':
return;
default:
key = x.nextSimpleValue(c, jsonParserConfiguration).toString();
case 0:
throw x.syntaxError("A JSONObject text must end with '}'");
case '}':
return;
default:
key = x.nextSimpleValue(c).toString();
}
// The key is followed by ':'.
@@ -244,7 +244,7 @@ public class JSONObject {
throw x.syntaxError("Duplicate key \"" + key + "\"");
}
Object value = x.nextValue(jsonParserConfiguration);
Object value = x.nextValue();
// Only add value if non-null
if (value != null) {
this.put(key, value);
@@ -1247,7 +1247,7 @@ public class JSONObject {
static BigDecimal objectToBigDecimal(Object val, BigDecimal defaultValue) {
return objectToBigDecimal(val, defaultValue, true);
}
/**
* @param val value to convert
* @param defaultValue default value to return is the conversion doesn't work or is null.