Revision 44610 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultEditableFeature.java

View differences:

DefaultEditableFeature.java
243 243
    public void copyFrom(Feature source) {
244 244
        // iterate over the attributes and copy one by one
245 245
        FeatureType sourceType = source.getType();
246
        Iterator it = this.getType().iterator();
247
        while ( it.hasNext() ) {
248
            FeatureAttributeDescriptor attr = (FeatureAttributeDescriptor) it.next();
249
            if( sourceType.get(attr.getName())!=null ) {
250
                set(attr.getIndex(), source.get(attr.getName()));
246
        for (FeatureAttributeDescriptor attr : this.getType()) {
247
            if (attr==null || attr.isAutomatic() || attr.isReadOnly() || attr.isComputed() ) {
248
                continue;
251 249
            }
250
            Object value = source.get(attr.getName());
251
            if (value == null && !attr.allowNull()) {
252
                continue;
253
            }
254
            try {
255
                set(attr.getIndex(), value);
256
            } catch(Throwable th) {
257
                // Ignore
258
            }
252 259
        }
253 260
    }
254 261

  

Also available in: Unified diff