Program: 19671
Project: 19671
Buggy source:
@Override public void onSimulationComplete(){
  data.add("String_Node_Str");
  data.add("String_Node_Str");
  data.add("String_Node_Str");
  data.add("String_Node_Str");
  SortedSet<String> active_agent_ids=sim.getactiveParticipantIdSet("String_Node_Str");
  Iterator<String> iter=active_agent_ids.iterator();
  PublicEnvironmentConnection ec=PublicEnvironmentConnection.getInstance();
  while (iter.hasNext()) {
    String groupID=iter.next();
    PublicGroupDataModel dm=ec.getGroupById(groupID);
    Map<String,List<Tuple<Double,Double>>> loansGiven=LoansGroup.getLoansGiven(dm);
    double totalAmountGiven=0;
    if (loansGiven != null) {
      for (      String debtors : loansGiven.keySet()) {
        if (ec.getGroupById(debtors) == null)         break;
        double amountBorrowed=0;
        for (        Tuple<Double,Double> t : loansGiven.get(debtors)) {
          amountBorrowed+=t.getKey() * (1 + t.getValue());
        }
        totalAmountGiven+=amountBorrowed;
      }
    }
    Map<String,List<Tuple<Double,Double>>> loansTaken=LoansGroup.getLoansTaken(dm);
    double totalAmountTaken=0;
    if (loansTaken != null) {
      for (      String creditors : loansTaken.keySet()) {
        if (ec.getGroupById(creditors) == null)         break;
        double amountBorrowed=0;
        for (        Tuple<Double,Double> t : loansTaken.get(creditors)) {
          amountBorrowed+=t.getKey() * (1 + t.getValue());
        }
        totalAmountTaken+=amountBorrowed;
      }
    }
    String spaces="String_Node_Str";
    data.add(dm.getName() + spaces + Math.round(dm.getCurrentReservedFood())+ spaces+ Math.round(totalAmountGiven)+ spaces+ Math.round(totalAmountTaken)+ spaces+ LoansGroup.getGreediness(dm));
  }
}

Fixed version (ground truth):
@Override public void onSimulationComplete(){
  data.add("String_Node_Str");
  data.add("String_Node_Str");
  data.add("String_Node_Str");
  data.add("String_Node_Str");
  SortedSet<String> active_agent_ids=sim.getactiveParticipantIdSet("String_Node_Str");
  Iterator<String> iter=active_agent_ids.iterator();
  PublicEnvironmentConnection ec=PublicEnvironmentConnection.getInstance();
  while (iter.hasNext()) {
    String groupID=iter.next();
    PublicGroupDataModel dm=ec.getGroupById(groupID);
    Map<String,List<Tuple<Double,Double>>> loansGiven=LoansGroup.getLoansGiven(dm);
    double totalAmountGiven=0;
    if (loansGiven != null) {
      for (      String debtors : loansGiven.keySet()) {
        if (ec.getGroupById(debtors) == null)         break;
        double amountBorrowed=0;
        for (        Tuple<Double,Double> t : loansGiven.get(debtors)) {
          amountBorrowed+=t.getKey() * (1 + t.getValue());
        }
        totalAmountGiven+=amountBorrowed;
      }
    }
    Map<String,List<Tuple<Double,Double>>> loansTaken=LoansGroup.getLoansTaken(dm);
    double totalAmountTaken=0;
    if (loansTaken != null) {
      for (      String creditors : loansTaken.keySet()) {
        if (ec.getGroupById(creditors) == null)         break;
        double amountBorrowed=0;
        for (        Tuple<Double,Double> t : loansTaken.get(creditors)) {
          amountBorrowed+=t.getKey() * (1 + t.getValue());
        }
        totalAmountTaken+=amountBorrowed;
      }
    }
    double averageHappiness=0;
    for (    String member : dm.getMemberList()) {
      averageHappiness+=ec.getAgentById(member).getCurrentHappiness();
    }
    averageHappiness=averageHappiness / dm.getMemberList().size();
    String spaces="String_Node_Str";
    data.add(dm.getName() + spaces + Math.round(dm.getCurrentReservedFood())+ spaces+ Math.round(totalAmountGiven)+ spaces+ Math.round(totalAmountTaken)+ spaces+ averageHappiness+ spaces+ LoansGroup.getGreediness(dm));
  }
}