Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordj2011-09-01 13:33:54 +0000
committerdj2011-09-01 13:33:54 +0000
commit32903bb64374f0635d64ef909b67c47e5fa3892e (patch)
treeaa7b24dfac3891efdbfe29fceefa93f857c4667d
parenta4651532eecc5072259063cdf1937c53a7038c36 (diff)
downloadrt.equinox.p2-bug354888.tar.gz
rt.equinox.p2-bug354888.tar.xz
rt.equinox.p2-bug354888.zip
Bug 354888 - Cache extensions from parent lost in shared installbug354888
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java
index 51b57626b..6554a21b7 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java
@@ -14,6 +14,7 @@ import java.io.File;
import java.net.*;
import java.util.List;
import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.frameworkadmin.BundleInfo;
import org.eclipse.equinox.internal.p2.update.*;
import org.eclipse.equinox.internal.provisional.frameworkadmin.LauncherData;
import org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator;
@@ -40,6 +41,11 @@ public class PlatformConfigurationWrapper {
* Use the given manipulator to calculate the OSGi install location. We can't
* just use the Location service here because we may not be installing into
* ourselves. (see https://bugs.eclipse.org/354552)
+ *
+ * First try and calculate the location based relative to the data provided
+ * in the manipulator's launcher data. If that doesn't work then calculate
+ * it based on the location of known JARs. If that still doesn't work then
+ * return null.
*/
private static URL getOSGiInstallArea(Manipulator manipulator) {
@@ -88,7 +94,27 @@ public class PlatformConfigurationWrapper {
}
}
- // we don't have enough information to calculate the OSGi install area so return null
+ // we couldn't calculate it based on the info in the launcher data, so
+ // try to do it based on the location of known JARs.
+ final String OSGI = "org.eclipse.osgi"; //$NON-NLS-1$
+ BundleInfo[] bis = manipulator.getConfigData().getBundles();
+ String searchFor = "org.eclipse.equinox.launcher"; //$NON-NLS-1$
+ for (int i = 0; i < bis.length; i++) {
+ if (bis[i].getSymbolicName().equals(searchFor)) {
+ if (bis[i].getLocation() != null) {
+ try {
+ if (bis[i].getLocation().getScheme().equals("file")) //$NON-NLS-1$
+ return fromOSGiJarToOSGiInstallArea(bis[i].getLocation().getPath()).toURI().toURL();
+ } catch (MalformedURLException e) {
+ //do nothing
+ }
+ }
+ if (searchFor.equals(OSGI))
+ return null;
+ searchFor = OSGI;
+ i = -1;
+ }
+ }
return null;
}

Back to the top