Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 8.0-M0
-
Fix Version/s: None
-
Component/s: main
-
Labels:None
Description
Okay reviewing now:
static boolean isLogicFilter(Filter filter) {
return (isGroupFilter(filter) || (filter instanceof Not));
}
static boolean isGroupFilter(Filter filter) {
//Note: Can't use BinaryLogicOperator here because the Not implementation also inherits from it.
return ( (filter instanceof And) || (filter instanceof Or));
}
These show a really tough problem where code reuse in our implementation wreck what should be a simple instance of check.
PROBLEM:
BinaryLogicalOperator > BinaryLogicalAbstract > LogicFilterImpl > (AndImpl, NotImpl, OrImpl)
SOLUTION:
Make BinaryLogicalAbstract not implement BinaryLogicalOperator (replying on AndIml and OrIml to get BinraryLogicalOperator via their interface only).
Trying out the solution now.
UDATE:
This worked out fine; the above two methods are no longer needed the result can now be accomplished cleanly using instance of checks.
a) filter instanceof BinaryLogicalOperator || filter instanceof Not
b) filter instance BinaryLogicalOperator