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=34945>.
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=34945


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |ASSIGNED




------- Additional Comments From [EMAIL PROTECTED]  2007-01-26 18:02 -------

The patch I came up for this should work and fulfill our needs.

log4j/src/java/org/apache/log4j/spi/ThrowableInformation.java   (working copy)
@@ -66,20 +66,25 @@
   public void extractStringRep(Throwable t, VectorWriter vw) {
     t.printStackTrace(vw);
 
+    // The Throwable.getCause was added in JDK 1.4. The printStackTrace
+    // method was modified in JDK 1.4 to handle the nested throwable returned
+    // by Throwable.getCause.    
+
+    if (PlatformInfo.isJDK14OrLater())
+      return;
+
     // Check if the Throwable t has a nested Throwable. If so, invoke
     // extractStringRep recursively.
-    // Note that the Throwable.getCause was added in JDK 1.4. The 
printStackTrace
-    // method was modified in JDK 1.4 to handle the nested throwable returned
-    // by Throwable.getCause.
     try {
       Class tC = t.getClass();
       Method[] mA = tC.getMethods();
       Method nextThrowableMethod = null;
       for (int i = 0; i < mA.length; i++) {
-        if (("getCause".equals(mA[i].getName()) && 
!PlatformInfo.isJDK14OrLater())
-            || "getRootCause".equals(mA[i].getName())
-            || "getNextException".equals(mA[i].getName())
-            || "getException".equals(mA[i].getName())) {
+        String name = mA[i].getName();
+        if (("getCause".equals(name))
+            || "getRootCause".equals(name)
+            || "getNextException".equals(name)
+            || "getException".equals(name)) {
           // check param types
           Class[] params = mA[i].getParameterTypes();
           if ((params == null) || (params.length == 0)) {

...

I'm thinking that for JDK 1.3 and earlier, we simply remove the "feature" as
really it relies on unknown and unspecified behavior of some Throwable's
printStackTrace().

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

Reply via email to