Program: 168121
Project: 168121
Buggy source:
private List<String> applySmartFilters(List<Filter> filters,String jsonFilePath,String operator,String keyFields) throws FileNotFoundException, IOException, ParseException {
  HashMap<String,List<String>> keys=processKeyfields(keyFields);
  List<String> resultText=new ArrayList<String>();
  Set<JSONObject> filteredResults=new HashSet<JSONObject>();
  HashMap<String,List<Filter>> groupedFilters=groupFilters(filters);
  JSONParser parser=new JSONParser();
  Object obj=parser.parse(new FileReader(jsonFilePath));
  JSONObject jsonObject=(JSONObject)obj;
  Object document=Configuration.defaultConfiguration().jsonProvider().parse(jsonObject.toJSONString());
  for (  String parentFilters : groupedFilters.keySet()) {
    try {
      String smartQuery;
      smartQuery=createSmartFilters(parentFilters,groupedFilters,operator);
      System.out.println(parentFilters + "String_Node_Str" + smartQuery);
      Object result=JsonPath.parse(document).read(smartQuery);
      if (result instanceof LinkedHashMap<?,?>) {
        LinkedHashMap<?,?> records=(LinkedHashMap<?,?>)result;
        JSONObject temp=new JSONObject();
        temp.put(parentFilters,records);
        filteredResults.add(temp);
        if (keys.containsKey(parentFilters)) {
          for (          String k : keys.get(parentFilters))           resultText.add((String)((LinkedHashMap)result).get(k));
        }
      }
 else       if (result instanceof JSONArray) {
        JSONArray records=(JSONArray)result;
        for (        Object ob : records) {
          LinkedHashMap<?,?> res=(LinkedHashMap<?,?>)ob;
          if (keys.containsKey(parentFilters)) {
            for (            String k : keys.get(parentFilters))             resultText.add((String)((LinkedHashMap)res).get(k));
          }
        }
      }
    }
 catch (    ClassCastException e) {
      continue;
    }
  }
  return resultText;
}

Fixed version (ground truth):
private List<String> applySmartFilters(List<Filter> filters,String jsonFilePath,String operator,String keyFields,CMDataType corpusType) throws FileNotFoundException, IOException, ParseException {
  HashMap<String,List<String>> keys=processKeyfields(keyFields);
  List<String> resultText=new ArrayList<String>();
  Set<JSONObject> filteredResults=new HashSet<JSONObject>();
  HashMap<String,List<Filter>> groupedFilters=groupFilters(filters);
  JSONParser parser=new JSONParser();
  Object obj=parser.parse(new FileReader(jsonFilePath));
  JSONObject jsonObject=(JSONObject)obj;
  Object document=Configuration.defaultConfiguration().jsonProvider().parse(jsonObject.toJSONString());
  for (  String parentFilters : groupedFilters.keySet()) {
    try {
      String smartQuery;
      smartQuery=createSmartFilters(parentFilters,groupedFilters,operator);
      System.out.println(parentFilters + "String_Node_Str" + smartQuery);
      Object result=JsonPath.parse(document).read(smartQuery);
      if (result instanceof LinkedHashMap<?,?>) {
        LinkedHashMap<?,?> records=(LinkedHashMap<?,?>)result;
        JSONObject temp=new JSONObject();
        temp.put(parentFilters,records);
        filteredResults.add(temp);
        if (keys.containsKey(parentFilters)) {
          for (          String k : keys.get(parentFilters))           resultText.add((String)((LinkedHashMap)result).get(k));
        }
      }
 else       if (result instanceof JSONArray) {
        JSONArray records=(JSONArray)result;
        for (        Object ob : records) {
          LinkedHashMap<?,?> res=(LinkedHashMap<?,?>)ob;
          if (keys.containsKey(parentFilters)) {
            for (            String k : keys.get(parentFilters))             resultText.add((String)((LinkedHashMap)res).get(k));
          }
        }
      }
    }
 catch (    ClassCastException e) {
      continue;
    }
  }
  if (!corpusType.equals(CMDataType.TWITTER_JSON))   return processedResult(resultText);
  return resultText;
}