Program: 155510
Project: 155510
Buggy source:
/** 
 * Enlist the   {@link XAResourceHolder} in the current transaction or do nothing if there is no global transactioncontext for this thread.
 * @param xaResourceHolder the {@link XAResourceHolder} to enlist.
 * @param bean the {@link ResourceBean} of the {@link XAResourceHolder}.
 * @throws SystemException if an internal error happens.
 * @throws RollbackException if the current transaction has been marked as rollback only.
 */
public static void enlistInCurrentTransaction(XAResourceHolder xaResourceHolder,ResourceBean bean) throws SystemException, RollbackException {
  BitronixTransaction currentTransaction=currentTransaction();
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + xaResourceHolder + "String_Node_Str"+ currentTransaction);
  if (currentTransaction != null) {
    if (currentTransaction.timedOut())     throw new BitronixSystemException("String_Node_Str");
    XAResourceHolderState alreadyEnlistedXAResourceHolderState=TransactionContextHelper.getAlreadyEnlistedXAResourceHolderState(xaResourceHolder,currentTransaction);
    if (alreadyEnlistedXAResourceHolderState == null || alreadyEnlistedXAResourceHolderState.isEnded()) {
      XAResourceHolderState xaResourceHolderState=new XAResourceHolderState(xaResourceHolder,bean);
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + xaResourceHolderState + "String_Node_Str"+ currentTransaction);
      xaResourceHolder.setXAResourceHolderState(xaResourceHolderState);
      currentTransaction.enlistResource(xaResourceHolderState.getXAResource());
    }
 else     if (log.isDebugEnabled())     log.debug("String_Node_Str" + alreadyEnlistedXAResourceHolderState);
  }
 else {
    if (bean.getAllowLocalTransactions()) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str");
    }
 else     throw new BitronixSystemException("String_Node_Str" + bean.getUniqueName() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Enlist the   {@link XAResourceHolder} in the current transaction or do nothing if there is no global transactioncontext for this thread.
 * @param xaResourceHolder the {@link XAResourceHolder} to enlist.
 * @param bean the {@link ResourceBean} of the {@link XAResourceHolder}.
 * @throws SystemException if an internal error happens.
 * @throws RollbackException if the current transaction has been marked as rollback only.
 */
public static void enlistInCurrentTransaction(XAResourceHolder xaResourceHolder,ResourceBean bean) throws SystemException, RollbackException {
  BitronixTransaction currentTransaction=currentTransaction();
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + xaResourceHolder + "String_Node_Str"+ currentTransaction);
  if (currentTransaction != null) {
    if (currentTransaction.timedOut())     throw new BitronixSystemException("String_Node_Str");
    XAResourceHolderState alreadyEnlistedXAResourceHolderState=TransactionContextHelper.getAlreadyEnlistedXAResourceHolderState(xaResourceHolder,currentTransaction);
    if (alreadyEnlistedXAResourceHolderState == null || alreadyEnlistedXAResourceHolderState.isEnded()) {
      enlist(xaResourceHolder,bean,currentTransaction);
    }
 else     if (log.isDebugEnabled())     log.debug("String_Node_Str" + alreadyEnlistedXAResourceHolderState);
  }
 else {
    if (bean.getAllowLocalTransactions()) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str");
    }
 else     throw new BitronixSystemException("String_Node_Str" + bean.getUniqueName() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
}