Program: 29274
Project: 29274
Buggy source:
private void setClusterInfo(ActionReport aggregateReporter,List<String> list){
  List<HashMap> data=new ArrayList<HashMap>(targets.size());
  int i;
  for (i=0; i < targets.size(); i++) {
    data.add(new HashMap<String,String>());
  }
  HashMap<String,String> clusterInfo=new HashMap<String,String>();
  int instanceCount=0;
  for (  Server server : targets) {
    String instanceName=server.getName();
    Map<String,String> instanceMap=data.get(instanceCount);
    String key=null;
    for (    String str : list) {
      if (str.contains(instanceName) && str.contains("String_Node_Str")) {
        ArrayList<String> kv=getKeyValuePair(str,instanceName);
        key=(String)kv.get(0);
        instanceMap.put((String)kv.get(0),kv.get(1));
      }
      if (key != null) {
        String desc=key.substring(0,key.indexOf("String_Node_Str")) + "String_Node_Str";
        if (str.contains(desc)) {
          ArrayList<String> kv=getKeyValuePair(str,instanceName);
          clusterInfo.put((String)kv.get(0),kv.get(1));
        }
        String lastSampleTime=key.substring(0,key.indexOf("String_Node_Str")) + "String_Node_Str";
        if (str.contains(lastSampleTime)) {
          ArrayList<String> kv=getKeyValuePair(str,instanceName);
          clusterInfo.put(instanceName + "String_Node_Str" + (String)kv.get(0),kv.get(1));
          key=null;
        }
      }
    }
    instanceCount++;
  }
  List<Server> allServers=targetService.getAllInstances();
  String instanceListStr="String_Node_Str";
  i=0;
  for (  Server server : allServers) {
    if (server.isRunning()) {
      if (i == 0)       instanceListStr=server.getName();
 else       instanceListStr=instanceListStr + "String_Node_Str" + server.getName();
      i++;
    }
  }
  aggregateReporter.appendMessage("String_Node_Str" + i + "String_Node_Str"+ instanceListStr+ "String_Node_Str"+ targetName+ "String_Node_Str");
  boolean noData=true;
  HashMap<String,String> h=data.get(0);
  Iterator it=h.keySet().iterator();
  while (it.hasNext()) {
    int total=0, max=0, min=0, index=0;
    float avg=0;
    int[] values=new int[data.size()];
    boolean flag=false;
    String s=(String)it.next();
    for (    HashMap hm : data) {
      String tmp=(String)hm.get(s);
      if (tmp == null) {
        flag=true;
        break;
      }
      if (tmp != null) {
        int count=Integer.parseInt(tmp);
        values[index++]=count;
        total=total + count;
      }
    }
    if (!flag) {
      noData=false;
      Arrays.sort(values);
      min=values[0];
      max=values[values.length - 1];
      avg=(float)total / (float)data.size();
      String descKey=s.substring(0,s.length() - 5) + "String_Node_Str";
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + s+ "String_Node_Str"+ total+ "String_Node_Str");
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + s+ "String_Node_Str"+ avg+ "String_Node_Str");
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + s+ "String_Node_Str"+ max+ "String_Node_Str");
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + s+ "String_Node_Str"+ min+ "String_Node_Str");
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + descKey+ "String_Node_Str"+ clusterInfo.get(descKey)+ "String_Node_Str");
      String lastSampleTimeKey=s.substring(0,s.length() - 5) + "String_Node_Str";
      long sampletime=getLastSampleTime(clusterInfo,lastSampleTimeKey,data.size());
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + lastSampleTimeKey+ "String_Node_Str"+ sampletime+ "String_Node_Str");
    }
  }
  if (noData) {
    aggregateReporter.appendMessage("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setClusterInfo(ActionReport aggregateReporter,List<String> list){
  List<HashMap> data=new ArrayList<HashMap>(targets.size());
  int i;
  for (i=0; i < targets.size(); i++) {
    data.add(new HashMap<String,String>());
  }
  HashMap<String,String> clusterInfo=new HashMap<String,String>();
  int instanceCount=0;
  for (  Server server : targets) {
    String instanceName=server.getName();
    Map<String,String> instanceMap=data.get(instanceCount);
    String key=null;
    for (    String str : list) {
      if (str.contains(instanceName) && str.contains("String_Node_Str")) {
        ArrayList<String> kv=getKeyValuePair(str,instanceName);
        key=(String)kv.get(0);
        instanceMap.put((String)kv.get(0),kv.get(1));
      }
      if (key != null) {
        String desc=key.substring(0,key.indexOf("String_Node_Str")) + "String_Node_Str";
        if (str.contains(desc)) {
          ArrayList<String> kv=getKeyValuePair(str,instanceName);
          clusterInfo.put((String)kv.get(0),kv.get(1));
        }
        String lastSampleTime=key.substring(0,key.indexOf("String_Node_Str")) + "String_Node_Str";
        if (str.contains(lastSampleTime)) {
          ArrayList<String> kv=getKeyValuePair(str,instanceName);
          clusterInfo.put(instanceName + "String_Node_Str" + (String)kv.get(0),kv.get(1));
          key=null;
        }
      }
    }
    instanceCount++;
  }
  List<Server> allServers=targetService.getAllInstances();
  String instanceListStr="String_Node_Str";
  i=0;
  for (  Server server : allServers) {
    if (server.isRunning()) {
      if (i == 0)       instanceListStr=server.getName();
 else       instanceListStr=instanceListStr + "String_Node_Str" + server.getName();
      i++;
    }
  }
  aggregateReporter.appendMessage("String_Node_Str" + i + "String_Node_Str"+ instanceListStr+ "String_Node_Str"+ targetName+ "String_Node_Str");
  boolean noData=true;
  HashMap<String,String> h=data.get(0);
  Iterator it=h.keySet().iterator();
  while (it.hasNext()) {
    int total=0, max=0, min=0, index=0;
    float avg=0;
    int[] values=new int[data.size()];
    boolean flag=false;
    String s=(String)it.next();
    for (    HashMap hm : data) {
      String tmp=(String)hm.get(s);
      if (tmp == null) {
        flag=true;
        break;
      }
 else {
        int count=Integer.parseInt(tmp);
        values[index++]=count;
        total=total + count;
      }
    }
    if (!flag) {
      noData=false;
      Arrays.sort(values);
      min=values[0];
      max=values[values.length - 1];
      avg=(float)total / (float)data.size();
      String descKey=s.substring(0,s.length() - 5) + "String_Node_Str";
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + s+ "String_Node_Str"+ total+ "String_Node_Str");
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + s+ "String_Node_Str"+ avg+ "String_Node_Str");
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + s+ "String_Node_Str"+ max+ "String_Node_Str");
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + s+ "String_Node_Str"+ min+ "String_Node_Str");
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + descKey+ "String_Node_Str"+ clusterInfo.get(descKey)+ "String_Node_Str");
      String lastSampleTimeKey=s.substring(0,s.length() - 5) + "String_Node_Str";
      long sampletime=getLastSampleTime(clusterInfo,lastSampleTimeKey,data.size());
      aggregateReporter.appendMessage(targetName + "String_Node_Str" + lastSampleTimeKey+ "String_Node_Str"+ sampletime+ "String_Node_Str");
    }
  }
  if (noData) {
    aggregateReporter.appendMessage("String_Node_Str");
  }
}