-
Notifications
You must be signed in to change notification settings - Fork 9
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
[DROOLS-7635] ansible-rulebook : Raise an error when a condition comp… #117
[DROOLS-7635] ansible-rulebook : Raise an error when a condition comp… #117
Conversation
f0a727e
to
f47528d
Compare
Added test cases:
A fix in this PR is for negation test to pass. |
…ares incompatible types - alpha index test, beta index test beta index test fix add negate test and any test
f47528d
to
ca9eda4
Compare
// if not compatible type, return false regardless of the result | ||
// but let the operator be executed anyway so that the error message specific to the constraint is logged | ||
boolean result = !toBeNegated.asPredicate().test(t, v); | ||
return isCompatibleType(t, v) ? result : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor performance improvement: isn't necessary to compute the result if types aren't compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to let the operator log the type check error. But yes, I can refactor it to make it cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for me, I just added a suggestion for a minor improvement.
kiegroup#117) * [DROOLS-7635] ansible-rulebook : Raise an error when a condition compares incompatible types - alpha index test, beta index test beta index test fix add negate test and any test * refactor * minor comment fix
…on compares incompatible types (#120) * Merge pull request #114 from tkobayas/DROOLS-7635-error-incompatible-type-02 [DROOLS-7635] ansible-rulebook : Raise an error when a condition compares incompatible types * [DROOLS-7635] ansible-rulebook : Raise an error when a condition comp… (#117) * [DROOLS-7635] ansible-rulebook : Raise an error when a condition compares incompatible types - alpha index test, beta index test beta index test fix add negate test and any test * refactor * minor comment fix
…ares incompatible types