summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/domain-node/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main/java')
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
index e397fd219b..a0889ee9d3 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
@@ -434,24 +434,28 @@ public class NodeImpl implements Node {
}
protected List<Contribution> calculateDependentContributions(ContributionDescription cd) throws ContributionReadException, ValidationException {
- List<Contribution> dependentContributions = new ArrayList<Contribution>();
+ Map<String, Contribution> dependentContributions = new HashMap<String, Contribution>();
if (cd.getDependentContributionURIs() != null && cd.getDependentContributionURIs().size() > 0) {
// if the install specified dependent uris use just those contributions
for (String uri : cd.getDependentContributionURIs()) {
- ContributionDescription dependee = domainRegistry.getInstalledContribution(uri);
- if (dependee != null) {
- dependentContributions.add(loadContribution(dependee));
+ if (!!!dependentContributions.containsKey(uri)) {
+ ContributionDescription dependee = domainRegistry.getInstalledContribution(uri);
+ if (dependee != null) {
+ dependentContributions.put(uri, loadContribution(dependee));
+ }
}
}
} else {
for (Import imprt : loadContribution(cd).getImports()) {
for (ContributionDescription exportingIC : findExportingContributions(imprt)) {
- dependentContributions.add(loadContribution(exportingIC));
+ if (!!!dependentContributions.containsKey(exportingIC.getURI())) {
+ dependentContributions.put(exportingIC.getURI(), loadContribution(exportingIC));
+ }
}
}
}
// TODO: there is also the location attribute on the import which should be taken into account
- return dependentContributions;
+ return new ArrayList<Contribution>(dependentContributions.values());
}
private List<ContributionDescription> findExportingContributions(Import imprt) {