#56343: copyValues() method fixed to update mdrObjects in attribute collections with the new storable. BLD200503201900
authormmatula@netbeans.org
Wed, 16 Mar 2005 22:08:32 +0000
changeset 166928e3933cae49
parent 1668 56337c1a8c5a
child 1670 ab2edd4d039b
#56343: copyValues() method fixed to update mdrObjects in attribute collections with the new storable.
mdr/src/org/netbeans/mdr/storagemodel/StorableObject.java
     1.1 --- a/mdr/src/org/netbeans/mdr/storagemodel/StorableObject.java	Mon Mar 14 15:26:56 2005 +0000
     1.2 +++ b/mdr/src/org/netbeans/mdr/storagemodel/StorableObject.java	Wed Mar 16 22:08:32 2005 +0000
     1.3 @@ -105,7 +105,14 @@
     1.4      }
     1.5  
     1.6      protected void copyValues(StorableObject storable) {
     1.7 -        this.values = storable.values;
     1.8 +        if (storable.values == null) return;
     1.9 +        this.values = new Object[storable.values.length];
    1.10 +        for (int i = 0; i < values.length; i++) {
    1.11 +            values[i] = storable.values[i];
    1.12 +            if (values[i] instanceof AttrCollection) {
    1.13 +                ((AttrCollection) values[i]).mdrObject = this;
    1.14 +            }
    1.15 +        }
    1.16      }
    1.17  
    1.18      public void setAttribute(String featureName, Object value) throws StorageException {