Program: 155227
Project: 155227
Buggy source:
void init(XaDataSourceManager xaDsManager){
  this.xaDsManager=xaDsManager;
  txThreadMap=new ArrayMap<Thread,TransactionImpl>(5,true,true);
  String txLogDir=System.getProperty("String_Node_Str");
  if (txLogDir == null) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  String separator=System.getProperty("String_Node_Str");
  logSwitcherFileName=txLogDir + separator + "String_Node_Str";
  txLog1FileName=txLogDir + separator + "String_Node_Str";
  txLog2FileName=txLogDir + separator + "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);
      String currentTxLog=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(txLog1FileName).exists() || new File(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(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 xaDsManager){
  this.xaDsManager=xaDsManager;
  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);
      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);
  }
}