Program: 132347
Project: 132347
Buggy source:
private void createCheckpoint() throws BabuDBException, InterruptedException {
  Collection<Database> databases=((DatabaseManagerImpl)dbs.getDatabaseManager()).getDatabaseList();
synchronized (checkpointLock) {
    try {
      int[][] snapIds=new int[databases.size()][];
      int i=0;
      LSN lastWrittenLSN=null;
      try {
        logger.lockLogger();
        for (        Database db : databases) {
          snapIds[i++]=((DatabaseImpl)db).proceedCreateSnapshot();
        }
        lastWrittenLSN=logger.switchLogFile(incrementViewId);
      }
  finally {
        logger.unlockLogger();
      }
      i=0;
      for (      Database db : databases) {
        ((DatabaseImpl)db).proceedWriteSnapshot(lastWrittenLSN.getViewId(),lastWrittenLSN.getSequenceNo(),snapIds[i++]);
        ((DatabaseImpl)db).proceedCleanupSnapshot(lastWrittenLSN.getViewId(),lastWrittenLSN.getSequenceNo());
      }
      File f=new File(dbs.getConfig().getDbLogDir());
      String[] logs=f.list(new FilenameFilter(){
        public boolean accept(        File dir,        String name){
          return name.endsWith("String_Node_Str");
        }
      }
);
      if (logs != null) {
        Pattern p=Pattern.compile("String_Node_Str");
        for (        String log : logs) {
          Matcher m=p.matcher(log);
          m.matches();
          String tmp=m.group(1);
          int viewId=Integer.valueOf(tmp);
          tmp=m.group(2);
          int seqNo=Integer.valueOf(tmp);
          LSN logLSN=new LSN(viewId,seqNo);
          if (logLSN.compareTo(lastWrittenLSN) <= 0) {
            Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + log);
            f=new File(dbs.getConfig().getDbLogDir() + log);
            f.delete();
          }
        }
      }
    }
 catch (    IOException ex) {
      throw new BabuDBException(ErrorCode.IO_ERROR,"String_Node_Str",ex);
    }
  }
}

Fixed version (ground truth):
private void createCheckpoint() throws BabuDBException, InterruptedException {
  Collection<Database> databases=((DatabaseManagerImpl)dbs.getDatabaseManager()).getDatabaseList();
synchronized (checkpointLock) {
    try {
      int[][] snapIds=new int[databases.size()][];
      int i=0;
      LSN lastWrittenLSN=null;
      try {
        logger.lockLogger();
        for (        Database db : databases) {
          snapIds[i++]=((DatabaseImpl)db).proceedCreateSnapshot();
        }
        lastWrittenLSN=logger.switchLogFile(incrementViewId);
        incrementViewId=false;
      }
  finally {
        logger.unlockLogger();
      }
      i=0;
      for (      Database db : databases) {
        ((DatabaseImpl)db).proceedWriteSnapshot(lastWrittenLSN.getViewId(),lastWrittenLSN.getSequenceNo(),snapIds[i++]);
        ((DatabaseImpl)db).proceedCleanupSnapshot(lastWrittenLSN.getViewId(),lastWrittenLSN.getSequenceNo());
      }
      File f=new File(dbs.getConfig().getDbLogDir());
      String[] logs=f.list(new FilenameFilter(){
        public boolean accept(        File dir,        String name){
          return name.endsWith("String_Node_Str");
        }
      }
);
      if (logs != null) {
        Pattern p=Pattern.compile("String_Node_Str");
        for (        String log : logs) {
          Matcher m=p.matcher(log);
          m.matches();
          String tmp=m.group(1);
          int viewId=Integer.valueOf(tmp);
          tmp=m.group(2);
          int seqNo=Integer.valueOf(tmp);
          LSN logLSN=new LSN(viewId,seqNo);
          if (logLSN.compareTo(lastWrittenLSN) <= 0) {
            Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + log);
            f=new File(dbs.getConfig().getDbLogDir() + log);
            f.delete();
          }
        }
      }
    }
 catch (    IOException ex) {
      throw new BabuDBException(ErrorCode.IO_ERROR,"String_Node_Str",ex);
    }
  }
}