//
FeatureReader<SimpleFeatureType, SimpleFeature> reader = getFeatureReader(typeName, query);
if (!featureType.equals(reader.getFeatureType())) {
LOGGER.fine("Recasting feature type to subtype by using a ReTypeFeatureReader");
reader = new ReTypeFeatureReader(reader, featureType, false);
}
if (query.getMaxFeatures() != Query.DEFAULT_MAX) {
reader = new MaxFeatureReader<SimpleFeatureType, SimpleFeature>(reader, query.getMaxFeatures());
}