private final int hashCode;
private XidWrapper(Xid xid, boolean includeBranch) {
this.xid = xid;
// do calculations once for performance
String tmpString =
new String(xid.getGlobalTransactionId())
+ (includeBranch ? "-" + new String(xid.getBranchQualifier()) : "");
// XXX for tx file store replace :, \ and / which might be part of the identifier with chars not
// offensive to any file system specific chars
tmpString = tmpString.replace(':', '.');
tmpString = tmpString.replace('/', '-');
asString = tmpString.replace('\\', '_');
hashCode = asString.hashCode();
}