Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-04-25 20:21:58 +0000
committerThomas Watson2008-04-25 20:21:58 +0000
commita79affa81ffe86ef8e2df7152a98b6e00a8ff64b (patch)
treef409d5c873641e5dd75005618e5fe030e076f7c6 /bundles
parent4b5c70aca3171731594b6b12eff8b462f7fcfe9c (diff)
downloadrt.equinox.framework-a79affa81ffe86ef8e2df7152a98b6e00a8ff64b.tar.gz
rt.equinox.framework-a79affa81ffe86ef8e2df7152a98b6e00a8ff64b.tar.xz
rt.equinox.framework-a79affa81ffe86ef8e2df7152a98b6e00a8ff64b.zip
Bug 224833 Incomplete Export-Package header of system bundlev20080427-0830
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundle.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundle.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundle.java
index 9f0791c1a..4dc3e3fa0 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundle.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/SystemBundle.java
@@ -16,6 +16,8 @@ import java.io.InputStream;
import java.net.URL;
import java.security.Permission;
import java.security.ProtectionDomain;
+import java.util.Dictionary;
+import java.util.Enumeration;
import org.eclipse.osgi.framework.debug.Debug;
import org.osgi.framework.*;
@@ -26,6 +28,53 @@ import org.osgi.framework.*;
*/
public class SystemBundle extends BundleHost {
+ class SystemBundleHeaders extends Dictionary {
+ private final Dictionary headers;
+
+ public SystemBundleHeaders(Dictionary headers) {
+ this.headers = headers;
+ }
+
+ public Enumeration elements() {
+ return headers.elements();
+ }
+
+ public Object get(Object key) {
+ if (!org.osgi.framework.Constants.EXPORT_PACKAGE.equals(key))
+ return headers.get(key);
+ String systemPackages = FrameworkProperties.getProperty(org.osgi.framework.Constants.FRAMEWORK_SYSTEMPACKAGES);
+ String resorts = (String) headers.get(org.osgi.framework.Constants.EXPORT_PACKAGE);
+ if (systemPackages != null) {
+ if (resorts != null)
+ resorts += ", " + systemPackages; //$NON-NLS-1$
+ else
+ resorts = systemPackages;
+ }
+ return resorts;
+ }
+
+ public boolean isEmpty() {
+ return headers.isEmpty();
+ }
+
+ public Enumeration keys() {
+ return headers.keys();
+ }
+
+ public Object put(Object key, Object value) {
+ return headers.put(key, value);
+ }
+
+ public Object remove(Object key) {
+ return headers.remove(key);
+ }
+
+ public int size() {
+ return headers.size();
+ }
+
+ }
+
ProtectionDomain systemDomain;
/**
@@ -289,4 +338,9 @@ public class SystemBundle extends BundleHost {
protected void unresolvePermissions(AbstractBundle[] refreshedBundles) {
// Do nothing
}
+
+ public Dictionary getHeaders(String localeString) {
+ return new SystemBundleHeaders(super.getHeaders(localeString));
+ }
+
}

Back to the top