[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Brian Stansberry
brian.stansberry at jboss.com
Fri Jun 29 00:26:55 EDT 2007
User: bstansberry
Date: 07/06/29 00:26:55
Modified: src/org/jboss/cache/interceptors Tag:
Branch_JBossCache_1_4_0
OrderedSynchronizationHandler.java
TxInterceptor.java
Log:
[JBCACHE-1114] Don't call Transaction.toString() in a Synchronization's toString()
Revision Changes Path
No revision
No revision
1.3.2.1 +11 -2 JBossCache/src/org/jboss/cache/interceptors/OrderedSynchronizationHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OrderedSynchronizationHandler.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/OrderedSynchronizationHandler.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -b -r1.3 -r1.3.2.1
--- OrderedSynchronizationHandler.java 10 Apr 2006 05:31:04 -0000 1.3
+++ OrderedSynchronizationHandler.java 29 Jun 2007 04:26:55 -0000 1.3.2.1
@@ -20,7 +20,7 @@
* afterCompletion() <em>before</em> the TransactionInterceptor's.
*
* @author Bela Ban
- * @version $Id: OrderedSynchronizationHandler.java,v 1.3 2006/04/10 05:31:04 genman Exp $
+ * @version $Id: OrderedSynchronizationHandler.java,v 1.3.2.1 2007/06/29 04:26:55 bstansberry Exp $
*/
public class OrderedSynchronizationHandler implements Synchronization {
Transaction tx=null;
@@ -93,7 +93,16 @@
public String toString() {
StringBuffer sb=new StringBuffer();
- sb.append("tx=" + tx + ", handlers=" + handlers);
+ sb.append("tx=" + getTxAsString() + ", handlers=" + handlers);
return sb.toString();
}
+
+ private String getTxAsString()
+ {
+ // JBCACHE-1114 -- don't call toString() on tx or it can lead to stack overflow
+ if (tx == null)
+ return null;
+
+ return tx.getClass().getName() + "@" + System.identityHashCode(tx);
+ }
}
1.48.2.14 +11 -2 JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TxInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java,v
retrieving revision 1.48.2.13
retrieving revision 1.48.2.14
diff -u -b -r1.48.2.13 -r1.48.2.14
--- TxInterceptor.java 28 Feb 2007 18:37:01 -0000 1.48.2.13
+++ TxInterceptor.java 29 Jun 2007 04:26:55 -0000 1.48.2.14
@@ -1099,7 +1099,16 @@
public String toString()
{
- return "TxInterceptor.RemoteSynchronizationHandler(gtx=" + gtx + ", tx=" + tx + ")";
+ return "TxInterceptor.RemoteSynchronizationHandler(gtx=" + gtx + ", tx=" + getTxAsString() + ")";
+ }
+
+ protected String getTxAsString()
+ {
+ // JBCACHE-1114 -- don't call toString() on tx or it can lead to stack overflow
+ if (tx == null)
+ return null;
+
+ return tx.getClass().getName() + "@" + System.identityHashCode(tx);
}
}
@@ -1177,7 +1186,7 @@
public String toString()
{
- return "TxInterceptor.LocalSynchronizationHandler(gtx=" + gtx + ", tx=" + tx + ")";
+ return "TxInterceptor.LocalSynchronizationHandler(gtx=" + gtx + ", tx=" + getTxAsString() + ")";
}
}
}
More information about the jboss-cvs-commits
mailing list