Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2010-04-01 13:49:57 -0400
committerSusan Franklin2010-04-01 13:49:57 -0400
commit76a4844d9c51ad5087681ba76e9b15d70f74a95e (patch)
tree952c2da968431b99411fdd40bc9033da2e28b5f6 /bundles
parente5bcabbccf4055b546d4eca794c8bf8b203bb0c8 (diff)
downloadrt.equinox.p2-76a4844d9c51ad5087681ba76e9b15d70f74a95e.tar.gz
rt.equinox.p2-76a4844d9c51ad5087681ba76e9b15d70f74a95e.tar.xz
rt.equinox.p2-76a4844d9c51ad5087681ba76e9b15d70f74a95e.zip
Bug 305534 - Potential unused code in ProvisioningSession
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
index 7241b30eb..d711aa943 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
@@ -138,10 +138,10 @@ public class ProvisioningSession {
IProfile profile = plan.getProfile();
if (plan.getInstallerPlan() != null) {
- if (set instanceof PhaseSetFactory) {
- // If the phase set calls for download and install, then we want to download everything atomically before
- // applying the install plan. This way, we can be sure to install the install handler only if we know
- // we will be able to get everything else.
+ if (doesPhaseSetIncludeDownload(set)) {
+ // If the phase set calls for download, then we want to download the install plan artifacts
+ // at the same time as the actual install artifacts. This way, we will only install the install handler
+ // after already knowing we have successfully obtained the artifacts that will be installed afterward.
ProfileChangeRequest downloadRequest = new ProfileChangeRequest(profile);
downloadRequest.setAbsoluteMode(true);
downloadRequest.addAll(QueryUtil.compoundQueryable(plan.getAdditions(), plan.getInstallerPlan().getAdditions()).query(QueryUtil.createIUAnyQuery(), null).toUnmodifiableSet());
@@ -155,7 +155,7 @@ public class ProvisioningSession {
}
ticksUsed = 300;
}
- // we pre-downloaded if necessary. Now perform the plan against the original phase set.
+ // we pre-downloaded if necessary. Now perform the install plan against the original phase set.
IStatus installerPlanStatus = getEngine().perform(plan.getInstallerPlan(), set, mon.newChild(100));
if (!installerPlanStatus.isOK()) {
mon.done();
@@ -174,6 +174,14 @@ public class ProvisioningSession {
return getEngine().perform(plan, set, mon.newChild(500 - ticksUsed));
}
+ private boolean doesPhaseSetIncludeDownload(IPhaseSet set) {
+ String[] phaseIds = set.getPhaseIds();
+ for (int i = 0; i < phaseIds.length; i++)
+ if (phaseIds[i].equals(PhaseSetFactory.PHASE_COLLECT))
+ return true;
+ return false;
+ }
+
/**
* Return a boolean indicating whether any other provisioning operations are
* scheduled for the specified profile.

Back to the top