Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2011-08-23 15:43:47 +0000
committerThomas Watson2011-08-23 15:43:47 +0000
commit70fdbc6b9936f587bdcc1481eb0e67468e29a0c6 (patch)
treeba8ad99c3fb91e453533225dd1d6521998632fbf /bundles/org.eclipse.osgi/resolver
parentc31d218de84897d1bc8b90d3c853716af3f965c2 (diff)
downloadrt.equinox.framework-70fdbc6b9936f587bdcc1481eb0e67468e29a0c6.tar.gz
rt.equinox.framework-70fdbc6b9936f587bdcc1481eb0e67468e29a0c6.tar.xz
rt.equinox.framework-70fdbc6b9936f587bdcc1481eb0e67468e29a0c6.zip
Bug 355421 - system bundle is missing the osgi.identity capabilityv20110829-1633
Diffstat (limited to 'bundles/org.eclipse.osgi/resolver')
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java7
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java6
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java12
3 files changed, 17 insertions, 8 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java
index 0f4d7b661..ebd92db6e 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java
@@ -1229,6 +1229,13 @@ public class ResolverImpl implements Resolver {
failed = true;
break;
}
+ } else {
+ if ("osgi.ee".equals(genericRequires[i].getNameSpace())) { //$NON-NLS-1$
+ VersionSupplier supplier = genericRequires[i].getSelectedSupplier();
+ Integer ee = supplier == null ? null : (Integer) ((GenericDescription) supplier.getBaseDescription()).getAttributes().get(ExportPackageDescriptionImpl.EQUINOX_EE);
+ if (ee != null && ((BundleDescriptionImpl) bundle.getBaseDescription()).getEquinoxEE() < 0)
+ ((BundleDescriptionImpl) bundle.getBundleDescription()).setEquinoxEE(ee);
+ }
}
}
}
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
index 577c97e85..bca93d05a 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
@@ -569,10 +569,10 @@ public class StateBuilder {
if (osgiIdentity != null)
// always add the capability to the front
result.add(0, osgiIdentity);
- return createOSGiCapabilities(osgiCapabilities, result);
+ return createOSGiCapabilities(osgiCapabilities, result, (Integer) null);
}
- static List<GenericDescription> createOSGiCapabilities(ManifestElement[] osgiCapabilities, List<GenericDescription> result) throws BundleException {
+ static List<GenericDescription> createOSGiCapabilities(ManifestElement[] osgiCapabilities, List<GenericDescription> result, Integer profileIndex) throws BundleException {
if (osgiCapabilities == null)
return result;
if (result == null)
@@ -591,6 +591,8 @@ public class StateBuilder {
GenericDescriptionImpl desc = new GenericDescriptionImpl();
desc.setType(namespace);
Map<String, Object> mapAttrs = getAttributes(element, new String[0]);
+ if (profileIndex != null)
+ mapAttrs.put(ExportPackageDescriptionImpl.EQUINOX_EE, profileIndex);
Dictionary<String, Object> attrs = mapAttrs == null ? new Hashtable<String, Object>() : new Hashtable<String, Object>(mapAttrs);
desc.setAttributes(attrs);
Map<String, String> directives = new HashMap<String, String>();
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
index aa8d9cbf5..68f61b241 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
@@ -846,12 +846,12 @@ public abstract class StateImpl implements State {
private void resetSystemCapabilities() {
BundleDescription[] systemBundles = getBundles(Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
- Long builtIn = new Long(1);
for (BundleDescription systemBundle : systemBundles) {
GenericDescription[] capabilities = systemBundle.getGenericCapabilities();
List<GenericDescription> newCapabilities = new ArrayList<GenericDescription>(capabilities.length);
for (GenericDescription capability : capabilities) {
- if (builtIn.equals(capability.getDeclaredAttributes().get("equinox.builtin"))) //$NON-NLS-1$
+ Object equinoxEEIndex = capability.getDeclaredAttributes().get(ExportPackageDescriptionImpl.EQUINOX_EE);
+ if (equinoxEEIndex == null)
newCapabilities.add(capability); // keep the built in ones.
}
// now add the externally defined ones
@@ -863,16 +863,16 @@ public abstract class StateImpl implements State {
private void addSystemCapabilities(List<GenericDescription> capabilities) {
for (int i = 0; i < platformProperties.length; i++)
try {
- addSystemCapabilities(capabilities, ManifestElement.parseHeader(Constants.PROVIDE_CAPABILITY, (String) platformProperties[i].get(Constants.FRAMEWORK_SYSTEMCAPABILITIES)));
- addSystemCapabilities(capabilities, ManifestElement.parseHeader(Constants.PROVIDE_CAPABILITY, (String) platformProperties[i].get(Constants.FRAMEWORK_SYSTEMCAPABILITIES_EXTRA)));
+ addSystemCapabilities(capabilities, ManifestElement.parseHeader(Constants.PROVIDE_CAPABILITY, (String) platformProperties[i].get(Constants.FRAMEWORK_SYSTEMCAPABILITIES)), i);
+ addSystemCapabilities(capabilities, ManifestElement.parseHeader(Constants.PROVIDE_CAPABILITY, (String) platformProperties[i].get(Constants.FRAMEWORK_SYSTEMCAPABILITIES_EXTRA)), i);
} catch (BundleException e) {
// TODO consider throwing this...
}
}
- private void addSystemCapabilities(List<GenericDescription> capabilities, ManifestElement[] elements) {
+ private void addSystemCapabilities(List<GenericDescription> capabilities, ManifestElement[] elements, Integer profileIndex) {
try {
- StateBuilder.createOSGiCapabilities(elements, capabilities);
+ StateBuilder.createOSGiCapabilities(elements, capabilities, profileIndex);
} catch (BundleException e) {
throw new RuntimeException("Unexpected exception adding system capabilities.", e); //$NON-NLS-1$
}

Back to the top