I'm planning to commit this patch. The reason for it is that the
logic of initCause() is unnecessary in the constructor, and represents
unnecessary overhead which we pay for every time a chained exception
is created. The effect is especially exacerbated when the constructor
invocation is inlined at every instantiation site, bloating code size.

Note that initCause() is not final, so a subclass could override it;
however the constructor does not specify that it calls initCause() to
initialize the cause so this doesn't change any specified behavior.

2005-02-19  Archie Cobbs  <[EMAIL PROTECTED]>
 
     * java/lang/Throwable.java: simplify initializing cause in constructor

Thanks,
-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
Index: java/lang/Throwable.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/Throwable.java,v
retrieving revision 1.28
diff -u -r1.28 Throwable.java
--- java/lang/Throwable.java	16 Feb 2005 11:18:37 -0000	1.28
+++ java/lang/Throwable.java	19 Feb 2005 02:56:02 -0000
@@ -172,7 +172,7 @@
   public Throwable(String message, Throwable cause)
   {
     this(message);
-    initCause(cause);
+    this.cause = cause;
   }
 
   /**
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to