summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 12:42:32 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 12:42:32 +0000
commit05dcce2d4bfe24cbd564c86c893e497c12dce1ef (patch)
treefe469b05b85aaf68a8438d8dc86174d2788d5cb9 /java/sca
parent126a674ca501f81f793c517cc27aea2d242c0075 (diff)
Record some context for import not found errors
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834856 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java b/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
index e843db118a..cf4317734e 100644
--- a/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
+++ b/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
@@ -141,7 +141,7 @@ public class DeployerImpl implements Deployer {
List<Contribution> contributions,
List<Contribution> dependencies,
Set<Contribution> set,
- Monitor monitor) {
+ Monitor monitor) {
// Go through the contribution imports
for (Import import_ : contribution.getImports()) {
@@ -195,7 +195,13 @@ public class DeployerImpl implements Deployer {
if (!(import_ instanceof DefaultImport)) {
// Add the (empty) matchingExports List and report a warning
import_.setModelResolver(new DefaultImportModelResolver(matchingExports));
+
+ // push context here as the "stack" in this case is a list of nexted contributions
+ // through which imports have been chased which may not make much sense to the
+ // user so just report the contribution in error
+ monitor.pushContext("Contribution: " + contribution.getLocation());
Monitor.error(monitor, this, DEPLOYER_IMPL_VALIDATION_MESSAGES, "UnresolvedImport", import_);
+ monitor.popContext();
}
} // end if
}
@@ -385,7 +391,7 @@ public class DeployerImpl implements Deployer {
// get all definitions.xml artifacts from contributions and aggregate
// into the system contribution. In turn add a default import into
- // each contribution so that for unresolved items the resolution
+ // each contribution so that, for unresolved items, the resolution
// processing will look in the system contribution
ProcessorContext context = new ProcessorContext(monitor);
for (Contribution contribution : contributionList) {