BZ #126: Faulty ClassLoader behavior should be corrected

Status fields:

creation_ts:2009-04-02 17:02
component:vm
version:unspecified
rep_platform:All
op_sys:All
bug_status:RESOLVED
resolution:FIXED
reporter:michi@complang.tuwien.ac.at
Any user-defined classloader is expected to either return a class or throw an exception
in methods like findClass() or loadClass(). Although this is not explicitly specified in
the documentation [1], I still believe this to be true.

The problem is that HotSpot corrects this faulty behavior and therefore most developers
just don't care and rely on this correction. There even is a regression test checking
this correction, it can be found at:
./openjdk/jdk/test/java/lang/ClassLoader/ExceptionHidingLoader.java

We need to do the correction in Cacao as well. You know the rules of the game, the RI is
always right :(

References:
[1] http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ClassLoader.html#findClass(java.la
ng.String)

Comment #1 by michi@complang.tuwien.ac.at on 2009-04-02 17:57:39

We are not correcting the faulty behavior as described above. There is also a new flag
-XX:+PrintWarnings which should be used to log such suspicious application behavior.
This is the fix:
http://mips.complang.tuwien.ac.at/hg/cacao/rev/248f1d37823a

Comment #2 by michi@complang.tuwien.ac.at on 2009-04-02 17:58:33

(In reply to comment #1)
> We are not correcting ...
Clearly it should say "we are now correcting" :)