Improve exception messages. (FELIX-2035)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@944411 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
index bdeea79..ac0f29f 100644
--- a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
@@ -985,10 +985,11 @@
ResolveException ex = new ResolveException(
"Constraint violation for package '"
+ entry.getKey() + "' when resolving module "
- + module + " between an imported constraint "
- + sourceBlame + " and an additional imported constraint "
+ + module + " between an import "
+ + sourceBlame + " and a fragment import "
+ blame, module, blame.m_reqs.get(0));
m_logger.log(Logger.LOG_DEBUG, "Conflicting fragment import", ex);
+ throw ex;
}
}
}
@@ -1013,7 +1014,7 @@
: new ResolveException(
"Constraint violation for package '"
+ pkgName + "' when resolving module "
- + module + " between existing exported constraint "
+ + module + " between existing export "
+ entry.getValue() + " and uses constraint "
+ blame, null, null);
mutated = (mutated != null)
@@ -1072,7 +1073,7 @@
: new ResolveException(
"Constraint violation for package '"
+ pkgName + "' when resolving module "
- + module + " between existing imported constraint "
+ + module + " between existing import "
+ importBlame + " and uses constraint "
+ usedBlame, null, null);