NotImpl incorrectly supporting BinaryLogicalOperator
----------------------------------------------------
Key: GEOT-3512
URL: http://jira.codehaus.org/browse/GEOT-3512
Project: GeoTools
Issue Type: Sub-task
Components: core filter
Affects Versions: 8-M0
Reporter: Jody Garnett
Assignee: Jody Garnett
Okay reviewing now:
{code}
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));
}
{code}
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
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now! http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel