summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2009-08-07 15:29:22 +0000
committeredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2009-08-07 15:29:22 +0000
commitf7419d1dfd3a0a6f33130bc6e0b7686b21d27792 (patch)
treebabc478556315b19abd56483da422e35d0b258e0
parentc8ad3349be496002e8e7aa7c091d7329185df140 (diff)
Better handling of case where contribution import is not satisfied, to avoid NPE when attempting to resolve artifacts against that import. Modified code in addContributionDependencies(...).
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@802046 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
index 9d7927a81c..ea8b00a489 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
@@ -248,13 +248,12 @@ public class NodeFactoryImpl extends NodeFactory {
// Now add the dependencies of that contribution
addContributionDependencies(dependency, contributions, dependencies, set, monitor);
- }
- }
- }
- }
+ } // end if
+ } // end if
+ } // end for
+ } // end for
if (resolved) {
-
// Initialize the import's model resolver with a delegating model
// resolver which will delegate to the matching exports
import_.setModelResolver(new DefaultImportModelResolver(matchingExports));
@@ -262,9 +261,11 @@ public class NodeFactoryImpl extends NodeFactory {
} else {
// Record import resolution issue
if (!(import_ instanceof DefaultImport)) {
+ // Add the (empty) matchingExports List and report a warning
+ import_.setModelResolver(new DefaultImportModelResolver(matchingExports));
warning(monitor, "UnresolvedImport", import_, import_);
}
- }
+ } // end if
}
}