Revision 44501 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/DefaultFeatureType.java

View differences:

DefaultFeatureType.java
1123 1123
        }
1124 1124
        return store.getOriginalFeatureType(this);
1125 1125
    }
1126
    @Override
1127
    public boolean hasOnlyMetadataChanges(FeatureType old) {
1128
        if( old == null ) {
1129
            throw new NullPointerException();
1130
        }
1131
        // Si hay campos nuevos -> false
1132
        for (FeatureAttributeDescriptor attr : this) {
1133
            if( old.getAttributeDescriptor(attr.getName())==null ) {
1134
                return false;
1135
            }
1136
        }
1137
        
1138
        // Si se ha eliminado algun campo -> false
1139
        for (FeatureAttributeDescriptor attr : old) {
1140
            if( this.getAttributeDescriptor(old.getName())==null ) {
1141
                return false;
1142
            }
1143
        }
1144
        
1145
        // No hay campos nuevos ni se ha eliminado ninguno, asi que comparamos
1146
        // los campos uno a uno.
1147
        for (FeatureAttributeDescriptor attr : this) {
1148
            FeatureAttributeDescriptor attrold = old.getAttributeDescriptor(attr.getName());
1149
            if( !attr.hasOnlyMetadataChanges(attrold) ) {
1150
                return false;
1151
            }
1152
        }
1153
        return true;
1154
    }
1126 1155
}

Also available in: Unified diff