Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2008-08-25 19:42:32 +0000
committerJohn Arthorne2008-08-25 19:42:32 +0000
commit0a85a72a9d01def1f62281496c5e9160bd556826 (patch)
tree4a08b100ae4b17dbb3a7fa60b3033994f48b2e1d /bundles/org.eclipse.equinox.p2.director/src/org/eclipse
parent5642b42ebdca10133784cf2cea95a10ec673677a (diff)
downloadrt.equinox.p2-0a85a72a9d01def1f62281496c5e9160bd556826.tar.gz
rt.equinox.p2-0a85a72a9d01def1f62281496c5e9160bd556826.tar.xz
rt.equinox.p2-0a85a72a9d01def1f62281496c5e9160bd556826.zip
Bug 240062 Reformat/simplify resolver status messages
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.director/src/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/NewDependencyExpander.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties2
2 files changed, 27 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/NewDependencyExpander.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/NewDependencyExpander.java
index 7d403dd80..ccb1245aa 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/NewDependencyExpander.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/NewDependencyExpander.java
@@ -46,10 +46,34 @@ public class NewDependencyExpander {
}
/**
- * For debugging purposes only
+ * Prints out a human-readable representation of a Match object for use
+ * in error messages.
*/
public String toString() {
- return "Match[" + req + ']'; //$NON-NLS-1$
+ if (req == null)
+ return "[]"; //$NON-NLS-1$
+ StringBuffer result = new StringBuffer();
+ if (IInstallableUnit.NAMESPACE_IU_ID.equals(req.getNamespace())) {
+ //print nothing for an IU id dependency because this is the default (most common) case
+ result.append(""); //$NON-NLS-1$
+ } else if ("osgi.bundle".equals(req.getNamespace())) { //$NON-NLS-1$
+ result.append("bundle"); //$NON-NLS-1$
+ } else if ("java.package".equals(req.getNamespace())) { //$NON-NLS-1$
+ result.append("package"); //$NON-NLS-1$
+ } else {
+ result.append(req.getNamespace());
+ }
+ if (result.length() > 0)
+ result.append(' ');
+ result.append(req.getName());
+ result.append(' ');
+ VersionRange range = req.getRange();
+ //for an exact version match, print a simpler expression
+ if (range.getMinimum().equals(range.getMaximum()))
+ result.append('[').append(range.getMinimum()).append(']');
+ else
+ result.append(range);
+ return result.toString();
}
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties
index c22af9218..e20077a8d 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties
@@ -31,4 +31,4 @@ Planner_Unsatisfied_dependency=Unable to satisfy dependency from {0} to {1}.
Planner_NoSolution=Cannot complete the request. Generating details.
Old_Resolver_Several_Versions=Cannot find a solution satisfying the following requirements {0}.
-Old_Resolver_Incompatible_Versions=Cannot find a solution where both {0} and {1} can be satisfied. \ No newline at end of file
+Old_Resolver_Incompatible_Versions=Cannot find a solution where both "{0}" and "{1}" are satisfied. \ No newline at end of file

Back to the top