DO NOT REPLY [Bug 35147] New: - [digester] Class.getClassLoader() is not reliable

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

DO NOT REPLY [Bug 35147] New: - [digester] Class.getClassLoader() is not reliable

Bugzilla from bugzilla@apache.org
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

           Summary: [digester] Class.getClassLoader() is not reliable
           Product: Commons
           Version: 1.6 Final
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Digester
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]


Digester uses Class.getClassLoader() in numerous places, however this method is
documented as being able to return null, which it does under the custom Java in
Bentley MicroStation.  (In fact, *every* method that returns a classloader
actually returns null.)

It turns out that it's not necessary to use ClassLoader at all; Class offers
every method you need, and works every time.  So I made that patch -- using
Class.forName and Class.getResource instead of the ClassLoader versions.  It
works fine now.

If there's no reason to stick with ClassLoader, I'd suggest making this change
in the main code base.  I can't submit mine, as I have no good way to make a
patchfile.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]