Program: 155173
Project: 155173
Buggy source:
void init(XaDataSourceManager xaDsManagerToUse){
  this.xaDsManager=xaDsManagerToUse;
  txThreadMap=new ArrayMap<Thread,TransactionImpl>(5,true,true);
  separator=System.getProperty("String_Node_Str");
  logSwitcherFileName=txLogDir + separator + "String_Node_Str";
  txLog1FileName="String_Node_Str";
  txLog2FileName="String_Node_Str";
  try {
    if (new File(logSwitcherFileName).exists()) {
      FileChannel fc=new RandomAccessFile(logSwitcherFileName,"String_Node_Str").getChannel();
      byte fileName[]=new byte[256];
      ByteBuffer buf=ByteBuffer.wrap(fileName);
      fc.read(buf);
      fc.close();
      String currentTxLog=txLogDir + separator + new String(fileName).trim();
      if (!new File(currentTxLog).exists()) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + currentTxLog + "String_Node_Str");
      }
      txLog=new TxLog(currentTxLog);
    }
 else {
      if (new File(txLogDir + separator + txLog1FileName).exists() || new File(txLogDir + separator + txLog2FileName).exists()) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + txLog1FileName + "String_Node_Str"+ txLog2FileName+ "String_Node_Str"+ "String_Node_Str");
      }
      ByteBuffer buf=ByteBuffer.wrap(txLog1FileName.getBytes("String_Node_Str"));
      FileChannel fc=new RandomAccessFile(logSwitcherFileName,"String_Node_Str").getChannel();
      fc.write(buf);
      txLog=new TxLog(txLogDir + separator + txLog1FileName);
      fc.force(true);
      fc.close();
    }
    Iterator<List<TxLog.Record>> danglingRecordList=txLog.getDanglingRecords();
    if (danglingRecordList.hasNext()) {
      log.warning("String_Node_Str" + "String_Node_Str");
      recover(danglingRecordList);
    }
    getTxLog().truncate();
    tmOk=true;
  }
 catch (  IOException e) {
    e.printStackTrace();
    log.severe("String_Node_Str");
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
void init(XaDataSourceManager xaDsManagerToUse){
  this.xaDsManager=xaDsManagerToUse;
  txThreadMap=new ArrayMap<Thread,TransactionImpl>(5,true,true);
  separator=System.getProperty("String_Node_Str");
  logSwitcherFileName=txLogDir + separator + "String_Node_Str";
  txLog1FileName="String_Node_Str";
  txLog2FileName="String_Node_Str";
  try {
    if (new File(logSwitcherFileName).exists()) {
      FileChannel fc=new RandomAccessFile(logSwitcherFileName,"String_Node_Str").getChannel();
      byte fileName[]=new byte[256];
      ByteBuffer buf=ByteBuffer.wrap(fileName);
      fc.read(buf);
      fc.close();
      String currentTxLog=txLogDir + separator + new String(fileName).trim();
      if (!new File(currentTxLog).exists()) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + currentTxLog + "String_Node_Str");
      }
      txLog=new TxLog(currentTxLog);
    }
 else {
      if (new File(txLogDir + separator + txLog1FileName).exists() || new File(txLogDir + separator + txLog2FileName).exists()) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + txLog1FileName + "String_Node_Str"+ txLog2FileName+ "String_Node_Str"+ "String_Node_Str");
      }
      ByteBuffer buf=ByteBuffer.wrap(txLog1FileName.getBytes("String_Node_Str"));
      FileChannel fc=new RandomAccessFile(logSwitcherFileName,"String_Node_Str").getChannel();
      fc.write(buf);
      txLog=new TxLog(txLogDir + separator + txLog1FileName);
      fc.force(true);
      fc.close();
    }
    Iterator<List<TxLog.Record>> danglingRecordList=txLog.getDanglingRecords();
    if (danglingRecordList.hasNext()) {
      log.info("String_Node_Str" + "String_Node_Str");
      recover(danglingRecordList);
      log.info("String_Node_Str" + "String_Node_Str");
    }
    getTxLog().truncate();
    tmOk=true;
  }
 catch (  IOException e) {
    e.printStackTrace();
    log.severe("String_Node_Str");
    throw new RuntimeException(e);
  }
}