Program: 154780
Project: 154780
Buggy source:
public synchronized void applyTransactionWithoutTxId(ReadableByteChannel byteChannel,long nextTxId,int masterId) throws IOException {
  if (nextTxId != (xaTf.getLastCommittedTx() + 1)) {
    throw new IllegalStateException("String_Node_Str" + nextTxId + "String_Node_Str"+ (xaTf.getCurrentVersion() + 1));
  }
  log.fine("String_Node_Str" + logVersion + "String_Node_Str"+ nextTxId+ "String_Node_Str");
  long logEntriesFound=0;
  scanIsComplete=false;
  LogApplier logApplier=new LogApplier(byteChannel);
  int xidIdent=getNextIdentifier();
  long startEntryPosition=writeBuffer.getFileChannelPosition();
  ;
  while (logApplier.readAndWriteAndApplyEntry(xidIdent)) {
    logEntriesFound++;
  }
  byteChannel.close();
  LogEntry.Start startEntry=logApplier.startEntry;
  if (startEntry == null) {
    throw new IOException("String_Node_Str");
  }
  startEntry.setStartPosition(startEntryPosition);
  LogEntry.OnePhaseCommit commit=new LogEntry.OnePhaseCommit(xidIdent,nextTxId,masterId);
  LogIoUtils.writeLogEntry(commit,writeBuffer);
  Xid xid=startEntry.getXid();
  try {
    XaTransaction xaTx=xaRm.getXaTransaction(xid);
    xaTx.setCommitTxId(nextTxId);
    xaRm.commit(xid,true);
    LogEntry doneEntry=new LogEntry.Done(startEntry.getIdentifier());
    LogIoUtils.writeLogEntry(doneEntry,writeBuffer);
    xidIdentMap.remove(startEntry.getIdentifier());
    recoveredTxMap.remove(startEntry.getIdentifier());
    cacheTxStartPosition(nextTxId,startEntry);
  }
 catch (  XAException e) {
    e.printStackTrace();
    throw new IOException(e.getMessage());
  }
  scanIsComplete=true;
  msgLog.logMessage("String_Node_Str" + nextTxId);
}

Fixed version (ground truth):
public synchronized void applyTransactionWithoutTxId(ReadableByteChannel byteChannel,long nextTxId,int masterId) throws IOException {
  if (nextTxId != (xaTf.getLastCommittedTx() + 1)) {
    throw new IllegalStateException("String_Node_Str" + nextTxId + "String_Node_Str"+ (xaTf.getCurrentVersion() + 1));
  }
  log.fine("String_Node_Str" + logVersion + "String_Node_Str"+ nextTxId+ "String_Node_Str");
  long logEntriesFound=0;
  scanIsComplete=false;
  LogApplier logApplier=new LogApplier(byteChannel);
  int xidIdent=getNextIdentifier();
  long startEntryPosition=writeBuffer.getFileChannelPosition();
  while (logApplier.readAndWriteAndApplyEntry(xidIdent)) {
    logEntriesFound++;
  }
  byteChannel.close();
  LogEntry.Start startEntry=logApplier.startEntry;
  if (startEntry == null) {
    throw new IOException("String_Node_Str");
  }
  startEntry.setStartPosition(startEntryPosition);
  LogEntry.OnePhaseCommit commit=new LogEntry.OnePhaseCommit(xidIdent,nextTxId,masterId);
  LogIoUtils.writeLogEntry(commit,writeBuffer);
  Xid xid=startEntry.getXid();
  try {
    XaTransaction xaTx=xaRm.getXaTransaction(xid);
    xaTx.setCommitTxId(nextTxId);
    xaRm.commit(xid,true);
    LogEntry doneEntry=new LogEntry.Done(startEntry.getIdentifier());
    LogIoUtils.writeLogEntry(doneEntry,writeBuffer);
    xidIdentMap.remove(startEntry.getIdentifier());
    recoveredTxMap.remove(startEntry.getIdentifier());
    cacheTxStartPosition(nextTxId,startEntry);
  }
 catch (  XAException e) {
    e.printStackTrace();
    throw new IOException(e.getMessage());
  }
  scanIsComplete=true;
  msgLog.logMessage("String_Node_Str" + nextTxId);
}