Revision 46415 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
516 516
            throw new IllegalArgumentException("'source' argument can't be null");
517 517
        }
518 518
        FeatureType sourceType = source.getType();
519
        for (FeatureAttributeDescriptor attr : this.getType()) {
520
            if( !canSetValue(attr, filter) ) {
519
        for (FeatureAttributeDescriptor attrTarget : this.getType()) {
520
            if( !canSetValue(attrTarget, filter) ) {
521 521
                continue;
522 522
            }
523
            String attrname = attr.getName();
523
            String attrname = attrTarget.getName();
524 524
            if( sourceType.getAttributeDescriptorFromAll(attrname)==null ) {
525 525
              continue;
526 526
            }
527
            FeatureAttributeDescriptor attrSource = sourceType.getAttributeDescriptor(attrname);
527 528
            Object value;
528
            if( attr.hasDataProfile() ) {
529
            if( attrSource.hasDataProfile() ) {
529 530
                value = source.getFromProfile(attrname);
530 531
                if( value == null ) {
531 532
                    value = source.get(attrname);
......
533 534
            } else {
534 535
                value = source.get(attrname);
535 536
            }
536
            if (value == null && !attr.allowNull()) {
537
            if (value == null && !attrTarget.allowNull()) {
537 538
                continue;
538 539
            }
539 540
            try {
540
                set(attr.getIndex(), value);
541
                set(attrTarget.getIndex(), value);
541 542
            } catch(Throwable th) {
542 543
                LOG.trace("The exception thrown is: ", th);
543 544
            }

Also available in: Unified diff