Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2021-07-12 21:00:26 +0000
committerThomas Watson2021-07-13 01:55:56 +0000
commit457de70f6333272fc1c975b39ccfa3d9edc3525b (patch)
tree15df991ffa10ac6bddb762a3281dbbbc7b406291
parent940d7b0e4e2ef01cba8e9a26d8017c0696f77d61 (diff)
downloadrt.equinox.framework-457de70f6333272fc1c975b39ccfa3d9edc3525b.tar.gz
rt.equinox.framework-457de70f6333272fc1c975b39ccfa3d9edc3525b.tar.xz
rt.equinox.framework-457de70f6333272fc1c975b39ccfa3d9edc3525b.zip
Forcing FrameworkUtil to clinit before we register our factory with the multiplex factory allows it to successfully clinit before we have any chance of using it as part of our factory implementation. Change-Id: Ia1c3d9e54b1b9cf143b40121ef2f53fd0e012fe8 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com> Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/183002 Tested-by: Equinox Bot <equinox-bot@eclipse.org>
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/EquinoxFactoryManager.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/EquinoxFactoryManager.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/EquinoxFactoryManager.java
index 7c55f0e41..677d96ddf 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/EquinoxFactoryManager.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/EquinoxFactoryManager.java
@@ -19,10 +19,12 @@ import java.lang.reflect.Modifier;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandlerFactory;
+import java.util.Collections;
import java.util.Hashtable;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
import org.eclipse.osgi.internal.framework.EquinoxContainer;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
public class EquinoxFactoryManager {
private final EquinoxContainer container;
@@ -58,6 +60,9 @@ public class EquinoxFactoryManager {
}
private static void forceURLStreamHandlerFactory(URLStreamHandlerFactoryImpl shf) throws Exception {
+ // force our FrameworkUtil to initialize before we register to avoid calling
+ // getBundle before we register this as a multiplexing handler
+ FrameworkUtil.asDictionary(Collections.emptyMap());
Field factoryField = getField(URL.class, URLStreamHandlerFactory.class, false);
if (factoryField == null)
throw new Exception("Could not find URLStreamHandlerFactory field"); //$NON-NLS-1$

Back to the top