Program: 132836
Project: 132836
Buggy source:
/** 
 * @param context
 * @param tree
 * @param expectedResult
 * @param outType if not null, only return operators with this output type
 * @param outArgTypes Put the argument types of the operator in this list if not null
 * @param expectUnambig at this stage, expect operator not to be ambiguous - logdebug message if it is
 * @return at least one builtin operator  
 * @throws TypeMismatchException if no matches possible
 */
private static List<Op> getOpsFromTree(Context context,SwiftAST tree,Type outType,List<Type> outArgTypes,boolean expectUnambig) throws UserException {
  assert(tree.getType() == ExMParser.OPERATOR);
  assert(tree.getChildCount() >= 1);
  int opTok=tree.child(0).getType();
  String opName=extractOpName(tree);
  List<Type> argTypes=findOperatorArgTypes(context,tree,opName);
  if (outArgTypes != null) {
    outArgTypes.clear();
    outArgTypes.addAll(argTypes);
  }
  List<Op> matched=new ArrayList<Op>();
  for (  Op candidate : Operators.getOps(opTok)) {
    OpType opType=candidate.type;
    if (opOutputMatches(outType,opType) && opInputsMatch(argTypes,opType)) {
      matched.add(candidate);
    }
  }
  if (matched.size() > 1) {
    List<String> typeNames=new ArrayList<String>();
    for (    Type argType : argTypes) {
      typeNames.add(argType.typeName());
    }
    if (matched.size() == 0) {
      String msg="String_Node_Str" + opName + "String_Node_Str"+ "String_Node_Str"+ typeNames.toString();
      if (outType != null) {
        msg+="String_Node_Str" + outType;
      }
      throw new UndefinedOperatorException(context,msg);
    }
 else     if (expectUnambig) {
      assert(matched.size() > 1);
      Logging.getSTCLogger().debug("String_Node_Str" + opName + "String_Node_Str"+ typeNames+ "String_Node_Str"+ matched.toString());
    }
  }
  return matched;
}

Fixed version (ground truth):
/** 
 * @param context
 * @param tree
 * @param expectedResult
 * @param outType if not null, only return operators with this output type
 * @param outArgTypes Put the argument types of the operator in this list if not null
 * @param expectUnambig at this stage, expect operator not to be ambiguous - logdebug message if it is
 * @return at least one builtin operator  
 * @throws TypeMismatchException if no matches possible
 */
private static List<Op> getOpsFromTree(Context context,SwiftAST tree,Type outType,List<Type> outArgTypes,boolean expectUnambig) throws UserException {
  assert(tree.getType() == ExMParser.OPERATOR);
  assert(tree.getChildCount() >= 1);
  int opTok=tree.child(0).getType();
  String opName=extractOpName(tree);
  List<Type> argTypes=findOperatorArgTypes(context,tree,opName);
  if (outArgTypes != null) {
    outArgTypes.clear();
    outArgTypes.addAll(argTypes);
  }
  List<Op> matched=new ArrayList<Op>();
  for (  Op candidate : Operators.getOps(opTok)) {
    OpType opType=candidate.type;
    if (opOutputMatches(outType,opType) && opInputsMatch(argTypes,opType)) {
      matched.add(candidate);
    }
  }
  if (matched.size() != 1) {
    List<String> typeNames=new ArrayList<String>();
    for (    Type argType : argTypes) {
      typeNames.add(argType.typeName());
    }
    if (matched.size() == 0) {
      String msg="String_Node_Str" + opName + "String_Node_Str"+ "String_Node_Str"+ typeNames.toString();
      if (outType != null) {
        msg+="String_Node_Str" + outType;
      }
      throw new UndefinedOperatorException(context,msg);
    }
 else     if (expectUnambig) {
      assert(matched.size() > 1);
      Logging.getSTCLogger().debug("String_Node_Str" + opName + "String_Node_Str"+ typeNames+ "String_Node_Str"+ matched.toString());
    }
  }
  return matched;
}