classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Another patch proposal for java.lang.Class


From: Jeroen Frijters
Subject: [cp-patches] Another patch proposal for java.lang.Class
Date: Thu, 22 Jul 2004 10:00:15 +0200

Hi,

I committed my previously proposed changes to java.lang.Class and here
is another proposed patch.

This fixed two problems in Class.getClassLoader(). The first is that the
security check was incorrect (this one is fairly obvious) and the second
one is that it should not, IMO, blindly return null for class names that
start with "java." (or "gnu.java."). Here's why: Even though the
documentation for ClassLoader.defineClass says that a class name cannot
start with "java.", the Sun JVM doesn't actually enforce this (and there
isn't any reason to, if the class loader namespaces are properly
implememented in the VM). If a VM choses to allow custom class loaders
to define classes with a "java." name, the current
Class.getClassLoader() implementation would introduce a security hole
(by returning null).

Comments?

Regards,
Jeroen

Attachment: class.patch
Description: class.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]