[jboss-svn-commits] JBL Code SVN: r26569 - labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/utils.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri May 15 12:26:34 EDT 2009


Author: jhalliday
Date: 2009-05-15 12:26:33 -0400 (Fri, 15 May 2009)
New Revision: 26569

Modified:
   labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/utils/XAHelper.java
Log:
Modified Xid printing behaviour. JBTM-297


Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/utils/XAHelper.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/utils/XAHelper.java	2009-05-15 16:18:16 UTC (rev 26568)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/utils/XAHelper.java	2009-05-15 16:26:33 UTC (rev 26569)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
  * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
+ * full listing of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public License,
  * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -32,6 +32,7 @@
 package com.arjuna.ats.jta.utils;
 
 import com.arjuna.ats.jta.logging.jtaLogger;
+import com.arjuna.ats.arjuna.xa.XID;
 
 import javax.transaction.xa.*;
 
@@ -44,7 +45,7 @@
 
 	/**
 	 * Print a human-readable version of the XAException.
-	 * 
+	 *
 	 * @message com.arjuna.ats.jta.utils.nullexception Null exception!
 	 * @message com.arjuna.ats.jta.utils.unknownerrorcode Unknown error code:
 	 */
@@ -112,12 +113,12 @@
 
 	/**
 	 * Compares two Xid instances.
-	 * 
+	 *
 	 * @param Xid
 	 *            x1 first Xid
 	 * @param Xid
 	 *            x2 second Xid
-	 * 
+	 *
 	 * @return <code>true</code> if the two instances are the same,
 	 *         <code>false</code> otherwise.
 	 */
@@ -169,12 +170,12 @@
 
 	/**
 	 * Compares two Xid instances at the gtid level only.
-	 * 
+	 *
 	 * @param Xid
 	 *            x1 first Xid
 	 * @param Xid
 	 *            x2 second Xid
-	 * 
+	 *
 	 * @return <code>true</code> if the two instances are the same,
 	 *         <code>false</code> otherwise.
 	 */
@@ -215,6 +216,11 @@
 
 	public static String xidToString (Xid xid)
 	{
+        if(xid instanceof XID) {
+            // ensure consistent representation of our native XIDs in the log output.
+            return xid.toString();
+        }
+
 	    byte[] gid = xid.getGlobalTransactionId();
 	    byte[] bqual = xid.getBranchQualifier();
 	    String toReturn = "< " + xid.getFormatId() + ", " + gid.length + ", "




More information about the jboss-svn-commits mailing list