Bug 442641 - Fix for dynamically reacting to new system bundle fragments
for NSL

Change-Id: I3ab598e80e4122e01f0a7c3b548494c37573296c
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java
index 62beb5b..a59b6a7 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java
@@ -34,8 +34,7 @@
 import org.eclipse.osgi.storage.BundleInfo.Generation;
 import org.eclipse.osgi.util.ManifestElement;
 import org.osgi.framework.*;
-import org.osgi.framework.namespace.BundleNamespace;
-import org.osgi.framework.namespace.PackageNamespace;
+import org.osgi.framework.namespace.*;
 import org.osgi.framework.wiring.BundleWiring;
 
 /**
@@ -245,6 +244,16 @@
 		synchronized (classLoaderMonitor) {
 			addFragmentExports(wiring.getModuleCapabilities(PackageNamespace.PACKAGE_NAMESPACE));
 			loadClassLoaderFragments(fragments);
+			clearManifestLocalizationCache();
+		}
+	}
+
+	protected void clearManifestLocalizationCache() {
+		Generation hostGen = (Generation) wiring.getRevision().getRevisionInfo();
+		hostGen.clearManifestCache();
+		for (ModuleWire fragmentWire : wiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE)) {
+			Generation fragGen = (Generation) fragmentWire.getRequirer().getRevisionInfo();
+			fragGen.clearManifestCache();
 		}
 	}
 
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/SystemBundleLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/SystemBundleLoader.java
index c79f4cd..e81a4ba 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/SystemBundleLoader.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/SystemBundleLoader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2013 IBM Corporation and others.
+ * Copyright (c) 2003, 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
@@ -132,6 +132,7 @@
 					systemModule.getContainer().getAdaptor().publishContainerEvent(ContainerEvent.ERROR, systemModule, e);
 				}
 			}
+			getClasspathManager().loadFragments(fragments);
 		}
 	}
 }