Skip to content

Commit

Permalink
Not a very safe fix, depends on DefaultFeatureCollection being suppli…
Browse files Browse the repository at this point in the history
…ed by GMLAbstractFeatureCollectionBaseTypeBinding
  • Loading branch information
jodygarnett committed Oct 31, 2012
1 parent 61cc69c commit 647f226
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.geotools.gml2.bindings;

import java.util.Collection;

import javax.xml.namespace.QName;

import org.geotools.data.simple.SimpleFeatureCollection;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 647f226

Please sign in to comment.