diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-29 07:48:05 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-29 07:48:05 +0000 |
commit | fe48b1eb3dcbf11e89a03efcb8abbb55199cc48d (patch) | |
tree | a8221437b4d8e8bca392a0e4da4d0b497cfd4727 /sca-java-2.x/contrib/modules/section10/src/main/java/org | |
parent | 208281847fe8ed50b5df87837dd29753359f4ed5 (diff) |
Fix to correctly remove nested dependent contributions
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@949346 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/contrib/modules/section10/src/main/java/org')
-rw-r--r-- | sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java b/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java index 09675a1292..60b44588bf 100644 --- a/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java +++ b/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java @@ -163,12 +163,13 @@ public class Section10Impl implements Section10 { public List<String> removeContribution(String contributionURI) throws ActivationException {
List<String> removedContributionURIs = new ArrayList<String>();
- InstalledContribution ic = installedContributions.remove(contributionURI);
+ InstalledContribution ic = installedContributions.get(contributionURI);
if (ic != null) {
removedContributionURIs.add(ic.getURI());
for (String dependent : getDependentContributions(contributionURI)) {
removedContributionURIs.addAll(removeContribution(dependent));
}
+ installedContributions.remove(contributionURI);
for (DeployedComposite dc : ic.getDeployedComposites()) {
dc.unDeploy();
}
@@ -252,9 +253,11 @@ public class Section10Impl implements Section10 { }
Set<String> dependentContributionURIs = new HashSet<String>();
for (InstalledContribution icx : installedContributions.values()) {
- List<Contribution> dependencies = icx.getContribution().getDependencies();
- if (dependencies != null && dependencies.contains(ic.getContribution())) {
- dependentContributionURIs.addAll(getDependentContributions(icx.getURI()));
+ if (ic != icx) {
+ List<Contribution> dependencies = icx.getContribution().getDependencies();
+ if (dependencies != null && dependencies.contains(ic.getContribution())) {
+ dependentContributionURIs.addAll(getDependentContributions(icx.getURI()));
+ }
}
}
return dependentContributionURIs;
|