Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWayne Beaton2015-05-27 13:06:01 -0400
committerWayne Beaton2015-05-27 13:06:22 -0400
commiteb1393e1c3ce794bc118c1c72da737a11a6e30d9 (patch)
tree7e81dc9d2ec89ccca11901c772e07dd106d40554
parentb1d947bba7b8bbdcf52338d633c402c7d6df170f (diff)
downloadrt.equinox.p2-eb1393e1c3ce794bc118c1c72da737a11a6e30d9.tar.gz
rt.equinox.p2-eb1393e1c3ce794bc118c1c72da737a11a6e30d9.tar.xz
rt.equinox.p2-eb1393e1c3ce794bc118c1c72da737a11a6e30d9.zip
Bug 390470 - o.e.e.p2.core does not select services based on ranking.I20150531-2000I20150529-2000I20150528-0700I20150527-2010
When hunting for a service, use the one with the highest ranking. Change-Id: Idd06b037685602b5a54b6ee767f7ba04b71b443d Signed-off-by: Wayne Beaton <wayne@eclipse.org>
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java
index 954691dce..0a18fef65 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java
@@ -51,16 +51,16 @@ public class ProvisioningAgent implements IProvisioningAgent, ServiceTrackerCust
if (service != null)
return service;
//attempt to get factory service from service registry
- PriorityQueue<ServiceReference<IAgentServiceFactory>> refs;
+ Collection<ServiceReference<IAgentServiceFactory>> refs;
try {
- refs = new PriorityQueue<ServiceReference<IAgentServiceFactory>>(context.getServiceReferences(IAgentServiceFactory.class, "(" + IAgentServiceFactory.PROP_CREATED_SERVICE_NAME + '=' + serviceName + ')')); //$NON-NLS-1$ } catch (InvalidSyntaxException e) {
+ refs = context.getServiceReferences(IAgentServiceFactory.class, "(" + IAgentServiceFactory.PROP_CREATED_SERVICE_NAME + '=' + serviceName + ')'); //$NON-NLS-1$
} catch (InvalidSyntaxException e) {
e.printStackTrace();
return null;
}
if (refs == null || refs.isEmpty())
return null;
- ServiceReference<IAgentServiceFactory> firstRef = refs.peek();
+ ServiceReference<IAgentServiceFactory> firstRef = Collections.max(refs);
//track the factory so that we can automatically remove the service when the factory goes away
ServiceTracker<IAgentServiceFactory, Object> tracker = new ServiceTracker<IAgentServiceFactory, Object>(context, firstRef, this);
tracker.open();

Back to the top