Program: 92120
Project: 92120
Buggy source:
/** 
 * Extract the field information from the structDefinition haze-inducing mess, and put them into something ITmfEventField can cope with.
 * @param eventDef CTF EventDefinition to read
 * @return CtfTmfEventField[] The array of fields that were read
 */
private CtfTmfEventField[] parseFields(EventDefinition eventDef){
  List<CtfTmfEventField> fields=new ArrayList<CtfTmfEventField>();
  StructDefinition structFields=eventDef.getFields();
  HashMap<String,Definition> definitions=structFields.getDefinitions();
  String curFieldName=null;
  Definition curFieldDef;
  CtfTmfEventField curField;
  Iterator<Entry<String,Definition>> it=definitions.entrySet().iterator();
  while (it.hasNext()) {
    Entry<String,Definition> entry=it.next();
    curFieldName=entry.getKey();
    curFieldDef=entry.getValue();
    curField=CtfTmfEventField.parseField(curFieldDef,curFieldName);
    fields.add(curField);
  }
  long ip=-1;
  StructDefinition structContext=eventDef.getContext();
  if (structContext != null) {
    definitions=structContext.getDefinitions();
    String curContextName;
    Definition curContextDef;
    CtfTmfEventField curContext;
    it=definitions.entrySet().iterator();
    while (it.hasNext()) {
      Entry<String,Definition> entry=it.next();
      if (entry.getKey().equals("String_Node_Str") && (entry.getValue() instanceof IntegerDefinition)) {
        ip=((IntegerDefinition)entry.getValue()).getValue();
      }
      curContextName=CONTEXT_FIELD_PREFIX + entry.getKey();
      curContextDef=entry.getValue();
      curContext=CtfTmfEventField.parseField(curContextDef,curContextName);
      fields.add(curContext);
    }
  }
  final String name=eventDef.getDeclaration().getName();
  List<CTFCallsite> eventList=fTrace.getCTFTrace().getCallsiteCandidates(name);
  if (eventList != null) {
    final String callsite="String_Node_Str";
    if (eventList.size() == 1 || ip == -1) {
      CTFCallsite cs=eventList.get(0);
      fields.add(new CTFStringField(cs.toString(),callsite));
    }
 else {
      fields.add(new CTFStringField(fTrace.getCTFTrace().getCallsite(name,ip).toString(),callsite));
    }
  }
  return fields.toArray(new CtfTmfEventField[fields.size()]);
}

Fixed version (ground truth):
/** 
 * Extract the field information from the structDefinition haze-inducing mess, and put them into something ITmfEventField can cope with.
 * @param eventDef CTF EventDefinition to read
 * @return CtfTmfEventField[] The array of fields that were read
 */
private CtfTmfEventField[] parseFields(EventDefinition eventDef){
  List<CtfTmfEventField> fields=new ArrayList<CtfTmfEventField>();
  StructDefinition structFields=eventDef.getFields();
  HashMap<String,Definition> definitions=structFields.getDefinitions();
  String curFieldName=null;
  Definition curFieldDef;
  CtfTmfEventField curField;
  Iterator<Entry<String,Definition>> it=definitions.entrySet().iterator();
  while (it.hasNext()) {
    Entry<String,Definition> entry=it.next();
    curFieldName=entry.getKey();
    curFieldDef=entry.getValue();
    curField=CtfTmfEventField.parseField(curFieldDef,curFieldName);
    fields.add(curField);
  }
  long ip=-1;
  StructDefinition structContext=eventDef.getContext();
  if (structContext != null) {
    definitions=structContext.getDefinitions();
    String curContextName;
    Definition curContextDef;
    CtfTmfEventField curContext;
    it=definitions.entrySet().iterator();
    while (it.hasNext()) {
      Entry<String,Definition> entry=it.next();
      if (entry.getKey().equals("String_Node_Str") && (entry.getValue() instanceof IntegerDefinition)) {
        ip=((IntegerDefinition)entry.getValue()).getValue();
      }
      curContextName=CONTEXT_FIELD_PREFIX + entry.getKey();
      curContextDef=entry.getValue();
      curContext=CtfTmfEventField.parseField(curContextDef,curContextName);
      fields.add(curContext);
    }
  }
  final String name=eventDef.getDeclaration().getName();
  List<CTFCallsite> eventList=fTrace.getCTFTrace().getCallsiteCandidates(name);
  if (!eventList.isEmpty()) {
    final String callsite="String_Node_Str";
    if (eventList.size() == 1 || ip == -1) {
      CTFCallsite cs=eventList.get(0);
      fields.add(new CTFStringField(cs.toString(),callsite));
    }
 else {
      fields.add(new CTFStringField(fTrace.getCTFTrace().getCallsite(name,ip).toString(),callsite));
    }
  }
  return fields.toArray(new CtfTmfEventField[fields.size()]);
}