aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2013-12-04 10:25:06 (EST)
committerJohn Ross2013-12-05 16:10:53 (EST)
commitb136d6277a21a1a3dc745511d27c4df940b3338d (patch)
tree84aee0e374b37c9c7e1c3c6dbb8ee98db3b383db
parent111ae43b1f4daef99e59541c982eeac256c49ca8 (diff)
downloadrt.equinox.framework-b136d6277a21a1a3dc745511d27c4df940b3338d.zip
rt.equinox.framework-b136d6277a21a1a3dc745511d27c4df940b3338d.tar.gz
rt.equinox.framework-b136d6277a21a1a3dc745511d27c4df940b3338d.tar.bz2
[Bug 420067] Add support for org.eclipse.osgi/resolver/uses resolver trace option.
Setting org.eclipse.osgi/resolver/uses = true will print out information about uses constraint violations.
-rw-r--r--bundles/org.eclipse.osgi/.options2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java15
2 files changed, 17 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/.options b/bundles/org.eclipse.osgi/.options
index 7a962b4..63d78da 100644
--- a/bundles/org.eclipse.osgi/.options
+++ b/bundles/org.eclipse.osgi/.options
@@ -47,6 +47,8 @@ org.eclipse.osgi/resolver/providers = false
# Displays information about capabilities or resources that were filtered by
# resolver hooks.
org.eclipse.osgi/resolver/hooks = false
+# Displays information about uses constraint violations.
+org.eclipse.osgi/resolver/uses = false
#### Profile settings
org.eclipse.osgi/profile/startup = false
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java
index 5d173de..eecdd5c 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java
@@ -42,10 +42,12 @@ final class ModuleResolver {
private static final String OPTION_RESOLVER = EquinoxContainer.NAME + "/resolver"; //$NON-NLS-1$
private static final String OPTION_PROVIDERS = OPTION_RESOLVER + "/providers"; //$NON-NLS-1$
private static final String OPTION_HOOKS = OPTION_RESOLVER + "/hooks"; //$NON-NLS-1$
+ private static final String OPTION_USES = OPTION_RESOLVER + "/uses"; //$NON-NLS-1$
static boolean DEBUG_RESOLVER = false;
static boolean DEBUG_PROVIDERS = false;
static boolean DEBUG_HOOKS = false;
+ static boolean DEBUG_USES = false;
private void setDebugOptions() {
DebugOptions options = adaptor.getDebugOptions();
@@ -55,6 +57,7 @@ final class ModuleResolver {
DEBUG_RESOLVER = options.getBooleanOption(OPTION_RESOLVER, false);
DEBUG_PROVIDERS = options.getBooleanOption(OPTION_PROVIDERS, false);
DEBUG_HOOKS = options.getBooleanOption(OPTION_HOOKS, false);
+ DEBUG_USES = options.getBooleanOption(OPTION_USES, false);
}
private static final Collection<String> NON_PAYLOAD_CAPABILITIES = Arrays.asList(IdentityNamespace.IDENTITY_NAMESPACE);
@@ -453,6 +456,18 @@ final class ModuleResolver {
errors = new HashMap<Resource, ResolutionException>();
}
errors.put(resource, error);
+ if (DEBUG_RESOLVER || DEBUG_USES) {
+ Debug.println(new StringBuilder("RESOLVER: Uses constraint violation") //$NON-NLS-1$
+ .append(SEPARATOR).append(TAB) //
+ .append("Resource") //$NON-NLS-1$
+ .append(SEPARATOR).append(TAB).append(TAB) //
+ .append(resource) //
+ .append(SEPARATOR).append(TAB) //
+ .append("Error") //$NON-NLS-1$
+ .append(SEPARATOR).append(TAB).append(TAB) //
+ .append(error.getMessage()) //
+ .toString());
+ }
}
Map<Resource, ResolutionException> getUsesConstraintViolations() {