DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7468>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7468 Logging has a NPE when security prevents property reading Summary: Logging has a NPE when security prevents property reading Product: Commons Version: 1.0 Final Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: Logging AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] In LogFactoryImpl: // Identify the Log implementation class we will be using String logClassName = null; try { /** Read attributes **/ /** Read properties **/ /** Look for Log4J **/ /** Look for jdk1.4 **/ /** Use Default logger **/ } catch (SecurityException e) { } // Attempt to load the Log implementation class Class logClass = null; try { logClass = loadClass(logClassName); If a SecurityException occurs, then logClassName isn't ever set, and the loadClass method throws a NullPointerException. What to do? a) Throw the SecurityException instead. Better, because then the cause is at least clearer (than the NPE), but probably not what we want. b) Have the DefaultLogger setting occur outside of the "try". Better still, but then you loose any chance of getting log4j or jdk1.4, just because you aren't allowed to read system properties. c) Only wrap the getProperty calls in the try block. I think this is the best solution, but I'm not sure if any of the other code in there could raise a SecruityException. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>