aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-04-04 18:40:24 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-04-04 18:40:24 +0000
commit6a5d24d70d5c0f4d53b1796ed5e8c3fd252dc268 (patch)
treed4fa1a0589c9af574110daa317692041b9f2d10a /libjava
parentd4e1591f4a62388c84cc8f07e9975413f0a8e5ac (diff)
downloadgcc-6a5d24d70d5c0f4d53b1796ed5e8c3fd252dc268.zip
gcc-6a5d24d70d5c0f4d53b1796ed5e8c3fd252dc268.tar.gz
gcc-6a5d24d70d5c0f4d53b1796ed5e8c3fd252dc268.tar.bz2
ClassLoader.java (loadClass): Resolve class even if it was already found.
* java/lang/ClassLoader.java (loadClass): Resolve class even if it was already found. From-SVN: r97565
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/java/lang/ClassLoader.java32
2 files changed, 21 insertions, 16 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 59c6d97..f9a7617 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,10 @@
2005-04-04 Tom Tromey <tromey@redhat.com>
+ * java/lang/ClassLoader.java (loadClass): Resolve class even if
+ it was already found.
+
+2005-04-04 Tom Tromey <tromey@redhat.com>
+
* java/net/URL.java (DEFAULT_SEARCH_PATH): Added
org.metastatic.jessie.
diff --git a/libjava/java/lang/ClassLoader.java b/libjava/java/lang/ClassLoader.java
index f2beaac..db68e60 100644
--- a/libjava/java/lang/ClassLoader.java
+++ b/libjava/java/lang/ClassLoader.java
@@ -285,28 +285,28 @@ public abstract class ClassLoader
{
// Have we already loaded this class?
Class c = findLoadedClass(name);
- if (c != null)
- return c;
-
- // Can the class be loaded by a parent?
- try
+ if (c == null)
{
- if (parent == null)
+ // Can the class be loaded by a parent?
+ try
{
- c = VMClassLoader.loadClass(name, resolve);
- if (c != null)
- return c;
+ if (parent == null)
+ {
+ c = VMClassLoader.loadClass(name, resolve);
+ if (c != null)
+ return c;
+ }
+ else
+ {
+ return parent.loadClass(name, resolve);
+ }
}
- else
+ catch (ClassNotFoundException e)
{
- return parent.loadClass(name, resolve);
}
+ // Still not found, we have to do it ourself.
+ c = findClass(name);
}
- catch (ClassNotFoundException e)
- {
- }
- // Still not found, we have to do it ourself.
- c = findClass(name);
if (resolve)
resolveClass(c);
return c;