<commit_before>package mclint.patterns;

import ast.ASTNode;
import ast.FPLiteralExpr;
import ast.IntLiteralExpr;
import ast.List;
import ast.Name;
import ast.StringLiteralExpr;

public class EqualityChecker {
  
  public static boolean equals(ASTNode left, ASTNode right) {
    if (left instanceof List && !(right instanceof List)) {
      return left.getNumChild() == 1 && equals(left.getChild(0), right);
    }
    if (right instanceof List && !(left instanceof List)) {
      return right.getNumChild() == 1 && equals(left, right.getChild(0));
    }
    if (!left.getClass().equals(right.getClass())) {
      return false;
    }
    if (left.getNumChild() != right.getNumChild()) {
      return false;
    }
    for (int i = 0; i < left.getNumChild(); ++i) {
      if (!equals(left.getChild(i), right.getChild(i))) {
        return false;
      }
      return true;
    }
    if (left instanceof Name) {
      return ((Name) left).getID().equals(((Name) right).getID());
    }
    if (left instanceof StringLiteralExpr) {
      return ((StringLiteralExpr) left).getValue().equals(((StringLiteralExpr) right).getValue());
    }
    if (left instanceof IntLiteralExpr) {
      return ((IntLiteralExpr) left).getValue().getValue().equals(
          ((IntLiteralExpr) right).getValue().getValue());
    }
    if (left instanceof FPLiteralExpr) {
      return ((FPLiteralExpr) left).getValue().getValue().equals(<commit_msg>EqualityChecker fix<commit_after>package mclint.patterns;

import ast.ASTNode;
import ast.FPLiteralExpr;
import ast.IntLiteralExpr;
import ast.List;
import ast.Name;
import ast.StringLiteralExpr;

public class EqualityChecker {
  
  public static boolean equals(ASTNode left, ASTNode right) {
    if (left instanceof List && !(right instanceof List)) {
      return left.getNumChild() == 1 && equals(left.getChild(0), right);
    }
    if (right instanceof List && !(left instanceof List)) {
      return right.getNumChild() == 1 && equals(left, right.getChild(0));
    }
    if (!left.getClass().equals(right.getClass())) {
      return false;
    }
    if (left.getNumChild() != right.getNumChild()) {
      return false;
    }
    if (left.getNumChild() > 0) {
      for (int i = 0; i < left.getNumChild(); ++i) {
        if (!equals(left.getChild(i), right.getChild(i))) {
          return false;
        }
      }
      return true;
    }
    if (left instanceof Name) {
      return ((Name) left).getID().equals(((Name) right).getID());
    }
    if (left instanceof StringLiteralExpr) {
      return ((StringLiteralExpr) left).getValue().equals(((StringLiteralExpr) right).getValue());
    }
    if (left instanceof IntLiteralExpr) {
      return ((IntLiteralExpr) left).getValue().getValue().equals(
          ((IntLiteralExpr) right).getValue().getValue());
    }
    if (left instanceof FPLiteralExpr) {
      return ((FPLiteralExpr) left).getValue().getValue().equals(
{'fraction_non_alphanumeric': 0.14886285320468642, 'fraction_numerical': 0.003790489317711923, 'mean_word_length': 3.3007407407407405, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '528508', 'n_tokens_mistral': 858, 'n_tokens_neox': 864, 'n_words': 209}