Permalink
Browse files

Not a very safe fix, depends on DefaultFeatureCollection being suppli…

…ed by GMLAbstractFeatureCollectionBaseTypeBinding
  • Loading branch information...
1 parent 61cc69c commit 647f2261d9ffef48efdae08014c94b6dcea867ba @jodygarnett jodygarnett committed Oct 30, 2012
@@ -16,6 +16,8 @@
*/
package org.geotools.gml2.bindings;
+import java.util.Collection;
+
import javax.xml.namespace.QName;
import org.geotools.data.simple.SimpleFeatureCollection;
@@ -97,7 +99,12 @@ public Object parse(ElementInstance instance, Node node, Object value)
SimpleFeatureCollection fc = (SimpleFeatureCollection) value;
//add all feature member children
- fc.addAll(node.getChildValues(SimpleFeature.class));
+ if( fc instanceof Collection){
+ ((Collection)fc).addAll(node.getChildValues(SimpleFeature.class));
+ }
+ else {
+ throw new IllegalStateException("Please provide DefaultFeatureCollection or ListFeatureCollection");
+ }
return fc;
}

0 comments on commit 647f226

Please sign in to comment.