classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches]: Patch: UIDefaults fix


From: Tom Tromey
Subject: Re: [cp-patches]: Patch: UIDefaults fix
Date: 16 Oct 2005 11:07:41 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Audrius" == Meskauskas Audrius <address@hidden> 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




reply via email to

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