Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict boolean support for Strings in and out #2419

Merged
merged 1 commit into from
Jul 5, 2021

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.

None yet

2 participants