Program: 81602
Project: 81602
Buggy source:
public static Invokable matchInvokable(Invokable targetArguments,ArrayList<? extends Invokable> invokables) throws SalsaNotFoundException, VariableDeclarationException {
  Invokable match=null;
  int matches=0;
  int[] match_distance=new int[invokables.size()];
  int min_distance=Integer.MAX_VALUE;
  int i=0;
  for (  Invokable current : invokables) {
    if (current.isOverloadedByParent) {
      match_distance[i]=-1;
      continue;
    }
    match_distance[i]=targetArguments.matches(current);
    if (match_distance[i] >= 0 && match_distance[i] < min_distance) {
      matches=1;
      min_distance=match_distance[i];
      match=current;
    }
 else     if (match_distance[i] >= 0 && match_distance[i] == min_distance) {
      matches++;
    }
    i++;
  }
  if (matches > 1) {
    int min_match=match_distance[1];
    int min_match_position=1;
    int min_matches=0;
    for (i=1; i < match_distance.length; i++) {
      if (min_match >= 0 && min_match < match_distance[i]) {
        min_match_position=i;
        min_match=match_distance[i];
        min_matches=0;
      }
 else       if (min_match >= 0 && min_match == match_distance[i]) {
        min_matches++;
      }
    }
    if (min_matches > 1) {
      i=0;
      System.err.println("String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
      for (      Invokable current : invokables) {
        if (match_distance[i] == min_match) {
          System.err.println("String_Node_Str" + match_distance[i] + "String_Node_Str"+ current.getLongSignature());
        }
        i++;
      }
    }
 else {
      return match;
    }
  }
  if (match == null) {
    System.err.println("String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
    for (    TypeSymbol ts : targetArguments.parameterTypes) {
      System.err.println("String_Node_Str" + ts + "String_Node_Str"+ ts.superType);
    }
    System.err.println("String_Node_Str");
    i=0;
    for (    Invokable current : invokables) {
      if (!current.getName().equals(targetArguments.getName()))       continue;
      if (targetArguments.parameterTypes.length != current.parameterTypes.length)       continue;
      System.err.println("String_Node_Str" + current.getLongSignature());
    }
    throw new SalsaNotFoundException(targetArguments.getEnclosingType().getModule(),targetArguments.getEnclosingType().getName(),"String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
  }
  return match;
}

Fixed version (ground truth):
public static Invokable matchInvokable(Invokable targetArguments,ArrayList<? extends Invokable> invokables) throws SalsaNotFoundException, VariableDeclarationException {
  Invokable match=null;
  int matches=0;
  int[] match_distance=new int[invokables.size()];
  int min_distance=Integer.MAX_VALUE;
  int i=0;
  for (  Invokable current : invokables) {
    if (current.isOverloadedByParent) {
      match_distance[i]=-1;
      continue;
    }
    match_distance[i]=targetArguments.matches(current);
    if (match_distance[i] >= 0 && match_distance[i] < min_distance) {
      matches=1;
      min_distance=match_distance[i];
      match=current;
    }
 else     if (match_distance[i] >= 0 && match_distance[i] == min_distance) {
      matches++;
    }
    i++;
  }
  if (matches > 1) {
    int min_match=match_distance[1];
    int min_match_position=1;
    int min_matches=0;
    for (i=1; i < match_distance.length; i++) {
      if (min_match >= 0 && min_match < match_distance[i]) {
        min_match_position=i;
        min_match=match_distance[i];
        min_matches=0;
      }
 else       if (min_match >= 0 && min_match == match_distance[i]) {
        min_matches++;
      }
    }
    if (min_matches > 1) {
      i=0;
      System.err.println("String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
      for (      Invokable current : invokables) {
        if (match_distance[i] == min_match) {
          System.err.println("String_Node_Str" + match_distance[i] + "String_Node_Str"+ current.getLongSignature());
        }
        i++;
      }
    }
 else {
      return match;
    }
  }
  if (match == null) {
    System.err.println("String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
    for (    TypeSymbol ts : targetArguments.parameterTypes) {
      System.err.println("String_Node_Str" + ts + "String_Node_Str"+ ts.superType);
    }
    System.err.println("String_Node_Str");
    i=0;
    for (    Invokable current : invokables) {
      if (!current.getName().equals(targetArguments.getName()))       continue;
      if (targetArguments.parameterTypes.length != current.parameterTypes.length)       continue;
      System.err.println("String_Node_Str" + current.getLongSignature());
    }
    System.err.println("String_Node_Str");
    i=0;
    for (    Invokable current : invokables) {
      System.err.println("String_Node_Str" + current.getLongSignature());
    }
    throw new SalsaNotFoundException(targetArguments.getEnclosingType().getModule(),targetArguments.getEnclosingType().getName(),"String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
  }
  return match;
}