Revision 44815 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
40 40
import org.gvsig.fmap.dal.feature.Feature;
41 41
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
42 42
import org.gvsig.fmap.dal.feature.FeatureExtraColumn;
43
import org.gvsig.fmap.dal.feature.FeatureType;
43 44
import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
44 45
import org.gvsig.fmap.geom.Geometry;
45 46
import org.gvsig.fmap.geom.GeometryUtils;
......
351 352
    }
352 353
    
353 354
    public void copyFrom(Feature source) {
354
        // iterate over the attributes and copy one by one
355
      // iterate over the attributes and copy one by one
356
        FeatureType sourceType = source.getType();
355 357
        for (FeatureAttributeDescriptor attr : this.getType()) {
356 358
            if (attr==null || attr.isAutomatic() || attr.isReadOnly() || attr.isComputed() ) {
357 359
                continue;
358 360
            }
359
            Object value = source.get(attr.getName());
361
            String attrname = attr.getName();
362
            if( sourceType.getAttributeDescriptor(attrname)==null ) {
363
              continue;
364
            }
365
            Object value = source.get(attrname);
360 366
            if (value == null && !attr.allowNull()) {
361 367
                continue;
362 368
            }

Also available in: Unified diff