}
List<FeatureId> r = new LinkedList<FeatureId>();
SimpleFeatureType schema = getSchema();
LenientBuilder build = new LenientBuilder( schema );
boolean isLenient = true;
if( schema.getUserData().containsKey("lenient")){
isLenient = (Boolean) schema.getUserData().get("lenient");
}
if( isLenient ){
build.setFeatureFactory( new LenientFeatureFactory());
}
List<AttributeDescriptor> atrs = schema.getAttributeDescriptors();
FeatureIterator<SimpleFeature> iter=collection.features();
try{
ReferencedEnvelope bounds=null;
while (iter.hasNext()){
try {
SimpleFeature newFeature;
try {
SimpleFeature f = iter.next();
String nextFid = ts.nextFid(schema.getTypeName());
Object[] values = f.getAttributes().toArray();
build.addAll( values );
newFeature = build.buildFeature( nextFid );
r.add(newFeature.getIdentifier());
} catch (IllegalAttributeException e) {
throw (IOException) new IOException( e.getLocalizedMessage() );
}