@@ -513,18 +513,19 @@ Object nextSimpleValue(char c) {
513513 Object obj = JSONObject .stringToValue (string );
514514 // if obj is a boolean, look at string
515515 if (jsonParserConfiguration != null &&
516- jsonParserConfiguration .isStrictMode () && obj instanceof Boolean ) {
517- if (!"true" .equals (string ) && !"false" .equals (string )) {
516+ jsonParserConfiguration .isStrictMode ()) {
517+ if (obj instanceof Boolean && !"true" .equals (string ) && !"false" .equals (string )) {
518+ // Strict mode only allows lowercase true or false
518519 throw this .syntaxError (String .format ("Strict mode error: Value '%s' is not lowercase boolean" , obj ));
519520 }
520- }
521-
522-
523- // Strict mode only allows strings with explicit double quotes
524- if (jsonParserConfiguration != null &&
525- jsonParserConfiguration . isStrictMode () &&
526- obj instanceof String ) {
527- throw this . syntaxError ( String . format ( "Strict mode error: Value '%s' is not surrounded by quotes" , obj ));
521+ else if ( obj == JSONObject . NULL && ! "null" . equals ( string )) {
522+ // Strint mode only allows lowercase null
523+ throw this . syntaxError ( String . format ( "Strict mode error: Value '%s' is not lowercase null" , obj ));
524+ }
525+ else if (obj instanceof String ) {
526+ // Strict mode only allows strings with explicit double quotes
527+ throw this . syntaxError ( String . format ( "Strict mode error: Value '%s' is not surrounded by quotes" , obj ));
528+ }
528529 }
529530 return obj ;
530531 }
0 commit comments