>>>>> "Audrius" == Meskauskas Audrius <[EMAIL PROTECTED]> writes:

Audrius> To get the test work, I obtain the class loader of the testlet and
Audrius> temporary set it as a context class loader for the thread that enters
Audrius> the Testlet.test. Then Thread.getConextClassLoader() in the testlet
Audrius> returns the correct loader, even if called from another thread,
Audrius> constructed inside the Testlet.test.

Yeah, we need tests like this for the other areas where we aren't sure
what class loader to use.

Audrius> I would suggest to think twice before using Class.forName in the core
Audrius> class. Class.forName there means "use the loader of the current class"
Audrius> = "use system class loader". And the system class loader only knowns
Audrius> about GNU Classpath classes and about nothing else.

Actually Class.forName, when called from the Classpath core, will
typically use the bootstrap class loader.  The system class loader is
often a better choice.  But exactly which loader to use must depend on
compatibility.  Also we should carefully document which class loader
we are using -- Sun often does not, which is less than friendly; we
can do better.

Tom


_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to