Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2010-01-28 15:16:28 +0000
committerThomas Watson2010-01-28 15:16:28 +0000
commitd2c138a6fe175f499990fdaf8dd4852124f063a9 (patch)
tree1ece81a886a343227528718a486ca5b5e1c5547f
parent38bc25f793a32b157ac736303cdaf7abb3d19ace (diff)
downloadrt.equinox.framework-d2c138a6fe175f499990fdaf8dd4852124f063a9.tar.gz
rt.equinox.framework-d2c138a6fe175f499990fdaf8dd4852124f063a9.tar.xz
rt.equinox.framework-d2c138a6fe175f499990fdaf8dd4852124f063a9.zip
Bug 299922 - Equinox should not use new ClassLoader(null)
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/SystemPolicy.java4
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseAdaptor.java11
-rw-r--r--bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/ContextFinder.java4
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java6
4 files changed, 8 insertions, 17 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/SystemPolicy.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/SystemPolicy.java
index 7b9a6cea1..04d12f153 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/SystemPolicy.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/loader/buddy/SystemPolicy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -20,7 +20,7 @@ public class SystemPolicy implements IBuddyPolicy {
private static class ParentClassLoader extends ClassLoader {
protected ParentClassLoader() {
- super(null);
+ super(Object.class.getClassLoader());
}
}
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseAdaptor.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseAdaptor.java
index 64249e831..324ff1c1e 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseAdaptor.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseAdaptor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -67,14 +67,7 @@ public class BaseAdaptor implements FrameworkAdaptor {
}
// default to boot classloader
if (bundleClassLoaderParent == null)
- bundleClassLoaderParent = new ParentClassLoader();
- }
-
- // Empty parent classloader. This is used by default as the BundleClassLoader parent.
- private static class ParentClassLoader extends ClassLoader {
- protected ParentClassLoader() {
- super(null);
- }
+ bundleClassLoaderParent = new ClassLoader(Object.class.getClassLoader()) {/* boot class loader*/};
}
private EventPublisher eventPublisher;
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/ContextFinder.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/ContextFinder.java
index b8fc302a3..eca564ac1 100644
--- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/ContextFinder.java
+++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/ContextFinder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -43,7 +43,7 @@ public class ContextFinder extends ClassLoader implements PrivilegedAction {
public ContextFinder(ClassLoader contextClassLoader) {
super(contextClassLoader);
- this.parentContextClassLoader = contextClassLoader != null ? contextClassLoader : new ClassLoader(null) {/*parentless classloader*/};
+ this.parentContextClassLoader = contextClassLoader != null ? contextClassLoader : new ClassLoader(Object.class.getClassLoader()) {/*boot classloader*/};
}
// Return a list of all classloaders on the stack that are neither the
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java
index d13a68305..8376bfc88 100644
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java
+++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 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
@@ -31,9 +31,7 @@ public class SecureAction {
// This ClassLoader is used in loadSystemClass if System.getClassLoader() returns null
static final ClassLoader bootClassLoader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
- return new ClassLoader(null) {
- // parentless ClassLoader
- };
+ return new ClassLoader(Object.class.getClassLoader()) { /* boot class loader */};
}
});

Back to the top