aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/ClassLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/lang/ClassLoader.java')
-rw-r--r--libjava/java/lang/ClassLoader.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/libjava/java/lang/ClassLoader.java b/libjava/java/lang/ClassLoader.java
index 2c0e211..1b3b310 100644
--- a/libjava/java/lang/ClassLoader.java
+++ b/libjava/java/lang/ClassLoader.java
@@ -177,14 +177,18 @@ public abstract class ClassLoader
if (c == null)
{
- try {
- if (parent != null)
- return parent.loadClass (name, link);
- else
- c = gnu.gcj.runtime.VMClassLoader.instance.findClass (name);
- } catch (ClassNotFoundException ex) {
- /* ignore, we'll try findClass */;
- }
+ try
+ {
+ ClassLoader cl = parent;
+ if (parent == null)
+ cl = gnu.gcj.runtime.VMClassLoader.instance;
+ if (cl != this)
+ c = cl.loadClass (name, link);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ /* ignore, we'll try findClass */;
+ }
}
if (c == null)