Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2008-02-13 19:23:23 +0000
committerAndrew Niefer2008-02-13 19:23:23 +0000
commitdb59f71b9aefdfc294228f96b3fc7b398d82af14 (patch)
tree11a212d7efc93199cc016fc7e5534b0d87ee2efb /bundles/org.eclipse.equinox.frameworkadmin.equinox/src
parentf9fbd07e3e01e248ff944835a0799f10659b2525 (diff)
downloadrt.equinox.p2-db59f71b9aefdfc294228f96b3fc7b398d82af14.tar.gz
rt.equinox.p2-db59f71b9aefdfc294228f96b3fc7b398d82af14.tar.xz
rt.equinox.p2-db59f71b9aefdfc294228f96b3fc7b398d82af14.zip
bug 218639 - product launcher requirements/capabilities
Diffstat (limited to 'bundles/org.eclipse.equinox.frameworkadmin.equinox/src')
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxBundlesState.java40
1 files changed, 21 insertions, 19 deletions
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxBundlesState.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxBundlesState.java
index 929fd829a..b5583fd5a 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxBundlesState.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxBundlesState.java
@@ -592,31 +592,33 @@ public class EquinoxBundlesState implements BundlesState {
BundleDescription[] currentInstalledBundles = state.getBundles();
String newLocation = FileUtils.getRealLocation(manipulator, bInfo.getLocation(), true);
Dictionary manifest = Utils.getOSGiManifest(newLocation);
- if (manifest != null) {
- String newSymbolicName = (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME);
- int position = newSymbolicName.indexOf(";");
- if (position >= 0)
- newSymbolicName = newSymbolicName.substring(0, position).trim();
- String newVersion = (String) manifest.get(Constants.BUNDLE_VERSION);
- for (int i = 0; i < currentInstalledBundles.length; i++) {
- String location = FileUtils.getRealLocation(manipulator, currentInstalledBundles[i].getLocation(), true);
- if (newLocation.equals(location)) {
- found = true;
- break;
- }
- String symbolicName = currentInstalledBundles[i].getSymbolicName();
- String version = currentInstalledBundles[i].getVersion().toString();
- if (newSymbolicName.equals(symbolicName) && newVersion.equals(version)) {
- found = true;
- break;
- }
+ if (manifest == null)
+ return;
+
+ String newSymbolicName = (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME);
+ int position = newSymbolicName.indexOf(";"); //$NON-NLS-1$
+ if (position >= 0)
+ newSymbolicName = newSymbolicName.substring(0, position).trim();
+ String newVersion = (String) manifest.get(Constants.BUNDLE_VERSION);
+ for (int i = 0; i < currentInstalledBundles.length; i++) {
+ String location = FileUtils.getRealLocation(manipulator, currentInstalledBundles[i].getLocation(), true);
+ if (newLocation.equals(location)) {
+ found = true;
+ break;
+ }
+ String symbolicName = currentInstalledBundles[i].getSymbolicName();
+ String version = currentInstalledBundles[i].getVersion().toString();
+ if (newSymbolicName.equals(symbolicName) && newVersion.equals(version)) {
+ found = true;
+ break;
}
}
+
if (!found) {
BundleDescription newBundleDescription = null;
try {
bInfo.setBundleId(++maxId);
- newBundleDescription = soFactory.createBundleDescription(state, Utils.getOSGiManifest(newLocation), newLocation, bInfo.getBundleId());
+ newBundleDescription = soFactory.createBundleDescription(state, manifest, newLocation, bInfo.getBundleId());
state.addBundle(newBundleDescription);
manipulator.getConfigData().addBundle(bInfo);
} catch (BundleException e) {

Back to the top