Bug 529456 - [osgi R7] Support for importing java.* packages

Change-Id: Ie5b096731534c2416219504d55347690681808f2
Signed-off-by: Anjum Fatima <anjum.eclipse@gmail.com>
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
index 0ae88cc..23fa39b 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2016 IBM Corporation and others.
+ * Copyright (c) 2003, 2018 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
@@ -12,16 +12,36 @@
 package org.eclipse.osgi.internal.resolver;
 
 import java.lang.reflect.Constructor;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import org.eclipse.osgi.internal.framework.EquinoxContainer;
 import org.eclipse.osgi.internal.framework.FilterImpl;
 import org.eclipse.osgi.internal.messages.Msg;
 import org.eclipse.osgi.internal.util.Tokenizer;
-import org.eclipse.osgi.service.resolver.*;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.BundleSpecification;
+import org.eclipse.osgi.service.resolver.ExportPackageDescription;
+import org.eclipse.osgi.service.resolver.GenericDescription;
+import org.eclipse.osgi.service.resolver.GenericSpecification;
+import org.eclipse.osgi.service.resolver.HostSpecification;
+import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
+import org.eclipse.osgi.service.resolver.NativeCodeSpecification;
+import org.eclipse.osgi.service.resolver.State;
 import org.eclipse.osgi.service.resolver.VersionRange;
 import org.eclipse.osgi.util.ManifestElement;
 import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.*;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.Version;
 import org.osgi.framework.namespace.BundleNamespace;
 import org.osgi.framework.namespace.IdentityNamespace;
 import org.osgi.resource.Namespace;
@@ -821,7 +841,7 @@
 					throw new BundleException(message + " : " + NLS.bind(StateMsg.HEADER_PACKAGE_DUPLICATES, packageNames[j]), BundleException.MANIFEST_ERROR); //$NON-NLS-1$
 				}
 				// check for java.*
-				if (!jreBundle && packageNames[j].startsWith("java.")) { //$NON-NLS-1$
+				if (export && !jreBundle && packageNames[j].startsWith("java.")) { //$NON-NLS-1$
 					String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString());
 					throw new BundleException(message + " : " + NLS.bind(StateMsg.HEADER_PACKAGE_JAVA, packageNames[j]), BundleException.MANIFEST_ERROR); //$NON-NLS-1$
 				}
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateMessages.properties b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateMessages.properties
index acf9ffa..df05935 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateMessages.properties
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateMessages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2011 IBM Corporation and others.
+# Copyright (c) 2004, 2018 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
@@ -16,7 +16,7 @@
 
 HEADER_REQUIRED=The \"{0}\" header must be specified
 HEADER_PACKAGE_DUPLICATES=Cannot import a package more than once \"{0}\"
-HEADER_PACKAGE_JAVA=Cannot specify java.* packages in Import/Export headers \"{0}\"
+HEADER_PACKAGE_JAVA=Cannot specify java.* packages in Export headers \"{0}\"
 HEADER_VERSION_ERROR=The attributes \"{0}\" and \"{1}\" must match
 HEADER_EXPORT_ATTR_ERROR=Specifying \"{0}\" in the \"{1}\" header is not permitted
 HEADER_DIRECTIVE_DUPLICATES=Duplicate directives are not permitted \"{0}\"
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleTests.java
index d1f5ada..d65a2d2 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/BundleTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2017 IBM Corporation and others.
+ * Copyright (c) 2006, 2018 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
@@ -16,6 +16,7 @@
 public class BundleTests {
 	public static Test suite() {
 		TestSuite suite = new TestSuite(BundleTests.class.getName());
+		suite.addTest(ImportJavaSEPackagesTests.suite());
 		suite.addTest(MultiReleaseJarTests.suite());
 		suite.addTest(URLHandlerTests.suite());
 		suite.addTest(PersistedBundleTests.suite());
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ImportJavaSEPackagesTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ImportJavaSEPackagesTests.java
new file mode 100644
index 0000000..428a584
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ImportJavaSEPackagesTests.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osgi.tests.bundles;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.eclipse.osgi.launch.Equinox;
+import org.eclipse.osgi.tests.OSGiTestsActivator;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.namespace.PackageNamespace;
+import org.osgi.framework.wiring.BundleCapability;
+import org.osgi.framework.wiring.BundleWire;
+import org.osgi.framework.wiring.BundleWiring;
+
+public class ImportJavaSEPackagesTests extends AbstractBundleTests {
+
+	private static final String JAVA_LANG = "java.lang";
+	private static final String JAVA_UTIL = "java.util";
+	private static String originalSpecVersion;
+
+	public static Test suite() {
+		return new TestSuite(ImportJavaSEPackagesTests.class);
+	}
+
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		originalSpecVersion = System.getProperty("java.specification.version");
+	}
+
+	@Override
+	protected void tearDown() throws Exception {
+		super.tearDown();
+		System.setProperty("java.specification.version", originalSpecVersion);
+	}
+
+	public void testExportPackageCannotContainJavaPackages() throws Exception {
+		File config = OSGiTestsActivator.getContext().getDataFile(getName());
+		Map<String, String> headers = new HashMap<String, String>();
+		headers.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+		headers.put(Constants.BUNDLE_SYMBOLICNAME, getName());
+		headers.put(Constants.EXPORT_PACKAGE, JAVA_LANG);
+		config.mkdirs();
+		File bundle = SystemBundleTests.createBundle(config, getName(), headers);
+		Equinox equinox = new Equinox(Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath()));
+		try {
+			equinox.start();
+			BundleContext systemContext = equinox.getBundleContext();
+			Bundle testBundle = systemContext.installBundle(bundle.toURI().toString());
+			testBundle.start();
+			fail("Failed to test Export-Package header");
+		} catch (BundleException e) {
+			assertEquals("It should throw a bundle exception of type manifest error", BundleException.MANIFEST_ERROR, e.getType());
+			assertTrue("It should throw a Bundle Exception stating Invalid manifest header Export-Package", e.getMessage().contains("Cannot specify java.* packages in Export headers"));
+		} finally {
+
+			try {
+				equinox.stop();
+				equinox.waitForStop(10000);
+			} catch (Exception e) {
+				//do nothing
+			}
+		}
+
+	}
+
+	public void testImportPackageCanContainJavaPackages() throws Exception {
+		File config = OSGiTestsActivator.getContext().getDataFile(getName());
+		Map<String, String> headers = new HashMap<String, String>();
+		headers.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+		headers.put(Constants.BUNDLE_SYMBOLICNAME, getName());
+		headers.put(Constants.IMPORT_PACKAGE, JAVA_LANG);
+		config.mkdirs();
+		File bundle = SystemBundleTests.createBundle(config, getName(), headers);
+		Equinox equinox = new Equinox(Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath()));
+		try {
+			equinox.start();
+			BundleContext systemContext = equinox.getBundleContext();
+			Bundle testBundle = systemContext.installBundle(bundle.toURI().toString());
+			testBundle.start();
+			Dictionary<String, String> testHeaders = testBundle.getHeaders();
+			assertTrue(Constants.IMPORT_PACKAGE + " does not contain the java.* package", testHeaders.get(Constants.IMPORT_PACKAGE).contains(JAVA_LANG));
+			List<BundleWire> pkgWires = testBundle.adapt(BundleWiring.class).getRequiredWires(PackageNamespace.PACKAGE_NAMESPACE);
+			assertEquals("Wrong number of package requiremens: ", 1, pkgWires.size());
+			assertEquals("Wrong package found: " + pkgWires.get(0), JAVA_LANG, pkgWires.get(0).getCapability().getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE));
+		} catch (BundleException e) {
+			fail("Failed to test Import-Package header");
+		} finally {
+
+			try {
+				equinox.stop();
+				equinox.waitForStop(10000);
+			} catch (Exception e) {
+				//do nothing
+			}
+		}
+	}
+
+	public void testSystemPackages() throws Exception {
+		Map<Integer, Integer> packagesPerVersion = new HashMap<Integer, Integer>();
+		packagesPerVersion.put(7, 56);
+		packagesPerVersion.put(8, 63);
+		packagesPerVersion.put(9, 66);
+
+		for (Entry<Integer, Integer> entry : packagesPerVersion.entrySet()) {
+			doSystemPackages(entry.getKey(), entry.getValue());
+		}
+
+	}
+
+	public void doSystemPackages(int rv, int expectedPackages) throws Exception {
+		if (rv < 9) {
+			System.setProperty("java.specification.version", "1." + rv);
+		} else {
+			System.setProperty("java.specification.version", Integer.toString(rv));
+		}
+
+		File config = OSGiTestsActivator.getContext().getDataFile(getName());
+		Map<String, String> headers = new HashMap<String, String>();
+		headers.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+		headers.put(Constants.BUNDLE_SYMBOLICNAME, getName());
+		config.mkdirs();
+		File bundle = SystemBundleTests.createBundle(config, getName(), headers);
+
+		Equinox equinox = new Equinox(Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath()));
+		try {
+			equinox.start();
+			BundleContext systemContext = equinox.getBundleContext();
+			Dictionary<String, String> testHeaders = equinox.getHeaders();
+			assertTrue(Constants.EXPORT_PACKAGE + " does not contain the java.* package", testHeaders.get(Constants.EXPORT_PACKAGE).contains(JAVA_LANG));
+			assertTrue(Constants.EXPORT_PACKAGE + " does not contain the java.* package", testHeaders.get(Constants.EXPORT_PACKAGE).contains(JAVA_UTIL));
+			List<BundleCapability> capabilities = equinox.adapt(BundleWiring.class).getCapabilities(PackageNamespace.PACKAGE_NAMESPACE);
+
+			int count = 0;
+			for (BundleCapability cap : capabilities) {
+				if (cap.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE).toString().startsWith("java.")) {
+					count++;
+				}
+			}
+			assertEquals("Wrong number of java.* packages for version " + rv, expectedPackages, count);
+
+			Bundle testBundle = systemContext.installBundle(bundle.toURI().toString());
+			testBundle.start();
+			String systemPackages = testBundle.getBundleContext().getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES);
+			assertTrue("System packages should include java.* packages", systemPackages.contains(JAVA_LANG));
+			assertTrue("System packages should include java.* packages", systemPackages.contains(JAVA_UTIL));
+		} catch (BundleException e) {
+			fail("Failed to test System packages");
+		} finally {
+
+			try {
+				equinox.stop();
+				equinox.waitForStop(10000);
+			} catch (Exception e) {
+				//do nothing
+			}
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
index c244b40..1f3859a 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2017 IBM Corporation and others.
+ * Copyright (c) 2003, 2018 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
@@ -13,16 +13,41 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 import org.eclipse.osgi.framework.util.CaseInsensitiveDictionaryMap;
-import org.eclipse.osgi.service.resolver.*;
+import org.eclipse.osgi.service.resolver.BaseDescription;
+import org.eclipse.osgi.service.resolver.BundleDelta;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.ExportPackageDescription;
+import org.eclipse.osgi.service.resolver.Resolver;
+import org.eclipse.osgi.service.resolver.State;
+import org.eclipse.osgi.service.resolver.StateDelta;
+import org.eclipse.osgi.service.resolver.StateHelper;
+import org.eclipse.osgi.service.resolver.StateObjectFactory;
 import org.eclipse.osgi.tests.OSGiTestsActivator;
 import org.eclipse.osgi.util.ManifestElement;
-import org.osgi.framework.*;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.Version;
 import org.osgi.framework.namespace.IdentityNamespace;
-import org.osgi.framework.wiring.*;
+import org.osgi.framework.wiring.BundleCapability;
+import org.osgi.framework.wiring.BundleRequirement;
+import org.osgi.framework.wiring.BundleRevision;
+import org.osgi.framework.wiring.BundleWire;
+import org.osgi.framework.wiring.BundleWiring;
 import org.osgi.resource.Capability;
 
 public class StateResolverTest extends AbstractStateTest {
@@ -3695,6 +3720,57 @@
 		assertTrue("fragment not resolved", aFrag.isResolved());
 	}
 
+	public void testImportJavaPackages() throws Exception {
+		State state = buildEmptyState();
+		int bundleID = 0;
+		Hashtable manifest = new Hashtable();
+		Dictionary[] props = new Dictionary[] {new Hashtable()};
+		props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.5, JavaSE-1.6");
+		props[0].put(Constants.FRAMEWORK_SYSTEMPACKAGES, "java.lang,java.util");
+		state.setPlatformProperties(props);
+
+		manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+		manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.osgi");
+		BundleDescription systemBundle = state.getFactory().createBundleDescription(state, manifest, "org.eclipse.osgi", bundleID++);
+		state.addBundle(systemBundle);
+
+		List bundles = new ArrayList();
+		manifest.clear();
+		manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+		manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
+		manifest.put(Constants.IMPORT_PACKAGE, "java.lang");
+		manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "JavaSE-1.6");
+		BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
+		bundles.add(a);
+		state.addBundle(a);
+
+		manifest.clear();
+		manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+		manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A.FRAG");
+		manifest.put(Constants.FRAGMENT_HOST, "A");
+		manifest.put(Constants.IMPORT_PACKAGE, "java.lang,java.util");
+		manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.5");
+		BundleDescription aFrag = state.getFactory().createBundleDescription(state, manifest, "A.FRAG", bundleID++);
+		bundles.add(aFrag);
+		state.addBundle(aFrag);
+
+		manifest.clear();
+		manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+		manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
+		manifest.put(Constants.IMPORT_PACKAGE, "java.xyz");
+		manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "JavaSE-1.6");
+		BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++);
+		bundles.add(b);
+		state.addBundle(b);
+
+		state.resolve();
+
+		assertTrue("host A not resolved", a.isResolved());
+		assertTrue("fragment A.FRAG not resolved", aFrag.isResolved());
+		assertFalse("host B is wrongly resolved", b.isResolved());
+
+	}
+
 	private ExportPackageDescription[] isConsistent(ExportPackageDescription[] pkgs1, ExportPackageDescription[] pkgs2) {
 		for (int i = 0; i < pkgs1.length; i++)
 			for (int j = 0; j < pkgs2.length; j++)
diff --git a/bundles/org.eclipse.osgi/CDC-1.0_Foundation-1.0.profile b/bundles/org.eclipse.osgi/CDC-1.0_Foundation-1.0.profile
index 3cbbc60..2083855 100644
--- a/bundles/org.eclipse.osgi/CDC-1.0_Foundation-1.0.profile
+++ b/bundles/org.eclipse.osgi/CDC-1.0_Foundation-1.0.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2005 IBM Corporation and others.
+# Copyright (c) 2005, 2018 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
@@ -9,6 +9,22 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.io,\
+ java.lang,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.text,\
+ java.text.resources,\
+ java.util,\
+ java.util.jar,\
+ java.util.zip,\
  javax.microedition.io
 org.osgi.framework.bootdelegation = \
  javax.microedition.io
diff --git a/bundles/org.eclipse.osgi/CDC-1.1_Foundation-1.1.profile b/bundles/org.eclipse.osgi/CDC-1.1_Foundation-1.1.profile
index efa83eb..2dcf332 100644
--- a/bundles/org.eclipse.osgi/CDC-1.1_Foundation-1.1.profile
+++ b/bundles/org.eclipse.osgi/CDC-1.1_Foundation-1.1.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2005, 2008 IBM Corporation and others.
+# Copyright (c) 2005, 2018 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
@@ -9,6 +9,21 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.io,\
+ java.lang,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.text,\
+ java.util,\
+ java.util.jar,\
+ java.util.zip,\
  javax.microedition.io,\
  javax.microedition.pki,\
  javax.security.auth.x500
diff --git a/bundles/org.eclipse.osgi/J2SE-1.3.profile b/bundles/org.eclipse.osgi/J2SE-1.3.profile
index 438da50..918df53 100644
--- a/bundles/org.eclipse.osgi/J2SE-1.3.profile
+++ b/bundles/org.eclipse.osgi/J2SE-1.3.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2003, 2012 IBM Corporation and others.
+# Copyright (c) 2003, 2018 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
@@ -9,6 +9,42 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.applet,\
+ java.awt,\
+ java.awt.color,\
+ java.awt.datatransfer,\
+ java.awt.dnd,\
+ java.awt.event,\
+ java.awt.font,\
+ java.awt.geom,\
+ java.awt.im,\
+ java.awt.im.spi,\
+ java.awt.image,\
+ java.awt.image.renderable,\
+ java.awt.print,\
+ java.beans,\
+ java.beans.beancontext,\
+ java.io,\
+ java.lang,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.rmi,\
+ java.rmi.activation,\
+ java.rmi.dgc,\
+ java.rmi.registry,\
+ java.rmi.server,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.sql,\
+ java.text,\
+ java.util,\
+ java.util.jar,\
+ java.util.zip,\
  javax.accessibility,\
  javax.naming,\
  javax.naming.directory,\
diff --git a/bundles/org.eclipse.osgi/J2SE-1.4.profile b/bundles/org.eclipse.osgi/J2SE-1.4.profile
index 18c6e92..8f8a824 100644
--- a/bundles/org.eclipse.osgi/J2SE-1.4.profile
+++ b/bundles/org.eclipse.osgi/J2SE-1.4.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2003, 2012 IBM Corporation and others.
+# Copyright (c) 2003, 2018 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
@@ -9,6 +9,50 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.applet,\
+ java.awt,\
+ java.awt.color,\
+ java.awt.datatransfer,\
+ java.awt.dnd,\
+ java.awt.event,\
+ java.awt.font,\
+ java.awt.geom,\
+ java.awt.im,\
+ java.awt.im.spi,\
+ java.awt.image,\
+ java.awt.image.renderable,\
+ java.awt.print,\
+ java.beans,\
+ java.beans.beancontext,\
+ java.io,\
+ java.lang,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.nio,\
+ java.nio.channels,\
+ java.nio.channels.spi,\
+ java.nio.charset,\
+ java.nio.charset.spi,\
+ java.rmi,\
+ java.rmi.activation,\
+ java.rmi.dgc,\
+ java.rmi.registry,\
+ java.rmi.server,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.sql,\
+ java.text,\
+ java.util,\
+ java.util.jar,\
+ java.util.logging,\
+ java.util.prefs,\
+ java.util.regex,\
+ java.util.zip,\
  javax.accessibility,\
  javax.crypto,\
  javax.crypto.interfaces,\
diff --git a/bundles/org.eclipse.osgi/J2SE-1.5.profile b/bundles/org.eclipse.osgi/J2SE-1.5.profile
index a79545d..1d081a9 100644
--- a/bundles/org.eclipse.osgi/J2SE-1.5.profile
+++ b/bundles/org.eclipse.osgi/J2SE-1.5.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2003, 2012 IBM Corporation and others.
+# Copyright (c) 2003, 2018 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
@@ -9,6 +9,56 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.applet,\
+ java.awt,\
+ java.awt.color,\
+ java.awt.datatransfer,\
+ java.awt.dnd,\
+ java.awt.event,\
+ java.awt.font,\
+ java.awt.geom,\
+ java.awt.im,\
+ java.awt.im.spi,\
+ java.awt.image,\
+ java.awt.image.renderable,\
+ java.awt.print,\
+ java.beans,\
+ java.beans.beancontext,\
+ java.io,\
+ java.lang,\
+ java.lang.annotation,\
+ java.lang.instrument,\
+ java.lang.management,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.nio,\
+ java.nio.channels,\
+ java.nio.channels.spi,\
+ java.nio.charset,\
+ java.nio.charset.spi,\
+ java.rmi,\
+ java.rmi.activation,\
+ java.rmi.dgc,\
+ java.rmi.registry,\
+ java.rmi.server,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.sql,\
+ java.text,\
+ java.util,\
+ java.util.concurrent,\
+ java.util.concurrent.atomic,\
+ java.util.concurrent.locks,\
+ java.util.jar,\
+ java.util.logging,\
+ java.util.prefs,\
+ java.util.regex,\
+ java.util.zip,\
  javax.accessibility,\
  javax.activity,\
  javax.crypto,\
diff --git a/bundles/org.eclipse.osgi/JavaSE-1.6.profile b/bundles/org.eclipse.osgi/JavaSE-1.6.profile
index d6b1ca9..c0a692f 100644
--- a/bundles/org.eclipse.osgi/JavaSE-1.6.profile
+++ b/bundles/org.eclipse.osgi/JavaSE-1.6.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2003, 2012 IBM Corporation and others.
+# Copyright (c) 2003, 2018 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
@@ -9,6 +9,58 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.applet,\
+ java.awt,\
+ java.awt.color,\
+ java.awt.datatransfer,\
+ java.awt.dnd,\
+ java.awt.event,\
+ java.awt.font,\
+ java.awt.geom,\
+ java.awt.im,\
+ java.awt.im.spi,\
+ java.awt.image,\
+ java.awt.image.renderable,\
+ java.awt.print,\
+ java.beans,\
+ java.beans.beancontext,\
+ java.io,\
+ java.lang,\
+ java.lang.annotation,\
+ java.lang.instrument,\
+ java.lang.management,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.nio,\
+ java.nio.channels,\
+ java.nio.channels.spi,\
+ java.nio.charset,\
+ java.nio.charset.spi,\
+ java.rmi,\
+ java.rmi.activation,\
+ java.rmi.dgc,\
+ java.rmi.registry,\
+ java.rmi.server,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.sql,\
+ java.text,\
+ java.text.spi,\
+ java.util,\
+ java.util.concurrent,\
+ java.util.concurrent.atomic,\
+ java.util.concurrent.locks,\
+ java.util.jar,\
+ java.util.logging,\
+ java.util.prefs,\
+ java.util.regex,\
+ java.util.spi,\
+ java.util.zip,\
  javax.accessibility,\
  javax.activation,\
  javax.activity,\
diff --git a/bundles/org.eclipse.osgi/JavaSE-1.7.profile b/bundles/org.eclipse.osgi/JavaSE-1.7.profile
index 6071cf9..f958874 100644
--- a/bundles/org.eclipse.osgi/JavaSE-1.7.profile
+++ b/bundles/org.eclipse.osgi/JavaSE-1.7.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2009, 2012 IBM Corporation and others.
+# Copyright (c) 2009, 2018 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
@@ -9,6 +9,62 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.applet,\
+ java.awt,\
+ java.awt.color,\
+ java.awt.datatransfer,\
+ java.awt.dnd,\
+ java.awt.event,\
+ java.awt.font,\
+ java.awt.geom,\
+ java.awt.im,\
+ java.awt.im.spi,\
+ java.awt.image,\
+ java.awt.image.renderable,\
+ java.awt.print,\
+ java.beans,\
+ java.beans.beancontext,\
+ java.io,\
+ java.lang,\
+ java.lang.annotation,\
+ java.lang.instrument,\
+ java.lang.invoke,\
+ java.lang.management,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.nio,\
+ java.nio.channels,\
+ java.nio.channels.spi,\
+ java.nio.charset,\
+ java.nio.charset.spi,\
+ java.nio.file,\
+ java.nio.file.attribute,\
+ java.nio.file.spi,\
+ java.rmi,\
+ java.rmi.activation,\
+ java.rmi.dgc,\
+ java.rmi.registry,\
+ java.rmi.server,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.sql,\
+ java.text,\
+ java.text.spi,\
+ java.util,\
+ java.util.concurrent,\
+ java.util.concurrent.atomic,\
+ java.util.concurrent.locks,\
+ java.util.jar,\
+ java.util.logging,\
+ java.util.prefs,\
+ java.util.regex,\
+ java.util.spi,\
+ java.util.zip,\
  javax.accessibility,\
  javax.activation,\
  javax.activity,\
diff --git a/bundles/org.eclipse.osgi/JavaSE-1.8.profile b/bundles/org.eclipse.osgi/JavaSE-1.8.profile
index 3db37e8..a211173 100644
--- a/bundles/org.eclipse.osgi/JavaSE-1.8.profile
+++ b/bundles/org.eclipse.osgi/JavaSE-1.8.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2009, 2014 IBM Corporation and others.
+# Copyright (c) 2009, 2018 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
@@ -9,6 +9,69 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.applet,\
+ java.awt,\
+ java.awt.color,\
+ java.awt.datatransfer,\
+ java.awt.dnd,\
+ java.awt.event,\
+ java.awt.font,\
+ java.awt.geom,\
+ java.awt.im,\
+ java.awt.im.spi,\
+ java.awt.image,\
+ java.awt.image.renderable,\
+ java.awt.print,\
+ java.beans,\
+ java.beans.beancontext,\
+ java.io,\
+ java.lang,\
+ java.lang.annotation,\
+ java.lang.instrument,\
+ java.lang.invoke,\
+ java.lang.management,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.nio,\
+ java.nio.channels,\
+ java.nio.channels.spi,\
+ java.nio.charset,\
+ java.nio.charset.spi,\
+ java.nio.file,\
+ java.nio.file.attribute,\
+ java.nio.file.spi,\
+ java.rmi,\
+ java.rmi.activation,\
+ java.rmi.dgc,\
+ java.rmi.registry,\
+ java.rmi.server,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.sql,\
+ java.text,\
+ java.text.spi,\
+ java.time,\
+ java.time.chrono,\
+ java.time.format,\
+ java.time.temporal,\
+ java.time.zone,\
+ java.util,\
+ java.util.concurrent,\
+ java.util.concurrent.atomic,\
+ java.util.concurrent.locks,\
+ java.util.function,\
+ java.util.jar,\
+ java.util.logging,\
+ java.util.prefs,\
+ java.util.regex,\
+ java.util.spi,\
+ java.util.stream,\
+ java.util.zip,\
  javax.accessibility,\
  javax.activation,\
  javax.activity,\
diff --git a/bundles/org.eclipse.osgi/JavaSE-9.profile b/bundles/org.eclipse.osgi/JavaSE-9.profile
index e811209..16361ce 100644
--- a/bundles/org.eclipse.osgi/JavaSE-9.profile
+++ b/bundles/org.eclipse.osgi/JavaSE-9.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2009, 2015 IBM Corporation and others.
+# Copyright (c) 2009, 2018 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
@@ -12,6 +12,72 @@
 # NOTE: The JavaSE-9 profile is not yet finalized.
 
 org.osgi.framework.system.packages = \
+ java.applet,\
+ java.awt,\
+ java.awt.color,\
+ java.awt.datatransfer,\
+ java.awt.desktop,\
+ java.awt.dnd,\
+ java.awt.event,\
+ java.awt.font,\
+ java.awt.geom,\
+ java.awt.im,\
+ java.awt.im.spi,\
+ java.awt.image,\
+ java.awt.image.renderable,\
+ java.awt.print,\
+ java.beans,\
+ java.beans.beancontext,\
+ java.io,\
+ java.lang,\
+ java.lang.annotation,\
+ java.lang.instrument,\
+ java.lang.invoke,\
+ java.lang.management,\
+ java.lang.module,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.net.spi,\
+ java.nio,\
+ java.nio.channels,\
+ java.nio.channels.spi,\
+ java.nio.charset,\
+ java.nio.charset.spi,\
+ java.nio.file,\
+ java.nio.file.attribute,\
+ java.nio.file.spi,\
+ java.rmi,\
+ java.rmi.activation,\
+ java.rmi.dgc,\
+ java.rmi.registry,\
+ java.rmi.server,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.sql,\
+ java.text,\
+ java.text.spi,\
+ java.time,\
+ java.time.chrono,\
+ java.time.format,\
+ java.time.temporal,\
+ java.time.zone,\
+ java.util,\
+ java.util.concurrent,\
+ java.util.concurrent.atomic,\
+ java.util.concurrent.locks,\
+ java.util.function,\
+ java.util.jar,\
+ java.util.logging,\
+ java.util.prefs,\
+ java.util.regex,\
+ java.util.spi,\
+ java.util.stream,\
+ java.util.zip,\
  javax.accessibility,\
  javax.activation,\
  javax.activity,\
diff --git a/bundles/org.eclipse.osgi/JavaSE_compact1-1.8.profile b/bundles/org.eclipse.osgi/JavaSE_compact1-1.8.profile
index 757efcb..f135a4b 100644
--- a/bundles/org.eclipse.osgi/JavaSE_compact1-1.8.profile
+++ b/bundles/org.eclipse.osgi/JavaSE_compact1-1.8.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2014 IBM Corporation and others.
+# Copyright (c) 2014, 2018 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
@@ -9,6 +9,45 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.io,\
+ java.lang,\
+ java.lang.annotation,\
+ java.lang.invoke,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.nio,\
+ java.nio.channels,\
+ java.nio.channels.spi,\
+ java.nio.charset,\
+ java.nio.charset.spi,\
+ java.nio.file,\
+ java.nio.file.attribute,\
+ java.nio.file.spi,\
+ java.security,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.text,\
+ java.text.spi,\
+ java.time,\
+ java.time.chrono,\
+ java.time.format,\
+ java.time.temporal,\
+ java.time.zone,\
+ java.util,\
+ java.util.concurrent,\
+ java.util.concurrent.atomic,\
+ java.util.concurrent.locks,\
+ java.util.function,\
+ java.util.jar,\
+ java.util.logging,\
+ java.util.regex,\
+ java.util.spi,\
+ java.util.stream,\
+ java.util.zip,\
+ javax.crypto,\
  javax.crypto.interfaces,\
  javax.crypto.spec,\
  javax.net,\
diff --git a/bundles/org.eclipse.osgi/JavaSE_compact2-1.8.profile b/bundles/org.eclipse.osgi/JavaSE_compact2-1.8.profile
index bc6044b..fda6ab3 100644
--- a/bundles/org.eclipse.osgi/JavaSE_compact2-1.8.profile
+++ b/bundles/org.eclipse.osgi/JavaSE_compact2-1.8.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2014 IBM Corporation and others.
+# Copyright (c) 2014, 2018 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
@@ -9,6 +9,51 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.io,\
+ java.lang,\
+ java.lang.annotation,\
+ java.lang.invoke,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.nio,\
+ java.nio.channels,\
+ java.nio.channels.spi,\
+ java.nio.charset,\
+ java.nio.charset.spi,\
+ java.nio.file,\
+ java.nio.file.attribute,\
+ java.nio.file.spi,\
+ java.rmi,\
+ java.rmi.activation,\
+ java.rmi.dgc,\
+ java.rmi.registry,\
+ java.rmi.server,\
+ java.security,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.sql,\
+ java.text,\
+ java.text.spi,\
+ java.time,\
+ java.time.chrono,\
+ java.time.format,\
+ java.time.temporal,\
+ java.time.zone,\
+ java.util,\
+ java.util.concurrent,\
+ java.util.concurrent.atomic,\
+ java.util.concurrent.locks,\
+ java.util.function,\
+ java.util.jar,\
+ java.util.logging,\
+ java.util.regex,\
+ java.util.spi,\
+ java.util.stream,\
+ java.util.zip,\
+ javax.crypto,\
  javax.crypto.interfaces,\
  javax.crypto.spec,\
  javax.net,\
diff --git a/bundles/org.eclipse.osgi/JavaSE_compact3-1.8.profile b/bundles/org.eclipse.osgi/JavaSE_compact3-1.8.profile
index 05182dd..6043c8a 100644
--- a/bundles/org.eclipse.osgi/JavaSE_compact3-1.8.profile
+++ b/bundles/org.eclipse.osgi/JavaSE_compact3-1.8.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2014 IBM Corporation and others.
+# Copyright (c) 2014, 2018 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
@@ -9,7 +9,56 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.io,\
+ java.lang,\
+ java.lang.annotation,\
+ java.lang.instrument,\
+ java.lang.invoke,\
+ java.lang.management,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.nio,\
+ java.nio.channels,\
+ java.nio.channels.spi,\
+ java.nio.charset,\
+ java.nio.charset.spi,\
+ java.nio.file,\
+ java.nio.file.attribute,\
+ java.nio.file.spi,\
+ java.rmi,\
+ java.rmi.activation,\
+ java.rmi.dgc,\
+ java.rmi.registry,\
+ java.rmi.server,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.sql,\
+ java.text,\
+ java.text.spi,\
+ java.time,\
+ java.time.chrono,\
+ java.time.format,\
+ java.time.temporal,\
+ java.time.zone,\
+ java.util,\
+ java.util.concurrent,\
+ java.util.concurrent.atomic,\
+ java.util.concurrent.locks,\
+ java.util.function,\
+ java.util.jar,\
+ java.util.logging,\
+ java.util.prefs,\
+ java.util.regex,\
+ java.util.spi,\
+ java.util.stream,\
+ java.util.zip,\
  javax.annotation.processing,\
+ javax.crypto,\
  javax.crypto.interfaces,\
  javax.crypto.spec,\
  javax.lang.model,\
diff --git a/bundles/org.eclipse.osgi/OSGi_Minimum-1.0.profile b/bundles/org.eclipse.osgi/OSGi_Minimum-1.0.profile
index 40da61f..aa96175 100644
--- a/bundles/org.eclipse.osgi/OSGi_Minimum-1.0.profile
+++ b/bundles/org.eclipse.osgi/OSGi_Minimum-1.0.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2003, 2005 IBM Corporation and others.
+# Copyright (c) 2003, 2018 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
@@ -8,7 +8,22 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-org.osgi.framework.system.packages = 
+org.osgi.framework.system.packages = \
+ java.io,\
+ java.lang,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.text,\
+ java.util,\
+ java.util.jar,\
+ java.util.zip
 org.osgi.framework.bootdelegation = \
  sun.*,\
  com.sun.*
diff --git a/bundles/org.eclipse.osgi/OSGi_Minimum-1.1.profile b/bundles/org.eclipse.osgi/OSGi_Minimum-1.1.profile
index 818bf10..27aaa06 100644
--- a/bundles/org.eclipse.osgi/OSGi_Minimum-1.1.profile
+++ b/bundles/org.eclipse.osgi/OSGi_Minimum-1.1.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2003, 2005 IBM Corporation and others.
+# Copyright (c) 2003, 2018 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
@@ -8,7 +8,23 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-org.osgi.framework.system.packages = 
+org.osgi.framework.system.packages = \
+ java.io,\
+ java.lang,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.text,\
+ java.text.resources,\
+ java.util,\
+ java.util.jar,\
+ java.util.zip
 org.osgi.framework.bootdelegation = \
  sun.*,\
  com.sun.*
diff --git a/bundles/org.eclipse.osgi/OSGi_Minimum-1.2.profile b/bundles/org.eclipse.osgi/OSGi_Minimum-1.2.profile
index 95a6896..cf0a59c 100644
--- a/bundles/org.eclipse.osgi/OSGi_Minimum-1.2.profile
+++ b/bundles/org.eclipse.osgi/OSGi_Minimum-1.2.profile
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2003, 2008 IBM Corporation and others.
+# Copyright (c) 2003, 2018 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
@@ -9,6 +9,21 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 org.osgi.framework.system.packages = \
+ java.io,\
+ java.lang,\
+ java.lang.ref,\
+ java.lang.reflect,\
+ java.math,\
+ java.net,\
+ java.security,\
+ java.security.acl,\
+ java.security.cert,\
+ java.security.interfaces,\
+ java.security.spec,\
+ java.text,\
+ java.util,\
+ java.util.jar,\
+ java.util.zip,\
  javax.security.auth.x500
 org.osgi.framework.bootdelegation = \
  javax.security.auth.x500
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
index adb94d0..f2e51e0 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2016 IBM Corporation and others.
+ * Copyright (c) 2012, 2018 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
@@ -10,9 +10,20 @@
  *******************************************************************************/
 package org.eclipse.osgi.container.builders;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import org.eclipse.osgi.container.ModuleRevisionBuilder;
-import org.eclipse.osgi.container.namespaces.*;
+import org.eclipse.osgi.container.namespaces.EclipsePlatformNamespace;
+import org.eclipse.osgi.container.namespaces.EquinoxFragmentNamespace;
+import org.eclipse.osgi.container.namespaces.EquinoxModuleDataNamespace;
 import org.eclipse.osgi.internal.framework.EquinoxContainer;
 import org.eclipse.osgi.internal.framework.FilterImpl;
 import org.eclipse.osgi.internal.messages.Msg;
@@ -20,8 +31,18 @@
 import org.eclipse.osgi.storage.NativeCodeFinder;
 import org.eclipse.osgi.util.ManifestElement;
 import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.*;
-import org.osgi.framework.namespace.*;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.Version;
+import org.osgi.framework.VersionRange;
+import org.osgi.framework.namespace.BundleNamespace;
+import org.osgi.framework.namespace.ExecutionEnvironmentNamespace;
+import org.osgi.framework.namespace.HostNamespace;
+import org.osgi.framework.namespace.IdentityNamespace;
+import org.osgi.framework.namespace.NativeNamespace;
+import org.osgi.framework.namespace.PackageNamespace;
 import org.osgi.framework.wiring.BundleRevision;
 import org.osgi.resource.Namespace;
 
@@ -141,7 +162,7 @@
 					throw new BundleException(message + " : " + NLS.bind(Msg.HEADER_PACKAGE_DUPLICATES, packageNames[j]), BundleException.MANIFEST_ERROR); //$NON-NLS-1$
 				}
 				// check for java.*
-				if (packageNames[j].startsWith("java.")) { //$NON-NLS-1$
+				if (export && packageNames[j].startsWith("java.")) { //$NON-NLS-1$
 					String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString());
 					throw new BundleException(message + " : " + NLS.bind(Msg.HEADER_PACKAGE_JAVA, packageNames[j]), BundleException.MANIFEST_ERROR); //$NON-NLS-1$
 				}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
index 5e759f0..be7e283 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2017 IBM Corporation and others.
+ * Copyright (c) 2012, 2018 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
@@ -1683,7 +1683,7 @@
 				Object descriptor = getDescriptor.invoke(m);
 				for (Object export : (Set<?>) exports.invoke(descriptor)) {
 					String pkg = (String) source.invoke(export);
-					if (((Set<?>) targets.invoke(export)).isEmpty() && !pkg.startsWith("java.")) { //$NON-NLS-1$
+					if (((Set<?>) targets.invoke(export)).isEmpty()) {
 						packages.add(pkg);
 					}
 				}
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/messages/ExternalMessages.properties b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/messages/ExternalMessages.properties
index a6e5ed0..243aa41 100644
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/messages/ExternalMessages.properties
+++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/messages/ExternalMessages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2003, 2016 IBM Corporation and others.
+# Copyright (c) 2003, 2018 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
@@ -42,7 +42,7 @@
 URL_HANDLER_INCORRECT_TYPE=The service property "{0}" is not the correct type for the service "{1}" registered by the bundle "{2}"
 
 HEADER_PACKAGE_DUPLICATES=Cannot import a package more than once \"{0}\"
-HEADER_PACKAGE_JAVA=Cannot specify java.* packages in Import/Export headers \"{0}\"
+HEADER_PACKAGE_JAVA=Cannot specify java.* packages in Export headers \"{0}\"
 HEADER_VERSION_ERROR=The attributes \"{0}\" and \"{1}\" must match
 HEADER_EXPORT_ATTR_ERROR=Specifying \"{0}\" in the \"{1}\" header is not permitted
 HEADER_DIRECTIVE_DUPLICATES=Duplicate directives are not permitted \"{0}\"