diff options
author | Maxime Porhel | 2019-08-19 14:30:36 +0000 |
---|---|---|
committer | Maxime Porhel | 2019-08-19 14:30:36 +0000 |
commit | f124a2f0362bd33e4be262abee2c3f9d01698e38 (patch) | |
tree | 90e69d6ebe864dd15dbd8c94d5ebdccc522921b7 | |
parent | caf52d6d0540fc44f47f9472475b1e71d9cadb5f (diff) | |
download | rt.equinox.bundles-f124a2f0362bd33e4be262abee2c3f9d01698e38.tar.gz rt.equinox.bundles-f124a2f0362bd33e4be262abee2c3f9d01698e38.tar.xz rt.equinox.bundles-f124a2f0362bd33e4be262abee2c3f9d01698e38.zip |
Bug: 550219 - Register CommandProviderAdapter service with the sameY20190822-0900S4_13_0_M3I20190826-0415I20190823-0840I20190823-0530I20190821-1800I20190821-0600I20190820-1800I20190820-0855I20190820-0600I20190819-2355
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.java | 8 |
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 71594578b..e2a6a43fa 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); |