Program: 168751
Project: 168751
Buggy source:
@Override protected void populateResult(boolean usesViewRoot,Map<Object,Map<Object,TuplePromise>> correlationValues,List<Object[]> list){
  Map<Object,Map<Object,Collection<Object>>> collections;
  if (usesViewRoot) {
    collections=new HashMap<>(list.size());
    for (int i=0; i < list.size(); i++) {
      Object[] element=list.get(i);
      Map<Object,Collection<Object>> viewRootResult=collections.get(element[0]);
      if (viewRootResult == null) {
        viewRootResult=new HashMap<>();
        collections.put(element[0],viewRootResult);
      }
      Collection<Object> result=viewRootResult.get(element[1]);
      if (result == null) {
        result=(Collection<Object>)createDefaultResult();
        viewRootResult.put(element[1],result);
      }
      if (element[2] != null) {
        result.add(element[2]);
      }
    }
  }
 else {
    Map<Object,Collection<Object>> viewRootResult=new HashMap<>(list.size());
    collections=Collections.singletonMap(null,viewRootResult);
    for (int i=0; i < list.size(); i++) {
      Object[] element=(Object[])list.get(i);
      Collection<Object> result=viewRootResult.get(element[0]);
      if (result == null) {
        result=(Collection<Object>)createDefaultResult();
        viewRootResult.put(element[0],result);
      }
      if (element[1] != null) {
        result.add(element[1]);
      }
    }
  }
  for (  Map.Entry<Object,Map<Object,Collection<Object>>> entry : collections.entrySet()) {
    Map<Object,TuplePromise> tuplePromiseMap=correlationValues.get(entry.getKey());
    for (    Map.Entry<Object,Collection<Object>> correlationEntry : entry.getValue().entrySet()) {
      tuplePromiseMap.get(correlationEntry.getKey()).onResult(correlationEntry.getValue(),this);
    }
  }
}

Fixed version (ground truth):
@Override protected void populateResult(boolean usesViewRoot,Map<Object,Map<Object,TuplePromise>> correlationValues,List<Object[]> list){
  Map<Object,Map<Object,Collection<Object>>> collections;
  if (usesViewRoot) {
    collections=new HashMap<>(list.size());
    for (int i=0; i < list.size(); i++) {
      Object[] element=list.get(i);
      Map<Object,Collection<Object>> viewRootResult=collections.get(element[0]);
      if (viewRootResult == null) {
        viewRootResult=new HashMap<>();
        collections.put(element[0],viewRootResult);
      }
      Collection<Object> result=viewRootResult.get(element[1]);
      if (result == null) {
        result=(Collection<Object>)createDefaultResult();
        viewRootResult.put(element[1],result);
      }
      if (element[2] != null) {
        add(result,element[2]);
      }
    }
  }
 else {
    Map<Object,Collection<Object>> viewRootResult=new HashMap<>(list.size());
    collections=Collections.singletonMap(null,viewRootResult);
    for (int i=0; i < list.size(); i++) {
      Object[] element=(Object[])list.get(i);
      Collection<Object> result=viewRootResult.get(element[0]);
      if (result == null) {
        result=(Collection<Object>)createDefaultResult();
        viewRootResult.put(element[0],result);
      }
      if (element[1] != null) {
        add(result,element[1]);
      }
    }
  }
  for (  Map.Entry<Object,Map<Object,Collection<Object>>> entry : collections.entrySet()) {
    Map<Object,TuplePromise> tuplePromiseMap=correlationValues.get(entry.getKey());
    for (    Map.Entry<Object,Collection<Object>> correlationEntry : entry.getValue().entrySet()) {
      tuplePromiseMap.get(correlationEntry.getKey()).onResult(correlationEntry.getValue(),this);
    }
  }
}