From 05dcce2d4bfe24cbd564c86c893e497c12dce1ef Mon Sep 17 00:00:00 2001 From: slaws Date: Wed, 11 Nov 2009 12:42:32 +0000 Subject: 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 --- .../org/apache/tuscany/sca/deployment/impl/DeployerImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'java') 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 contributions, List dependencies, Set 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) { -- cgit v1.2.3