A new constructor was added to LocationInfo for 1.2.15, but it doesn't quite work properly. The other get*() methods use the fullInfo field to calculate values, but the new constructor effectively sets them.

I'm proposing the following diff:

Index: src/java/org/apache/log4j/spi/LocationInfo.java
===================================================================
--- src/java/org/apache/log4j/spi/LocationInfo.java (revision 531299)
+++ src/java/org/apache/log4j/spi/LocationInfo.java     (working copy)
@@ -179,6 +179,8 @@
     */
     public
     String getClassName() {
+        if(className != null ) return className;
+
       if(fullInfo == null) return NA;
       if(className == null) {
        // Starting the search from '(' is safer because there is
@@ -219,6 +221,8 @@
     */
     public
     String getFileName() {
+        if(fileName !=null) return fileName;
+
       if(fullInfo == null) return NA;
       if(fileName == null) {
@@ -240,6 +244,8 @@
     */
     public
     String getLineNumber() {
+        if(lineNumber !=null ) return lineNumber;
+
       if(fullInfo == null) return NA;
       if(lineNumber == null) {
@@ -258,6 +264,8 @@
     */
     public
     String getMethodName() {
+        if( methodName !=null ) return methodName;
+
       if(fullInfo == null) return NA;
       if(methodName == null) {
        int iend = fullInfo.lastIndexOf('(');


This will then give the juli-log4j bridge complete LocationInfo support (other than java.util.logging not supporting the line # and source file data AFAIK)

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to