-
Notifications
You must be signed in to change notification settings - Fork 0
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-1701 fix: ranges cannot be (always) promoted to fields #5
DROOLS-1701 fix: ranges cannot be (always) promoted to fields #5
Conversation
it won't work if boundaries are non-constants!
If I well understand you are saying, for a range like: If my understanding is correct: Can you slight refactor this PR so that, if the range endpoint is a NumberLiteral, it take the "old" strategy for Constant/fields, while it goes into this new strategy for any other case, please? In most model I've seen personally |
you are right. I have reverted to the (more general) runtime resolution of the boundary expressions. I'll try and handle both the constant and the non-constant case, even if it is slightly non-trivial, because of the way sub-expressions are resolved! |
wait, no. that's not what's happening. In fact, the case when it's a numeric is still working as expected
BTW your observation makes sense and I'll take a look EDIT: nope, the original version stored the Range as a constant field. Alrighty. |
not entirely, before that |
1055a12
to
4681dbd
Compare
84682d9
to
f612353
Compare
down to 88 failed tests, constant field restored for numeric ranges |
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.
One request to move a method then we're good to go
@@ -26,6 +33,39 @@ | |||
private Comparable lowEndPoint; | |||
private Comparable highEndPoint; | |||
|
|||
public static RangeImpl of(EvaluationContext ctx, RangeBoundary lowBoundary, Object lowEndPoint, Object highEndPoint, RangeBoundary highBoundary) { |
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 believe this method is not currently shared with the AST-interpreted,
so better to move into CompiledFEELSemanticMappings
as sounds analogous to the FEEL list and other constructs there.
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.
ay ay captain
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.
thanks!
* DROOLS-1701 fix: ranges cannot be (always) promoted to fields it won't work if boundaries are non-constants! * DROOLS-1701 fix: use parenthesized expression in cast (ranges) * DROOLS-1701 Comparable: do not cast in source code, check in RangeImpl -- for now * DROOLS-1701 Use ObjectCreation for numeric constants, factory method otherwise * DROOLS-1701 move range() factory to CompiledFEELSemanticMappings
it won't work if boundaries are non-constants!
+17 tests pass, 95 yet to go!