Skip to content

Commit 472e426

Browse files
committed
JSON schema contains only 2 values for boolean
1 parent e054a8c commit 472e426

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/YAMLParser.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -468,25 +468,11 @@ protected JsonToken _decodeScalar(ScalarEvent scalar) throws IOException
468468
return JsonToken.VALUE_STRING;
469469
}
470470

471-
//TODO leave only true and false
472471
protected Boolean _matchYAMLBoolean(String value, int len)
473472
{
474473
switch (len) {
475-
case 1:
476-
switch (value.charAt(0)) {
477-
case 'y': case 'Y': return Boolean.TRUE;
478-
case 'n': case 'N': return Boolean.FALSE;
479-
}
480-
break;
481-
case 2:
482-
if ("no".equalsIgnoreCase(value)) return Boolean.FALSE;
483-
if ("on".equalsIgnoreCase(value)) return Boolean.TRUE;
484-
break;
485-
case 3:
486-
if ("yes".equalsIgnoreCase(value)) return Boolean.TRUE;
487-
if ("off".equalsIgnoreCase(value)) return Boolean.FALSE;
488-
break;
489474
case 4:
475+
//TODO it should be only lower case
490476
if ("true".equalsIgnoreCase(value)) return Boolean.TRUE;
491477
break;
492478
case 5:

0 commit comments

Comments
 (0)