Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2019-08-19 10:30:36 -0400
committerMaxime Porhel2019-08-19 10:30:36 -0400
commitf124a2f0362bd33e4be262abee2c3f9d01698e38 (patch)
tree90e69d6ebe864dd15dbd8c94d5ebdccc522921b7
parentcaf52d6d0540fc44f47f9472475b1e71d9cadb5f (diff)
downloadrt.equinox.bundles-master.tar.gz
rt.equinox.bundles-master.tar.xz
rt.equinox.bundles-master.zip
Bug: 550219 - Register CommandProviderAdapter service with the sameHEADI20190821-0600I20190820-1800I20190820-0855I20190820-0600I20190819-2355master
ranking than the adapted CommandProvider service Change-Id: I59c00ad276bf454a71794d9cbb7f753d84e33344 Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
-rw-r--r--[-rwxr-xr-x]bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java
index 71594578..e2a6a43f 100755..100644
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java
@@ -39,6 +39,7 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.condpermadmin.ConditionalPermissionAdmin;
@@ -184,7 +185,12 @@ public class Activator implements BundleActivator {
if (commandMethods.length > 0) {
List<ServiceRegistration<?>> registrations = new ArrayList<>();
- registrations.add(context.registerService(Object.class, new CommandProviderAdapter(command, commandMethods), getAttributes(commandMethods)));
+ Dictionary<String, Object> attributes = getAttributes(commandMethods);
+ Object serviceRanking = reference.getProperty(Constants.SERVICE_RANKING);
+ if (serviceRanking != null) {
+ attributes.put(Constants.SERVICE_RANKING, serviceRanking);
+ }
+ registrations.add(context.registerService(Object.class, new CommandProviderAdapter(command, commandMethods), attributes));
return registrations;
} else {
context.ungetService(reference);

Back to the top