Hi,

CapabilitiesFilterSplitter and PostPreProcessFilterSplittingVisitor
don't check if the given Capabilities object contains support for Id
Filters
and Id Filters are always added to preStack and are always returned
using the method getFilterPre().
If Capabilities doesn't contain support for Id Filters, they should be
put in the postStack and they should be returned by getFilterPost().

A quick test that you can add to CapabilitiesFilterSplitterTest to see
this issue:

HashSet ids = new HashSet();
ids.add(ff.featureId("david"));
Filter idFilter = ff.id(ids);

// no Id Capabilities
visitor = newVisitor(Capabilities.SIMPLE_COMPARISONS_OPENGIS);
idFilter.accept(visitor, null);

assertEquals(Filter.INCLUDE, visitor.getFilterPre());
assertEquals(idFilter, visitor.getFilterPost());

I've created this patch to fix the issue:
https://github.com/geotools/geotools/pull/47/files

I've changed the method visit(Id filter, Object notUsed).

Before my changes the method add Id filters to postStack only if
postStack is not empty and always add them to preStack.

if (!postStack.isEmpty()) postStack.push(filter);
preStack.push(filter);

In my patch, Id filters are added to postStack if they aren't
supported otherwise they are added to preStack.

if (!fcs.supports(filter)) postStack.push(filter);
else preStack.push(filter);

Thanks for the review,
-- 
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.
==

Davide Savazzi
@svzdvd
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to