Skip to content

Conversation

@bbakerman
Copy link
Member

When a AST literal is coerced it must be true or false - easy because the parser enforces that

However if you use variables then

{"someBoolVar" : "TEST"}

will be accepted and evaluated to false.

The old code uses Boolean.parse in Java which I have argued IS idiomatic Java however it creates strangle edge cases

We could be more strict in what we accept as a boolean.

This is that PR

If we decide to go with this PR then it would break anyone how is currently sending in strings outside "true" and "false" (case insensitive) .

See

#1103
#865

@bbakerman bbakerman added this to the 17.0 milestone Jul 3, 2021
if (lStr.equals("false")) {
return false;
}
return null;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null causes a coercing exception ins code you cant see in the diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change requires a new major version to be relased

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants