Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2010-02-01 14:05:20 +0000
committerThomas Watson2010-02-01 14:05:20 +0000
commit762b7e4048515721b09965db58b0c179e5b43398 (patch)
tree93bdeffefd2d208b1e59311b32fbb20eadd18689 /bundles/org.eclipse.osgi
parent0b05ab82931f70af4fa9ceca9c4c4da75f29324b (diff)
downloadrt.equinox.framework-762b7e4048515721b09965db58b0c179e5b43398.tar.gz
rt.equinox.framework-762b7e4048515721b09965db58b0c179e5b43398.tar.xz
rt.equinox.framework-762b7e4048515721b09965db58b0c179e5b43398.zip
Bug 299921 - DefaultClassLoader.getResources() can erroneously return null
Diffstat (limited to 'bundles/org.eclipse.osgi')
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader.java
index 3bef6ced8..327b7bcfb 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 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
@@ -17,6 +17,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.security.*;
import java.security.cert.Certificate;
+import java.util.Collections;
import java.util.Enumeration;
import org.eclipse.osgi.baseadaptor.BaseData;
import org.eclipse.osgi.baseadaptor.bundlefile.*;
@@ -44,6 +45,8 @@ public class DefaultClassLoader extends ClassLoader implements ParallelClassLoad
private final static String CLASS_LOADER_TYPE_PARALLEL = "parallel"; //$NON-NLS-1$
private static final boolean CLASS_CERTIFICATE;
private static final boolean PARALLEL_CAPABLE;
+ private static final Enumeration EMPTY_ENUMERATION = Collections.enumeration(Collections.EMPTY_LIST);
+
static {
CLASS_CERTIFICATE = Boolean.valueOf(FrameworkProperties.getProperty(CLASS_CERTIFICATE_SUPPORT, "true")).booleanValue(); //$NON-NLS-1$
AllPermission allPerm = new AllPermission();
@@ -156,7 +159,10 @@ public class DefaultClassLoader extends ClassLoader implements ParallelClassLoad
* @throws IOException
*/
protected Enumeration findResources(String name) throws IOException {
- return (delegate.findResources(name));
+ Enumeration result = delegate.findResources(name);
+ if (result == null)
+ return EMPTY_ENUMERATION;
+ return result;
}
/**

Back to the top