diff options
author | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-02 19:44:54 +0000 |
---|---|---|
committer | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-02 19:44:54 +0000 |
commit | 7b2562998ac69d732009bb084f06856b615a8930 (patch) | |
tree | 9ded4989d16b04ad5fe0112d2a98802efa4ffec5 /sca-java-2.x/trunk/modules | |
parent | 34d6cf1e503394c21fb001e43bd438778f9009fb (diff) |
In clone(), do a deep copy of wrapped logical DataType for java:array, etc. cases.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1098763 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java index 572dd7e356..5d084d9289 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java @@ -168,6 +168,20 @@ public class DataTypeImpl<L> implements DataType<L> { @Override public Object clone() throws CloneNotSupportedException { DataTypeImpl copy = (DataTypeImpl)super.clone(); + + // + // When using a DataTypeImpl with java:array databinding, + // 'logical' will be another DataTypeImpl. Doing only + // a shallow copy means that resetting the databinding will + // have an unexpected side effect on the original. Though + // we could special case the java:array-databinding case, + // instead do it more generally when the logical is another + // DataType. + // + if (logical instanceof DataType) { + DataType logicalDT = (DataType)logical; + copy.logical = logicalDT.clone(); + } return copy; } |