Program: 62237
Project: 62237
Buggy source:
/** 
 * Search for nodeTypes given some filters. Apply AND filter strategy when multiple values for a filter key.
 */
public List<SuggestionsTask> searchForNodeTypes(Map<String,Map<String,Set<String>>> nodeTemplatesToFilters,Map<String,NodeType> toExcludeIndexedNodeTypes) throws IOException {
  if (nodeTemplatesToFilters == null || nodeTemplatesToFilters.isEmpty()) {
    return null;
  }
  List<SuggestionsTask> toReturnTasks=Lists.newArrayList();
  for (  Map.Entry<String,Map<String,Set<String>>> nodeTemplatesToFiltersEntry : nodeTemplatesToFilters.entrySet()) {
    Map<String,String[]> formattedFilters=Maps.newHashMap();
    Map<String,FilterValuesStrategy> filterValueStrategy=Maps.newHashMap();
    NodeType[] data=null;
    if (nodeTemplatesToFiltersEntry.getValue() != null) {
      for (      Map.Entry<String,Set<String>> filterEntry : nodeTemplatesToFiltersEntry.getValue().entrySet()) {
        formattedFilters.put(filterEntry.getKey(),filterEntry.getValue().toArray(new String[filterEntry.getValue().size()]));
        filterValueStrategy.put(filterEntry.getKey(),FilterValuesStrategy.AND);
      }
      formattedFilters.put("String_Node_Str",ArrayUtils.toArray("String_Node_Str"));
      GetMultipleDataResult<NodeType> searchResult=alienDAO.search(NodeType.class,null,formattedFilters,filterValueStrategy,20);
      data=getIndexedNodeTypesFromSearchResponse(searchResult,toExcludeIndexedNodeTypes.get(nodeTemplatesToFiltersEntry.getKey()));
    }
    TaskCode taskCode=data == null || data.length < 1 ? TaskCode.IMPLEMENT : TaskCode.REPLACE;
    SuggestionsTask task=new SuggestionsTask();
    task.setNodeTemplateName(nodeTemplatesToFiltersEntry.getKey());
    task.setComponent(toExcludeIndexedNodeTypes.get(nodeTemplatesToFiltersEntry.getKey()));
    task.setCode(taskCode);
    task.setSuggestedNodeTypes(data);
    toReturnTasks.add(task);
  }
  return toReturnTasks;
}

Fixed version (ground truth):
/** 
 * Search for nodeTypes given some filters. Apply AND filter strategy when multiple values for a filter key.
 */
public List<SuggestionsTask> searchForNodeTypes(String workspace,Map<String,Map<String,Set<String>>> nodeTemplatesToFilters,Map<String,NodeType> toExcludeIndexedNodeTypes) throws IOException {
  if (nodeTemplatesToFilters == null || nodeTemplatesToFilters.isEmpty()) {
    return null;
  }
  List<SuggestionsTask> toReturnTasks=Lists.newArrayList();
  for (  Map.Entry<String,Map<String,Set<String>>> nodeTemplatesToFiltersEntry : nodeTemplatesToFilters.entrySet()) {
    Map<String,String[]> formattedFilters=Maps.newHashMap();
    Map<String,FilterValuesStrategy> filterValueStrategy=Maps.newHashMap();
    NodeType[] data=null;
    if (nodeTemplatesToFiltersEntry.getValue() != null) {
      for (      Map.Entry<String,Set<String>> filterEntry : nodeTemplatesToFiltersEntry.getValue().entrySet()) {
        formattedFilters.put(filterEntry.getKey(),filterEntry.getValue().toArray(new String[filterEntry.getValue().size()]));
        filterValueStrategy.put(filterEntry.getKey(),FilterValuesStrategy.AND);
      }
      formattedFilters.put("String_Node_Str",ArrayUtils.toArray("String_Node_Str"));
      formattedFilters.put("String_Node_Str",ArrayUtils.toArray(workspace,"String_Node_Str"));
      GetMultipleDataResult<NodeType> searchResult=alienDAO.search(NodeType.class,null,formattedFilters,filterValueStrategy,20);
      data=getIndexedNodeTypesFromSearchResponse(searchResult,toExcludeIndexedNodeTypes.get(nodeTemplatesToFiltersEntry.getKey()));
    }
    TaskCode taskCode=data == null || data.length < 1 ? TaskCode.IMPLEMENT : TaskCode.REPLACE;
    SuggestionsTask task=new SuggestionsTask();
    task.setNodeTemplateName(nodeTemplatesToFiltersEntry.getKey());
    task.setComponent(toExcludeIndexedNodeTypes.get(nodeTemplatesToFiltersEntry.getKey()));
    task.setCode(taskCode);
    task.setSuggestedNodeTypes(data);
    toReturnTasks.add(task);
  }
  return toReturnTasks;
}