<commit_before>package edu.nyu.cs.javagit.utilities;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * This class provides utilities methods that perform various checks for validity.
 */
public class CheckUtilities {

  /**
   * Checks that the specified filename exists. This assumes that the above check for string
   * validity has already been run and the path/filename is neither null or of size 0.
   * 
   * @param filename
   *          File or directory path
   */
  public static void checkFileValidity(String filename) throws IOException {
    File file = new File(filename);
    if (!file.exists()) {
      throw new IOException(ExceptionMessageMap.getMessage("020001") + "  { filename=[" + filename
          + "] }");
    }
  }

  /**
   * Checks that the int to check is greater than <code>lowerBound</code>. If the int to check is
   * not greater than <code>lowerBound</code>, an <code>IllegalArgumentException</code> is
   * thrown.
   * 
   * @param toCheck
   *          The int to check.
   * @param lowerBound
   *          The lower bound to check against.
   * @param variableName
   *          The name of the variable being checked; for use in exception messages.
   */
  public static void checkIntArgumentGreaterThan(int toCheck, int lowerBound, String variableName) {
    if (lowerBound >= toCheck) {
      throw new IllegalArgumentException(ExceptionMessageMap.getMessage("000004") + "  { toCheck=["
          + toCheck + "], lowerBound=[" + lowerBound + "], variableName=[" + variableName + "] }");
    }
  }<commit_msg>fixing errors for rev. 392<commit_after>package edu.nyu.cs.javagit.utilities;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * This class provides utilities methods that perform various checks for validity.
 */
public class CheckUtilities {

  /**
   * Checks that the specified filename exists. This assumes that the above check for string
   * validity has already been run and the path/filename is neither null or of size 0.
   * 
   * @param filename
   *          File or directory path
   */
  public static void checkFileValidity(String filename) throws IOException {
    File file = new File(filename);
    if (!file.exists()) {
      throw new IOException(ExceptionMessageMap.getMessage("020001") + "  { filename=[" + filename
          + "] }");
    }
  }

  /**
   * Checks that the specified file exists.
   * 
   * @param file
   *          File or directory path
   */
  public static void checkFileValidity( File file ) throws IOException {
    if ( !file.exists() ) {
      throw new IOException(ExceptionMessageMap.getMessage("020001") + "  { filename=[" + file.getName()
          + "] }");
    }
  }

  /**
   * Checks that the int to check is greater than <code>lowerBound</code>. If the int to check is
   * not greater than <code>lowerBound</code>, an <code>IllegalArgumentException</code> is
   * thrown.
   * 
   * @param toCheck
   *          The int to check.
   * @param lowerBound
   *          The lower bound to check against.
   * @param variableName
   *          The name of the variable being checked; for use in exception messages.
   */
  public static void checkIntArgumentGreaterThan(int toCheck, int lowerBound, String variableName) {
    if (lowerBound >= toCheck) {
      throw new IllegalArgumentException(ExceptionMessageMap.getMessage("000004") + "  { toCheck=["
          + toCheck + "], lowerBound=[" + lowerBound + "], variableName=[" + variableName + "] }");
    }
  }
{'fraction_non_alphanumeric': 0.1056657223796034, 'fraction_numerical': 0.009915014164305949, 'mean_word_length': 2.9233333333333333, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '140139', 'n_tokens_mistral': 1011, 'n_tokens_neox': 973, 'n_words': 327}