diff options
author | Pascal Rapicault | 2010-05-06 18:37:15 +0000 |
---|---|---|
committer | Pascal Rapicault | 2010-05-06 18:37:15 +0000 |
commit | 6c8cbf689f3596bdeca1cca11c53645e6428e71b (patch) | |
tree | 99c6715dd6893eda5ee381a397f40dccf32d15fe /bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations | |
parent | 7ddfcef6a0ef782025cb911bcc30779c2cb6d49e (diff) | |
download | rt.equinox.p2-6c8cbf689f3596bdeca1cca11c53645e6428e71b.tar.gz rt.equinox.p2-6c8cbf689f3596bdeca1cca11c53645e6428e71b.tar.xz rt.equinox.p2-6c8cbf689f3596bdeca1cca11c53645e6428e71b.zip |
Bug 311367 - [ui] deal more gracefully with a null plan in a failed resolution
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations')
2 files changed, 14 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/PlannerResolutionJob.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/PlannerResolutionJob.java index f083b2b40..69c984e56 100644 --- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/PlannerResolutionJob.java +++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/PlannerResolutionJob.java @@ -77,6 +77,7 @@ public class PlannerResolutionJob extends ProvisioningJob implements IProfileCha IStatus status; if (plan == null) { status = new Status(IStatus.ERROR, Activator.ID, Messages.PlannerResolutionJob_NullProvisioningPlan); + additionalStatus.add(status); } else { status = plan.getStatus(); } @@ -94,14 +95,24 @@ public class PlannerResolutionJob extends ProvisioningJob implements IProfileCha successful = secondPass; plan = ((IPlanner) getSession().getProvisioningAgent().getService(IPlanner.SERVICE_NAME)).getProvisioningPlan(request, secondPass, sub.newChild(500)); if (plan == null) { - return new Status(IStatus.ERROR, Activator.ID, Messages.PlannerResolutionJob_NullProvisioningPlan); + status = new Status(IStatus.ERROR, Activator.ID, Messages.PlannerResolutionJob_NullProvisioningPlan); + additionalStatus.add(status); + return status; } return plan.getStatus(); } public ResolutionResult getResolutionResult() { if (report == null) { - report = PlanAnalyzer.computeResolutionResult(request, plan, additionalStatus); + if (plan == null) { + if (additionalStatus.getSeverity() != IStatus.ERROR) { + additionalStatus.add(new Status(IStatus.ERROR, Activator.ID, Messages.PlannerResolutionJob_NullProvisioningPlan)); + } + report = new ResolutionResult(); + report.addSummaryStatus(additionalStatus); + } else { + report = PlanAnalyzer.computeResolutionResult(request, plan, additionalStatus); + } } return report; } diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/messages.properties b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/messages.properties index 24c99f571..1e91ac05c 100644 --- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/messages.properties +++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/messages.properties @@ -22,7 +22,7 @@ PlanAnalyzer_PartialInstall="{0}" is already present because other installed sof PlanAnalyzer_PartialUninstall= "{0}" cannot be fully uninstalled because other installed software requires it. The parts that are not required will be uninstalled. PlanAnalyzer_SideEffectInstall="{0}" will also be installed in order to complete this operation. PlanAnalyzer_SideEffectUninstall="{0}" must be uninstalled in order to complete this operation. -PlannerResolutionJob_NullProvisioningPlan=Could not obtain provisioning plan. No details were available. +PlannerResolutionJob_NullProvisioningPlan=Unexpected Error. Could not process the request. Check the error log for details. PlanAnalyzer_IgnoringImpliedDowngrade="{0}" will be ignored because a newer version is already installed. PlanAnalyzer_ImpliedUpdate="{0}" is already installed, so an update will be performed instead. PlanAnalyzer_Items=Items |