Merge pull request #1009 from eleumik/eleumik-patch-1

Update JSONTokener.java for #1007
This commit is contained in:
Sean Leary 2025-09-18 20:12:03 -05:00 committed by GitHub
commit a5e234aa19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -509,6 +509,9 @@ public class JSONTokener {
string = sb.toString().trim();
if ("".equals(string)) {
throw this.syntaxError("Missing value");
} else if (jsonParserConfiguration != null &&
jsonParserConfiguration.isStrictMode() && string.endsWith(".")) {
throw this.syntaxError(String.format("Strict mode error: Value '%s' ends with dot", string));
}
Object obj = JSONObject.stringToValue(string);
// if obj is a boolean, look at string