aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/natClass.cc
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2005-04-01 17:16:04 +0000
committerDiego Novillo <dnovillo@redhat.com>2005-04-01 17:16:04 +0000
commit2c1b41938630950e8699a2cbae3088b9c179f809 (patch)
treef93745f2390682fcf3269662fee7c5e14bf0d2d1 /libjava/java/lang/natClass.cc
parent7b560836d28c028988edc3c1ccc7348bbfc91ac8 (diff)
Merge mainline->tcb as of 2005-03-29.tree-cleanup-branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@97408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/natClass.cc')
-rw-r--r--libjava/java/lang/natClass.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc
index f48a6fd77ed..b93694790bb 100644
--- a/libjava/java/lang/natClass.cc
+++ b/libjava/java/lang/natClass.cc
@@ -126,16 +126,16 @@ java::lang::Class::getClassLoader (void)
s->checkPermission (new RuntimePermission (JvNewStringLatin1 ("getClassLoader")));
}
- // The spec requires us to return `null' for primitive classes. In
- // other cases we have the option of returning `null' for classes
- // loaded with the bootstrap loader. All gcj-compiled classes which
- // are linked into the application used to return `null' here, but
- // that confuses some poorly-written applications. It is a useful
- // and apparently harmless compatibility hack to simply never return
- // `null' instead.
- if (isPrimitive ())
- return NULL;
- return loader ? loader : ClassLoader::systemClassLoader;
+ // This particular 'return' has been changed a couple of times over
+ // libgcj's history. This particular approach is a little weird,
+ // because it means that all classes linked into the application
+ // will see NULL for their class loader. This may confuse some
+ // applications that aren't expecting this; the solution is to use a
+ // different linking model for these applications. In the past we
+ // returned the system class loader in this case, but that is
+ // incorrect. Also, back then we didn't have other linkage models
+ // to fall back on.
+ return loader;
}
java::lang::reflect::Constructor *