Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2014-07-16 13:47:20 +0000
committerThomas Watson2014-07-16 13:47:20 +0000
commitaa22df38a86fbe220038d26eef575c61473954f8 (patch)
tree1f4d50b42980d6491103728393de42d49effc7fa /bundles
parentc205fb96168bd942f8ebb0a2dff1bcb1bbed1a9c (diff)
downloadrt.equinox.framework-aa22df38a86fbe220038d26eef575c61473954f8.tar.gz
rt.equinox.framework-aa22df38a86fbe220038d26eef575c61473954f8.tar.xz
rt.equinox.framework-aa22df38a86fbe220038d26eef575c61473954f8.zip
after uninstall
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java10
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java17
2 files changed, 20 insertions, 7 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java
index 0fe0ed544..e71ac9a9b 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2013 IBM Corporation and others.
+ * Copyright (c) 2006, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2023,4 +2023,12 @@ public class ClassLoadingBundleTests extends AbstractBundleTests {
}
return sb.toString();
}
+
+ public void testDefaultLocalUninstall() throws Exception {
+ Bundle test = installer.installBundle("security.a"); //$NON-NLS-1$
+ test.uninstall();
+ Dictionary<String, String> headers = test.getHeaders();
+ String bundleName = headers.get(Constants.BUNDLE_NAME);
+ assertEquals("Wrong bundle name header.", "default", bundleName);
+ }
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java
index ce17b8189..eacfcbc6d 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java
@@ -10,12 +10,6 @@
*******************************************************************************/
package org.eclipse.osgi.internal.framework;
-import org.osgi.framework.dto.*;
-
-import org.osgi.framework.startlevel.dto.BundleStartLevelDTO;
-import org.osgi.framework.startlevel.dto.FrameworkStartLevelDTO;
-import org.osgi.framework.wiring.dto.BundleRevisionDTO;
-import org.osgi.framework.wiring.dto.BundleWiringDTO;
import java.io.*;
import java.net.URL;
import java.security.*;
@@ -45,11 +39,16 @@ import org.eclipse.osgi.signedcontent.*;
import org.eclipse.osgi.storage.BundleInfo.Generation;
import org.eclipse.osgi.storage.Storage;
import org.osgi.framework.*;
+import org.osgi.framework.dto.*;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.namespace.HostNamespace;
import org.osgi.framework.startlevel.BundleStartLevel;
import org.osgi.framework.startlevel.FrameworkStartLevel;
+import org.osgi.framework.startlevel.dto.BundleStartLevelDTO;
+import org.osgi.framework.startlevel.dto.FrameworkStartLevelDTO;
import org.osgi.framework.wiring.*;
+import org.osgi.framework.wiring.dto.BundleRevisionDTO;
+import org.osgi.framework.wiring.dto.BundleWiringDTO;
public class EquinoxBundle implements Bundle, BundleReference {
@@ -450,6 +449,8 @@ public class EquinoxBundle implements Bundle, BundleReference {
@Override
public void uninstall() throws BundleException {
+ // be sure to prime the headers with default local; calling priv method to avoid permission check
+ privGetHeaders(null);
Storage storage = equinoxContainer.getStorage();
storage.getModuleContainer().uninstall(module);
}
@@ -462,6 +463,10 @@ public class EquinoxBundle implements Bundle, BundleReference {
@Override
public Dictionary<String, String> getHeaders(String locale) {
equinoxContainer.checkAdminPermission(this, AdminPermission.METADATA);
+ return privGetHeaders(locale);
+ }
+
+ private Dictionary<String, String> privGetHeaders(String locale) {
Generation current = (Generation) module.getCurrentRevision().getRevisionInfo();
return current.getHeaders(locale);
}

Back to the top