You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Simon Laws (Closed) (JIRA)" <de...@tuscany.apache.org> on 2011/12/05 15:19:41 UTC
[jira] [Closed] (TUSCANY-3988) Cloned component shares same policy
provider list as original component causing duplicated policy providers
[ https://issues.apache.org/jira/browse/TUSCANY-3988?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Simon Laws closed TUSCANY-3988.
-------------------------------
Resolution: Fixed
Greg's suggested fix applied at revision: 1210470. Thanks Greg. I added a test case also.
> Cloned component shares same policy provider list as original component causing duplicated policy providers
> -----------------------------------------------------------------------------------------------------------
>
> Key: TUSCANY-3988
> URL: https://issues.apache.org/jira/browse/TUSCANY-3988
> Project: Tuscany
> Issue Type: Bug
> Affects Versions: Java-SCA-2.0
> Reporter: Greg Dritschler
> Assignee: Simon Laws
> Priority: Minor
>
> Scenario: A composite "X" has multiple implementation.composite components that point to the same composite Y.
> Problem: Components in Y have duplicated implementation policy providers.
> Detailed explanation: CompositeCloneBuilderImpl clones each occurrence of Y which clones the components under it. However RuntimeComponentImpl does not have a clone method, so its policy provider list is simply copied to the clone. When CompositeActivatorImpl creates implementation policy providers for each component in Y, it is not updating a unique list, but rather a list that is shared with the other clones, causing the duplication.
> Proposed solution: Add a clone method to RuntimeComponentImpl that initializes a new policy provider list.
> @Override
> public Object clone() throws CloneNotSupportedException {
> RuntimeComponentImpl clone = (RuntimeComponentImpl)super.clone();
> clone.policyProviders = new ArrayList<PolicyProvider>();
> return clone;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira