diff --git a/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF index 571b2ab8b7f..73514ea6287 100644 --- a/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF @@ -8,6 +8,7 @@ Bundle-Vendor: %bundleVendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.apache.felix.service.command;version="[1.0,2.0)", + org.eclipse.osgi.container;version="[1.7.0,2.0.0]", org.eclipse.osgi.framework.console, org.eclipse.osgi.report.resolution;version="[1.0,2.0)", org.eclipse.osgi.service.environment, 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 307b9d8a73e..f809029e41c 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 @@ -34,6 +34,7 @@ import org.eclipse.equinox.console.commands.EquinoxCommandProvider; import org.eclipse.equinox.console.commands.HelpCommand; import org.eclipse.equinox.console.commands.ManCommand; +import org.eclipse.equinox.console.commands.WireCommand; import org.eclipse.equinox.console.telnet.TelnetCommand; import org.eclipse.osgi.framework.console.CommandInterpreter; import org.eclipse.osgi.framework.console.CommandProvider; @@ -324,6 +325,9 @@ public void start(BundleContext context) throws Exception { CommandsTracker commandsTracker = new CommandsTracker(context); context.registerService(CommandsTracker.class.getName(), commandsTracker, null); + + WireCommand wireCommand = new WireCommand(context); + wireCommand.startService(); GOGO.RUNTIME.start(frameworkWiring); GOGO.SHELL.start(frameworkWiring); diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/WireCommand.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/WireCommand.java new file mode 100644 index 00000000000..95e7ba6053e --- /dev/null +++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/WireCommand.java @@ -0,0 +1,121 @@ +/******************************************************************************* + * Copyright (c) 2024 Christoph Läubrich and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Christoph Läubrich - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.console.commands; + +import java.io.PrintStream; +import java.util.Comparator; +import java.util.Dictionary; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.felix.service.command.CommandProcessor; +import org.apache.felix.service.command.CommandSession; +import org.apache.felix.service.command.Descriptor; +import org.eclipse.osgi.container.ModuleContainer; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.wiring.BundleRevision; +import org.osgi.framework.wiring.BundleWire; +import org.osgi.framework.wiring.BundleWiring; +import org.osgi.resource.Resource; + +/** + * Provides a "wires" command to print information about the wiring of a bundle + */ +public class WireCommand { + + private static final Comparator BUNDLE_REVISIONS_BY_NAME = Comparator.comparing( + BundleRevision::getSymbolicName, String.CASE_INSENSITIVE_ORDER); + + private BundleContext context; + + public WireCommand(BundleContext context) { + this.context = context; + } + + @Descriptor("Prints information about the wiring of a particular bundle") + public void wires(CommandSession session, long id) { + PrintStream console = session.getConsole(); + Bundle bundle = context.getBundle(id); + if (bundle == null) { + console.println(String.format("Bundle with id %d not found!", id)); + return; + } + BundleWiring bundleWiring = bundle.adapt(BundleWiring.class); + if (bundleWiring == null) { + console.println(String.format("Bundle with id %d has no wiring!", id)); + return; + } + console.println("Bundle " + bundle.getSymbolicName() + " " + bundle.getVersion() + ":"); + printWiring(console, bundleWiring); + } + + static void printWiring(PrintStream console, BundleWiring bundleWiring) { + BundleRevision resource = bundleWiring.getResource(); + Map> usedWires = + bundleWiring.getRequiredWires(null).stream() + .filter(bw -> !resource.equals(bw.getProvider())) + .collect(Collectors.groupingBy(BundleWire::getProvider)); + if (usedWires.isEmpty()) { + console.println("is not wired to any other bundle"); + } else { + console.println("is wired to:"); + usedWires.entrySet().stream().sorted(Comparator + .comparing(java.util.Map.Entry::getKey, BUNDLE_REVISIONS_BY_NAME)) + .forEach(bre -> { + console.println("\t - " + getResource(bre.getKey())); + for (BundleWire bw : bre.getValue()) { + console.println("\t - because of " + + ModuleContainer.toString(bw.getRequirement())); + } + }); + + } + Map> consumersWires = + bundleWiring.getProvidedWires(null).stream() + .collect(Collectors.groupingBy(BundleWire::getRequirer)); + if (consumersWires.isEmpty()) { + console.println("and is not consumed by any bundle"); + } else { + console.println("and is consumed by:"); + consumersWires.entrySet().stream().sorted(Comparator + .comparing(java.util.Map.Entry::getKey, BUNDLE_REVISIONS_BY_NAME)) + .forEach(bre -> { + console.println("\t - " + getResource(bre.getKey())); + for (BundleWire bw : bre.getValue()) { + console.println("\t - because it " + + ModuleContainer.toString(bw.getRequirement())); + } + }); + } + } + + static String getResource(Resource resource) { + if (resource instanceof BundleRevision) { + BundleRevision bundleRevision = (BundleRevision) resource; + return bundleRevision.getSymbolicName() + " " + bundleRevision.getVersion(); + } + return String.valueOf(resource); + } + + public void startService() { + Dictionary dict = new Hashtable<>(); + dict.put(CommandProcessor.COMMAND_SCOPE, "wiring"); + dict.put(CommandProcessor.COMMAND_FUNCTION, new String[] { "wires" }); + context.registerService(WireCommand.class, this, dict); + } + +} \ No newline at end of file diff --git a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF index 0ac197c8833..f3088f9f78c 100644 --- a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Export-Package: org.eclipse.core.runtime.adaptor;x-friends:="org.eclipse.core.runtime", org.eclipse.core.runtime.internal.adaptor;x-internal:=true, org.eclipse.equinox.log;version="1.1";uses:="org.osgi.framework,org.osgi.service.log", - org.eclipse.osgi.container;version="1.6"; + org.eclipse.osgi.container;version="1.7.0"; uses:="org.eclipse.osgi.report.resolution, org.osgi.framework.wiring, org.eclipse.osgi.framework.eventmgr, @@ -107,7 +107,7 @@ Bundle-Activator: org.eclipse.osgi.internal.framework.SystemBundleActivator Bundle-Description: %systemBundle Bundle-Copyright: %copyright Bundle-Vendor: %eclipse.org -Bundle-Version: 3.18.700.qualifier +Bundle-Version: 3.19.0.qualifier Bundle-Localization: systembundle Bundle-DocUrl: http://www.eclipse.org Eclipse-ExtensibleAPI: true diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleCapability.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleCapability.java index 5c70edd4d71..7b3921b2af3 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleCapability.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleCapability.java @@ -88,6 +88,6 @@ public ModuleRevision getResource() { @Override public String toString() { - return namespace + ModuleRevision.toString(attributes, false) + ModuleRevision.toString(directives, true); + return namespace + ModuleContainer.toString(attributes, false) + ModuleContainer.toString(directives, true); } } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainer.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainer.java index 3f779be8691..30407453737 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainer.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainer.java @@ -54,6 +54,7 @@ import org.eclipse.osgi.internal.container.NamespaceList; import org.eclipse.osgi.internal.debug.Debug; import org.eclipse.osgi.internal.framework.EquinoxConfiguration; +import org.eclipse.osgi.internal.framework.FilterImpl; import org.eclipse.osgi.internal.messages.Msg; import org.eclipse.osgi.report.resolution.ResolutionReport; import org.eclipse.osgi.report.resolution.ResolutionReport.Entry; @@ -66,7 +67,9 @@ import org.osgi.framework.BundleException; import org.osgi.framework.Constants; import org.osgi.framework.FrameworkListener; +import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.Version; +import org.osgi.framework.namespace.BundleNamespace; import org.osgi.framework.namespace.HostNamespace; import org.osgi.framework.namespace.IdentityNamespace; import org.osgi.framework.namespace.PackageNamespace; @@ -74,6 +77,7 @@ import org.osgi.framework.wiring.BundleCapability; import org.osgi.framework.wiring.BundleRevision; import org.osgi.framework.wiring.FrameworkWiring; +import org.osgi.resource.Capability; import org.osgi.resource.Namespace; import org.osgi.resource.Requirement; import org.osgi.resource.Resource; @@ -223,6 +227,112 @@ public static Requirement createRequirement(String namespace, Map attributes = new HashMap<>(cap.getAttributes()); + Map directives = cap.getDirectives(); + String name = String.valueOf(attributes.remove(cap.getNamespace())); + return name + toString(attributes, false, true) + toString(directives, true, true); + } + + /** + * Generates a human readable string representation of the the given + * requirement, mapping the namespace to well-known header names. + * + * @param requirement the {@link Requirement} for which a string representation is + * desired + * @since 3.19 + */ + public static String toString(Requirement requirement) { + if (PackageNamespace.PACKAGE_NAMESPACE.equals(requirement.getNamespace())) { + return Constants.IMPORT_PACKAGE + ": " //$NON-NLS-1$ + + createOSGiRequirement(requirement, PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE, + PackageNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE); + } else if (BundleNamespace.BUNDLE_NAMESPACE.equals(requirement.getNamespace())) { + return Constants.REQUIRE_BUNDLE + ": " //$NON-NLS-1$ + + createOSGiRequirement(requirement, BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE); + } else if (HostNamespace.HOST_NAMESPACE.equals(requirement.getNamespace())) { + return Constants.FRAGMENT_HOST + ": " //$NON-NLS-1$ + + createOSGiRequirement(requirement, HostNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE); + } + return Constants.REQUIRE_CAPABILITY + ": " + requirement.toString(); //$NON-NLS-1$ + } + + private static String createOSGiRequirement(Requirement requirement, String... versions) { + Map directives = new HashMap<>(requirement.getDirectives()); + String filter = directives.remove(Namespace.REQUIREMENT_FILTER_DIRECTIVE); + if (filter == null) + throw new IllegalArgumentException("No filter directive found:" + requirement); //$NON-NLS-1$ + FilterImpl filterImpl; + try { + filterImpl = FilterImpl.newInstance(filter); + } catch (InvalidSyntaxException e) { + throw new IllegalArgumentException("Invalid filter directive", e); //$NON-NLS-1$ + } + Map matchingAttributes = filterImpl.getStandardOSGiAttributes(versions); + String name = matchingAttributes.remove(requirement.getNamespace()); + if (name == null) + throw new IllegalArgumentException("Invalid requirement: " + requirement); //$NON-NLS-1$ + return name + toString(matchingAttributes, false, true) + toString(directives, true, true); + } + + static String toString(Map map, boolean directives) { + return toString(map, directives, false); + } + + static String toString(Map map, boolean directives, boolean stringsOnly) { + if (map.size() == 0) + return ""; //$NON-NLS-1$ + String assignment = directives ? ":=" : "="; //$NON-NLS-1$ //$NON-NLS-2$ + Set> set = map.entrySet(); + StringBuilder sb = new StringBuilder(); + for (java.util.Map.Entry entry : set) { + sb.append("; "); //$NON-NLS-1$ + String key = entry.getKey(); + Object value = entry.getValue(); + if (value instanceof List) { + @SuppressWarnings("unchecked") + List list = (List) value; + if (list.isEmpty()) + continue; + Object component = list.get(0); + String className = component.getClass().getName(); + String type = className.substring(className.lastIndexOf('.') + 1); + sb.append(key).append(':').append("List<").append(type).append(">").append(assignment).append('"'); //$NON-NLS-1$ //$NON-NLS-2$ + for (Object object : list) + sb.append(object).append(','); + sb.setLength(sb.length() - 1); + sb.append('"'); + } else { + String type = ""; //$NON-NLS-1$ + if (!(value instanceof String) && !stringsOnly) { + String className = value.getClass().getName(); + type = ":" + className.substring(className.lastIndexOf('.') + 1); //$NON-NLS-1$ + } + sb.append(key).append(type).append(assignment).append('"').append(value).append('"'); + } + } + return sb.toString(); + } + /** * Installs a new module using the specified location. The specified * builder is used to create a new {@link ModuleRevision revision} @@ -1937,4 +2047,4 @@ String toString(Module m) { return b != null ? b.toString() : m.toString(); } } -} +} \ No newline at end of file diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRequirement.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRequirement.java index 42f69c1c96c..11d1067de8b 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRequirement.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRequirement.java @@ -18,7 +18,9 @@ import org.eclipse.osgi.internal.container.Capabilities; import org.eclipse.osgi.internal.framework.FilterImpl; import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.namespace.*; +import org.osgi.framework.namespace.BundleNamespace; +import org.osgi.framework.namespace.HostNamespace; +import org.osgi.framework.namespace.PackageNamespace; import org.osgi.framework.wiring.BundleCapability; import org.osgi.framework.wiring.BundleRequirement; import org.osgi.resource.Namespace; @@ -87,7 +89,7 @@ public ModuleRevision getResource() { @Override public String toString() { - return namespace + ModuleRevision.toString(attributes, false) + ModuleRevision.toString(directives, true); + return namespace + ModuleContainer.toString(attributes, false) + ModuleContainer.toString(directives, true); } private static final String PACKAGENAME_FILTER_COMPONENT = PackageNamespace.PACKAGE_NAMESPACE + "="; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolutionReport.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolutionReport.java index edd51c87eaa..9a31bcb5881 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolutionReport.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolutionReport.java @@ -20,17 +20,10 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.eclipse.osgi.internal.framework.FilterImpl; import org.eclipse.osgi.internal.messages.Msg; import org.eclipse.osgi.report.resolution.ResolutionReport; -import org.osgi.framework.Constants; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.namespace.BundleNamespace; -import org.osgi.framework.namespace.HostNamespace; -import org.osgi.framework.namespace.PackageNamespace; import org.osgi.framework.wiring.BundleRevision; import org.osgi.resource.Capability; -import org.osgi.resource.Namespace; import org.osgi.resource.Requirement; import org.osgi.resource.Resource; import org.osgi.resource.Wire; @@ -132,7 +125,8 @@ private static String getResolutionReport0(String prepend, ModuleRevision revisi private static void printResolutionEntry(StringBuilder result, String prepend, ResolutionReport.Entry entry, Map> reportEntries, Set visited) { switch (entry.getType()) { case MISSING_CAPABILITY : - result.append(prepend).append(Msg.ModuleResolutionReport_UnresolvedReq).append(printRequirement(entry.getData())).append('\n'); + result.append(prepend).append(Msg.ModuleResolutionReport_UnresolvedReq) + .append(ModuleContainer.toString((Requirement) entry.getData())).append('\n'); break; case SINGLETON_SELECTION : result.append(prepend).append(Msg.ModuleResolutionReport_AnotherSingleton).append(entry.getData()).append('\n'); @@ -147,8 +141,11 @@ private static void printResolutionEntry(StringBuilder result, String prepend, R Capability unresolvedCapability = unresolvedCapabilities.iterator().next(); // make sure this is not a case of importing and exporting the same package if (!unresolvedRequirement.getKey().getResource().equals(unresolvedCapability.getResource())) { - result.append(prepend).append(Msg.ModuleResolutionReport_UnresolvedReq).append(printRequirement(unresolvedRequirement.getKey())).append('\n'); - result.append(prepend).append(" -> ").append(printCapability(unresolvedCapability)).append('\n'); //$NON-NLS-1$ + result.append(prepend).append(Msg.ModuleResolutionReport_UnresolvedReq) + .append(ModuleContainer.toString(unresolvedRequirement.getKey())) + .append('\n'); + result.append(prepend).append(" -> ") //$NON-NLS-1$ + .append(ModuleContainer.toString(unresolvedCapability)).append('\n'); result.append(getResolutionReport0(prepend + " ", (ModuleRevision) unresolvedCapability.getResource(), reportEntries, visited)); //$NON-NLS-1$ } } @@ -167,57 +164,6 @@ private static void printResolutionEntry(StringBuilder result, String prepend, R } } - private static Object printCapability(Capability cap) { - if (PackageNamespace.PACKAGE_NAMESPACE.equals(cap.getNamespace())) { - return Constants.EXPORT_PACKAGE + ": " + createOSGiCapability(cap); //$NON-NLS-1$ - } else if (BundleNamespace.BUNDLE_NAMESPACE.equals(cap.getNamespace())) { - return Constants.BUNDLE_SYMBOLICNAME + ": " + createOSGiCapability(cap); //$NON-NLS-1$ - } else if (HostNamespace.HOST_NAMESPACE.equals(cap.getNamespace())) { - return Constants.BUNDLE_SYMBOLICNAME + ": " + createOSGiCapability(cap); //$NON-NLS-1$ - } - return Constants.PROVIDE_CAPABILITY + ": " + cap.toString(); //$NON-NLS-1$ - } - - private static String createOSGiCapability(Capability cap) { - Map attributes = new HashMap<>(cap.getAttributes()); - Map directives = cap.getDirectives(); - String name = String.valueOf(attributes.remove(cap.getNamespace())); - return name + ModuleRevision.toString(attributes, false, true) + ModuleRevision.toString(directives, true, true); - } - - private static String printRequirement(Object data) { - if (!(data instanceof Requirement)) { - return String.valueOf(data); - } - Requirement req = (Requirement) data; - if (PackageNamespace.PACKAGE_NAMESPACE.equals(req.getNamespace())) { - return Constants.IMPORT_PACKAGE + ": " + createOSGiRequirement(req, PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE, PackageNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE); //$NON-NLS-1$ - } else if (BundleNamespace.BUNDLE_NAMESPACE.equals(req.getNamespace())) { - return Constants.REQUIRE_BUNDLE + ": " + createOSGiRequirement(req, BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE); //$NON-NLS-1$ - } else if (HostNamespace.HOST_NAMESPACE.equals(req.getNamespace())) { - return Constants.FRAGMENT_HOST + ": " + createOSGiRequirement(req, HostNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE); //$NON-NLS-1$ - } - return Constants.REQUIRE_CAPABILITY + ": " + req.toString(); //$NON-NLS-1$ - } - - private static String createOSGiRequirement(Requirement requirement, String... versions) { - Map directives = new HashMap<>(requirement.getDirectives()); - String filter = directives.remove(Namespace.REQUIREMENT_FILTER_DIRECTIVE); - if (filter == null) - throw new IllegalArgumentException("No filter directive found:" + requirement); //$NON-NLS-1$ - FilterImpl filterImpl; - try { - filterImpl = FilterImpl.newInstance(filter); - } catch (InvalidSyntaxException e) { - throw new IllegalArgumentException("Invalid filter directive", e); //$NON-NLS-1$ - } - Map matchingAttributes = filterImpl.getStandardOSGiAttributes(versions); - String name = matchingAttributes.remove(requirement.getNamespace()); - if (name == null) - throw new IllegalArgumentException("Invalid requirement: " + requirement); //$NON-NLS-1$ - return name + ModuleRevision.toString(matchingAttributes, false, true) + ModuleRevision.toString(directives, true, true); - } - @Override public String getResolutionReportMessage(Resource resource) { return getResolutionReport0(null, (ModuleRevision) resource, getEntries(), null); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevision.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevision.java index b75f9965033..c6fff064806 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevision.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevision.java @@ -17,8 +17,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; import java.util.function.Function; import org.eclipse.osgi.container.ModuleRevisionBuilder.GenericInfo; import org.eclipse.osgi.container.namespaces.EquinoxModuleDataNamespace; @@ -202,45 +200,6 @@ public String toString() { return identities.get(0).toString(); } - static String toString(Map map, boolean directives) { - return toString(map, directives, false); - } - - static String toString(Map map, boolean directives, boolean stringsOnly) { - if (map.size() == 0) - return ""; //$NON-NLS-1$ - String assignment = directives ? ":=" : "="; //$NON-NLS-1$ //$NON-NLS-2$ - Set> set = map.entrySet(); - StringBuilder sb = new StringBuilder(); - for (Entry entry : set) { - sb.append("; "); //$NON-NLS-1$ - String key = entry.getKey(); - Object value = entry.getValue(); - if (value instanceof List) { - @SuppressWarnings("unchecked") - List list = (List) value; - if (list.isEmpty()) - continue; - Object component = list.get(0); - String className = component.getClass().getName(); - String type = className.substring(className.lastIndexOf('.') + 1); - sb.append(key).append(':').append("List<").append(type).append(">").append(assignment).append('"'); //$NON-NLS-1$ //$NON-NLS-2$ - for (Object object : list) - sb.append(object).append(','); - sb.setLength(sb.length() - 1); - sb.append('"'); - } else { - String type = ""; //$NON-NLS-1$ - if (!(value instanceof String) && !stringsOnly) { - String className = value.getClass().getName(); - type = ":" + className.substring(className.lastIndexOf('.') + 1); //$NON-NLS-1$ - } - sb.append(key).append(type).append(assignment).append('"').append(value).append('"'); - } - } - return sb.toString(); - } - NamespaceList getCapabilities() { return capabilities; } diff --git a/bundles/org.eclipse.osgi/pom.xml b/bundles/org.eclipse.osgi/pom.xml index d2e4d7a569c..e553f13ed5d 100644 --- a/bundles/org.eclipse.osgi/pom.xml +++ b/bundles/org.eclipse.osgi/pom.xml @@ -19,7 +19,7 @@ org.eclipse.osgi org.eclipse.osgi - 3.18.700-SNAPSHOT + 3.19.0-SNAPSHOT eclipse-plugin