The getEnvelope(Filter filter) method uses the supportedFilterTypes set, and I believe the intent is to perform bounds calculation for the specified filter in order to speed up the the query:
Envelope getEnvelope(Filter filter) {
} else if (filter instanceof BinarySpatialOperator) {
BinarySpatialOperator gf = (BinarySpatialOperator) filter;
if (supportedFilterTypes.contains(gf.getClass())) {
_expression_ lg = gf.getExpression1();
However, this detection never works because the set supportedFilterTypes contains references to *interfaces* and not the actual implementing classes, i.e. DWithin.class vs DWithinImpl.class, so the .contains(...) call never returns true. The correct check should be something like this:
Envelope getEnvelope(Filter filter) {
} else if (filter instanceof BinarySpatialOperator) {
BinarySpatialOperator gf = (BinarySpatialOperator) filter;
boolean filterTypeSupported = false;
for (Class filterType : supportedFilterTypes) {
if (filterType.isInstance(gf)) {
filterTypeSupported = true;
break;
}
}
if (filterTypeSupported) {
_expression_ lg = gf.getExpression1();
|