-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Incubator-kie-issues#1345] It shouldn't be possible to add\subtract a DateTime with a number #6040
Conversation
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.
Thx @bncriju well done!!!
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/FEEL12ExtendedForLoopTest.java
Outdated
Show resolved
Hide resolved
@@ -51,6 +51,8 @@ protected void instanceTest(String expression, Object result, FEELEvent.Severity | |||
private static Collection<Object[]> data() { | |||
final Object[][] cases = new Object[][] { | |||
// date/time/duration function invocations | |||
{ "@\"2021-01-01\" + 10", null , FEELEvent.Severity.ERROR}, | |||
{ "@\"2021-01-01T10:10:10\" + 10", null , FEELEvent.Severity.ERROR}, |
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.
@bncriju Can you please add here those additional test cases:
- number + Date
- number + DateTime
- number - Date
- number - DateTime
- Date - number
- DateTime - number
They should all return null with an error.
Just for the sake of completeness :)
Thank you
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.
@bncriju Don't forget this please :)
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.
Sry @bncriju - I missed one detail
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/FEEL12ExtendedForLoopTest.java
Outdated
Show resolved
Hide resolved
…a DateTime with a number (apache#6040) * Removed the addition of temporal with number and added test cases * removed unused import * replaced null object with list of null
…a DateTime with a number (apache#6040) * Removed the addition of temporal with number and added test cases * removed unused import * replaced null object with list of null
Fixes apache/incubator-kie-issues#1345
It was possible to add a number with a Temporal and was returning the result, which was not right. According to DMN specification, addition of Temporal with a number shouldn't be supported. This PR has the changes to bring the behavior supported by DMN spec.