commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35147] - [digester] Class.getClassLoader() is not reliable
Date Tue, 31 May 2005 23:57:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35147>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35147





------- Additional Comments From skitching@apache.org  2005-06-01 01:57 -------
Thanks for your proposal, Bill.

I'm generally in favour of replacing
  classloader.loadClass(classname)
with
  Class.forName(classname, false, classloader)
as I *think* they are equivalent and the latter works when classloader is null.

Of course Class.forName(classname) is quite a different thing, and not appropriate.

However there is no method
   Class.getResource(name, classloader)
or
   Class.getResourceAsStream(name, classloader)
so in this case the method on classloader would still need to be used, or the
slightly clumsy workaround:
  if (classloader == null) {
    // assume Object.class is loaded via the null classloader
    Object.class.getResource(name);
  } else {
    classloader.getResource(name);
  }


It would be a reasonably intrusive change, though: about 15 classes would need
to be changed, just to support digester in embedded systems - which is not
common [I assume Bentley MicroStation is an embedded java product]. NB: this
issue can also occur in java1.1, but Digester does not support java1.1.

So while I am in favour of this change, I would prefer to see this done *after*
the 1.7 release is out.

Comments anyone?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message