Author: borges
Date: 2012-02-27 10:03:59 -0500 (Mon, 27 Feb 2012)
New Revision: 12202
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/XidImpl.java
Log:
Simplify hashCode calculation.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/XidImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/XidImpl.java 2012-02-27
15:03:44 UTC (rev 12201)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/XidImpl.java 2012-02-27
15:03:59 UTC (rev 12202)
@@ -14,19 +14,20 @@
package org.hornetq.core.transaction.impl;
import java.io.Serializable;
+import java.util.Arrays;
import javax.transaction.xa.Xid;
import org.hornetq.utils.Base64;
/**
- *
+ *
* Xid implementation
- *
+ *
* @author <a href="mailto:adrian@jboss.org>Adrian Brock</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:juha@jboss.org">Juha Lindfors</a>
- *
+ *
* @version $Revision 1.1 $
*/
public class XidImpl implements Xid, Serializable
@@ -201,8 +202,7 @@
private void calcHash()
{
byte[] hashBytes = XidImpl.toByteArray(this);
- String s = new String(hashBytes);
- hash = s.hashCode();
+ hash = Arrays.hashCode(hashBytes);
hashCalculated = true;
}