When rendering different bounds of an unchanged MapContext/MapLayer, with the same unchanged Renderer and the same unchanged Style (which contains a FidFilter!), different/random/wrong features fulfill the FidFiilter! With every new bound to rendered, other features fulfill the filter.
What i learned while writing this JUnit test:
It only happens if the DefaultMapLayer has been created with a FeatureSource (not a FeatureCollection) in combination with ShapefileRenderer. With StramingRenderer it works.
Also works with ShapefileRenderer, if the MapLayer has been created with a FeatureCollection. Maybe this already rings a bell where the bug might be?
It happens with lines, points and polygons.
The test can be run interactively or not. As it is a pretty complex test, maybe we should include it for both Renderers and the alternative ways to create the MapLayer.
I have no idea how to fix this bug. I hope the JUnit test helps. I am in IRC and ready for help/testing all day (friday) tomorrow...
One more note: I couldn'd show the bug with lakes.shp, so please
"svn cp ./demo/shapefileviewer/src/main/resources/data/shapefiles/countries.* ./modules/unsupported/shapefile-renderer/src/test/resources/org/geotools/renderer/shape/test-data/"