diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-08-05 12:52:48 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-08-05 12:52:48 +0000 |
commit | 3f5faac5caf62666f4c1a24b3fcf8e7b92efea34 (patch) | |
tree | 722e20686d75b6199ff063f04cf29de03bda678f /sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca | |
parent | 25fdf5efc29317b6be404b98469b6d0e9b64d7cd (diff) |
TUSCANY-3907 - Clone top level composites before adding them to the domain level composite so that they don't get build more than once. Also clone bindings when reference and services are cloned.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1154194 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca')
2 files changed, 7 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java index e157b78a7c..6e5e09adf6 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java @@ -53,7 +53,10 @@ public class ReferenceImpl extends AbstractReferenceImpl implements Reference, C @Override public Object clone() throws CloneNotSupportedException { ReferenceImpl clone = (ReferenceImpl)super.clone(); - clone.bindings = new ArrayList<Binding>(bindings); + clone.bindings = new ArrayList<Binding>(); + for (Binding binding : getBindings()){ + clone.bindings.add((Binding)binding.clone()); + } clone.targets = new ArrayList<ComponentService>(targets); // clone the endpoint references themselves and set the reference pointer back to // this new refrence diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java index 618d0d6e7b..4a8fd70910 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java @@ -50,7 +50,9 @@ public class ServiceImpl extends AbstractServiceImpl implements Service, Cloneab public Object clone() throws CloneNotSupportedException { ServiceImpl clone = (ServiceImpl)super.clone(); clone.bindings = new ArrayList<Binding>(); - clone.bindings.addAll(getBindings()); + for (Binding binding : getBindings()){ + clone.bindings.add((Binding)binding.clone()); + } return clone; } |