finally {
handlers.pop(); // we must do this or leak memory
if (handler != null && !handlers.isEmpty()){
XMLElementHandler parent = ((XMLElementHandler)handlers.peek());
if (parent instanceof ComplexElementHandler){
ComplexElementHandler complexParent = (ComplexElementHandler)parent;
String typename = complexParent.getType().getClass().getName();
// TODO: HACK The required Type is not in this Module
if(typename.equals("org.geotools.xml.wfs.WFSBasicComplexTypes$FeatureCollectionType")){
complexParent.removeElement(handler);
}
}
}
}
}