Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (JBoss)2013-04-28 01:19:35 +0000
committerPascal Rapicault2013-04-28 01:19:35 +0000
commited8286b4e552a81ac0b19a0ea0ec264424f2d1ae (patch)
tree0aac1e7c8d410eb23155a06ee9b43429664de17e
parent4e3182294b1da0eeff3a346b565f8371c530b9ed (diff)
downloadrt.equinox.p2-ed8286b4e552a81ac0b19a0ea0ec264424f2d1ae.tar.gz
rt.equinox.p2-ed8286b4e552a81ac0b19a0ea0ec264424f2d1ae.tar.xz
rt.equinox.p2-ed8286b4e552a81ac0b19a0ea0ec264424f2d1ae.zip
Disable explanation when looking for remediations
The explanation don't need to be computed because they are never shown and they take time to compute.
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RequestFlexer.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RequestFlexer.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RequestFlexer.java
index 8d66a4829..1677a0631 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RequestFlexer.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RequestFlexer.java
@@ -29,6 +29,7 @@ public class RequestFlexer {
final String INCLUSION_RULES = "org.eclipse.equinox.p2.internal.inclusion.rules"; //$NON-NLS-1$
final String INCLUSION_OPTIONAL = "OPTIONAL"; //$NON-NLS-1$
final String INCLUSION_STRICT = "STRICT"; //$NON-NLS-1$
+ final String EXPLANATION_ENABLEMENT = "org.eclipse.equinox.p2.director.explain"; //$NON-NLS-1$
IPlanner planner;
@@ -220,8 +221,18 @@ public class RequestFlexer {
}
private IProvisioningPlan resolve(IProfileChangeRequest temporaryRequest) {
- temporaryRequest.setProfileProperty("_internal_user_defined_", "true");
- return planner.getProvisioningPlan(temporaryRequest, provisioningContext, null);
+ String explainPropertyBackup = null;
+ try {
+ temporaryRequest.setProfileProperty("_internal_user_defined_", "true");
+ explainPropertyBackup = provisioningContext.getProperty(EXPLANATION_ENABLEMENT);
+ provisioningContext.setProperty(EXPLANATION_ENABLEMENT, Boolean.FALSE.toString());
+ return planner.getProvisioningPlan(temporaryRequest, provisioningContext, null);
+ } finally {
+ if (explainPropertyBackup == null)
+ provisioningContext.getProperties().remove(EXPLANATION_ENABLEMENT);
+ else
+ provisioningContext.setProperty(EXPLANATION_ENABLEMENT, explainPropertyBackup);
+ }
}
//Loosen the request originally emitted.

Back to the top