Program: 92543
Project: 92543
Buggy source:
private void parseEventDeclaration(CommonTree eventDecl,EventDeclaration event) throws ParseException {
  assert((eventDecl.getType() == CTFParser.CTF_EXPRESSION_TYPE) || (eventDecl.getType() == CTFParser.CTF_EXPRESSION_VAL));
  assert(eventDecl.getChildCount() == 2);
  CommonTree leftNode=(CommonTree)eventDecl.getChild(0);
  assert(leftNode.getType() == CTFParser.CTF_LEFT);
  CommonTree rightNode=(CommonTree)eventDecl.getChild(1);
  assert(rightNode.getType() == CTFParser.CTF_RIGHT);
  List<CommonTree> leftStrings=leftNode.getChildren();
  assert(leftStrings != null);
  if (!isUnaryString(leftStrings.get(0))) {
    throw new ParseException("String_Node_Str");
  }
  String left=concatenateUnaryStrings(leftStrings);
  if (left.equals("String_Node_Str")) {
    if (event.nameIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    String name=getEventName(rightNode);
    event.setName(name);
  }
 else   if (left.equals("String_Node_Str")) {
    if (event.idIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    long id=getEventID(rightNode);
    event.setId(id);
  }
 else   if (left.equals("String_Node_Str")) {
    if (event.streamIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    long streamId=getStreamID(rightNode);
    Stream stream=trace.getStream(streamId);
    if (stream == null) {
      throw new ParseException("String_Node_Str" + streamId + "String_Node_Str");
    }
    event.setStream(stream);
  }
 else   if (left.equals("String_Node_Str")) {
    if (event.contextIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    CommonTree typeSpecifier=(CommonTree)rightNode.getChild(0);
    if (typeSpecifier.getType() != CTFParser.TYPE_SPECIFIER_LIST) {
      throw new ParseException("String_Node_Str");
    }
    IDeclaration contextDecl=parseTypeSpecifierList(typeSpecifier,null);
    if (!(contextDecl instanceof StructDeclaration)) {
      throw new ParseException("String_Node_Str");
    }
    event.setContext((StructDeclaration)contextDecl);
  }
 else   if (left.equals("String_Node_Str")) {
    if (event.fieldsIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    CommonTree typeSpecifier=(CommonTree)rightNode.getChild(0);
    if (typeSpecifier.getType() != CTFParser.TYPE_SPECIFIER_LIST) {
      throw new ParseException("String_Node_Str");
    }
    IDeclaration fieldsDecl=parseTypeSpecifierList(typeSpecifier,null);
    if (!(fieldsDecl instanceof StructDeclaration)) {
      throw new ParseException("String_Node_Str");
    }
    StructDeclaration fields=(StructDeclaration)fieldsDecl;
    HashMap<String,IDeclaration> fieldMap=fields.getFields();
    List<String> fieldsList=fields.getFieldsList();
    HashMap<String,String> translationMap=new HashMap<String,String>();
    Set<String> keys=fieldMap.keySet();
    for (    String key : keys) {
      if (key.startsWith("String_Node_Str",0)) {
        final String newKey=key.substring(1);
        translationMap.put(key,newKey);
        fieldsList.set(fieldsList.indexOf(key),newKey);
      }
    }
    Iterator<Entry<String,String>> it=translationMap.entrySet().iterator();
    while (it.hasNext()) {
      final Entry<String,String> pairs=it.next();
      final String oldKey=pairs.getKey();
      final String newKey=pairs.getValue();
      final IDeclaration value=fieldMap.get(oldKey);
      fieldMap.put(newKey,value);
      fieldMap.remove(oldKey);
    }
    event.setFields(fields);
  }
 else {
    throw new ParseException("String_Node_Str" + left);
  }
}

Fixed version (ground truth):
private void parseEventDeclaration(CommonTree eventDecl,EventDeclaration event) throws ParseException {
  assert((eventDecl.getType() == CTFParser.CTF_EXPRESSION_TYPE) || (eventDecl.getType() == CTFParser.CTF_EXPRESSION_VAL));
  assert(eventDecl.getChildCount() == 2);
  CommonTree leftNode=(CommonTree)eventDecl.getChild(0);
  assert(leftNode.getType() == CTFParser.CTF_LEFT);
  CommonTree rightNode=(CommonTree)eventDecl.getChild(1);
  assert(rightNode.getType() == CTFParser.CTF_RIGHT);
  List<CommonTree> leftStrings=leftNode.getChildren();
  assert(leftStrings != null);
  if (!isUnaryString(leftStrings.get(0))) {
    throw new ParseException("String_Node_Str");
  }
  String left=concatenateUnaryStrings(leftStrings);
  if (left.equals("String_Node_Str")) {
    if (event.nameIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    String name=getEventName(rightNode);
    event.setName(name);
  }
 else   if (left.equals("String_Node_Str")) {
    if (event.idIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    long id=getEventID(rightNode);
    event.setId(id);
  }
 else   if (left.equals("String_Node_Str")) {
    if (event.streamIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    long streamId=getStreamID(rightNode);
    Stream stream=trace.getStream(streamId);
    if (stream == null) {
      throw new ParseException("String_Node_Str" + streamId + "String_Node_Str");
    }
    event.setStream(stream);
  }
 else   if (left.equals("String_Node_Str")) {
    if (event.contextIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    CommonTree typeSpecifier=(CommonTree)rightNode.getChild(0);
    if (typeSpecifier.getType() != CTFParser.TYPE_SPECIFIER_LIST) {
      throw new ParseException("String_Node_Str");
    }
    IDeclaration contextDecl=parseTypeSpecifierList(typeSpecifier,null);
    if (!(contextDecl instanceof StructDeclaration)) {
      throw new ParseException("String_Node_Str");
    }
    event.setContext((StructDeclaration)contextDecl);
  }
 else   if (left.equals("String_Node_Str")) {
    if (event.fieldsIsSet()) {
      throw new ParseException("String_Node_Str");
    }
    CommonTree typeSpecifier=(CommonTree)rightNode.getChild(0);
    if (typeSpecifier.getType() != CTFParser.TYPE_SPECIFIER_LIST) {
      throw new ParseException("String_Node_Str");
    }
    IDeclaration fieldsDecl=parseTypeSpecifierList(typeSpecifier,null);
    if (!(fieldsDecl instanceof StructDeclaration)) {
      throw new ParseException("String_Node_Str");
    }
    final StructDeclaration fields=(StructDeclaration)fieldsDecl;
    event.setFields(fields);
  }
 else {
    throw new ParseException("String_Node_Str" + left);
  }
}