tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scottk...@apache.org
Subject svn commit: r1098763 - /tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java
Date Mon, 02 May 2011 19:44:54 GMT
Author: scottkurz
Date: Mon May  2 19:44:54 2011
New Revision: 1098763

URL: http://svn.apache.org/viewvc?rev=1098763&view=rev
Log:
In clone(), do a deep copy of wrapped logical DataType for java:array, etc. cases.

Modified:
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java?rev=1098763&r1=1098762&r2=1098763&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java
Mon May  2 19:44:54 2011
@@ -168,6 +168,20 @@ public class DataTypeImpl<L> implements 
     @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;
     }
 



Mime
View raw message