Program: 132298
Project: 132298
Buggy source:
/** 
 * Replays the database operations log.
 * @param from - LSN to replay the logs from.
 * @return the LSN to assign to the next operation
 * @throws BabuDBException
 */
private LSN replayLogs(LSN from) throws BabuDBException {
  try {
    File f=new File(configuration.getDbLogDir());
    File[] logFiles=f.listFiles(new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.endsWith("String_Node_Str");
      }
    }
);
    DiskLogIterator it=new DiskLogIterator(logFiles,from);
    LSN nextLSN=null;
    while (it.hasNext()) {
      LogEntry le=null;
      try {
        le=it.next();
        byte type=le.getPayloadType();
        Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str",le.getLSN().toString(),(int)type,le.getPayload().remaining());
        if (type == PAYLOAD_TYPE_TRANSACTION) {
          txnMan.replayTransaction(le);
        }
 else         if (type != PAYLOAD_TYPE_CREATE && type != PAYLOAD_TYPE_COPY && type != PAYLOAD_TYPE_DELETE) {
          InMemoryProcessing processingLogic=txnMan.getProcessingLogic().get(type);
          OperationInternal operation=processingLogic.convertToOperation(processingLogic.deserializeRequest(le.getPayload()));
          try {
            processingLogic.process(operation);
          }
 catch (          BabuDBException be) {
            if (!(type == PAYLOAD_TYPE_SNAP && be.getErrorCode() == ErrorCode.SNAP_EXISTS) && !(type == PAYLOAD_TYPE_SNAP_DELETE && be.getErrorCode() == ErrorCode.NO_SUCH_SNAPSHOT) && !(type == PAYLOAD_TYPE_INSERT && be.getErrorCode().equals(ErrorCode.NO_SUCH_DB))) {
              throw be;
            }
          }
        }
        nextLSN=new LSN(le.getViewId(),le.getLogSequenceNo() + 1L);
      }
  finally {
        if (le != null) {
          le.free();
        }
      }
    }
    it.destroy();
    if (nextLSN != null) {
      return nextLSN;
    }
 else {
      return new LSN(1,1);
    }
  }
 catch (  IOException ex) {
    throw new BabuDBException(ErrorCode.IO_ERROR,"String_Node_Str" + "String_Node_Str",ex);
  }
catch (  Exception ex) {
    Logging.logError(Logging.LEVEL_ERROR,this,ex);
    throw new BabuDBException(ErrorCode.IO_ERROR,"String_Node_Str" + "String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Replays the database operations log.
 * @param from - LSN to replay the logs from.
 * @return the LSN to assign to the next operation
 * @throws BabuDBException
 */
private LSN replayLogs(LSN from) throws BabuDBException {
  try {
    File f=new File(configuration.getDbLogDir());
    File[] logFiles=f.listFiles(new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.endsWith("String_Node_Str");
      }
    }
);
    DiskLogIterator it=new DiskLogIterator(logFiles,from);
    LSN nextLSN=null;
    while (it.hasNext()) {
      LogEntry le=null;
      try {
        le=it.next();
        byte type=le.getPayloadType();
        Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str",le.getLSN().toString(),(int)type,le.getPayload().remaining());
        if (type == PAYLOAD_TYPE_TRANSACTION) {
          txnMan.replayTransaction(le);
        }
 else         if (type != PAYLOAD_TYPE_CREATE && type != PAYLOAD_TYPE_COPY && type != PAYLOAD_TYPE_DELETE) {
          InMemoryProcessing processingLogic=txnMan.getProcessingLogic().get(type);
          OperationInternal operation=processingLogic.convertToOperation(processingLogic.deserializeRequest(le.getPayload()));
          try {
            processingLogic.process(operation);
          }
 catch (          BabuDBException be) {
            if (!(type == PAYLOAD_TYPE_SNAP && (be.getErrorCode() == ErrorCode.SNAP_EXISTS || be.getErrorCode() == ErrorCode.NO_SUCH_DB)) && !(type == PAYLOAD_TYPE_SNAP_DELETE && be.getErrorCode() == ErrorCode.NO_SUCH_SNAPSHOT) && !(type == PAYLOAD_TYPE_INSERT && be.getErrorCode().equals(ErrorCode.NO_SUCH_DB))) {
              throw be;
            }
          }
        }
        nextLSN=new LSN(le.getViewId(),le.getLogSequenceNo() + 1L);
      }
  finally {
        if (le != null) {
          le.free();
        }
      }
    }
    it.destroy();
    if (nextLSN != null) {
      return nextLSN;
    }
 else {
      return new LSN(1,1);
    }
  }
 catch (  IOException ex) {
    throw new BabuDBException(ErrorCode.IO_ERROR,"String_Node_Str" + "String_Node_Str",ex);
  }
catch (  Exception ex) {
    Logging.logError(Logging.LEVEL_ERROR,this,ex);
    throw new BabuDBException(ErrorCode.IO_ERROR,"String_Node_Str" + "String_Node_Str",ex);
  }
}