Program: 28973
Project: 28973
Buggy source:
public static EventHolder parse(AbstractDefinition tableDefinition,StreamEventPool tableStreamEventPool){
  ZeroStreamEventConverter eventConverter=new ZeroStreamEventConverter();
  String primaryKeyAttribute=null;
  int primaryKeyPosition=-1;
  Map<String,Integer> indexMetaData=new HashMap<String,Integer>();
  Annotation primaryKeyAnnotation=AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_PRIMARY_KEY,tableDefinition.getAnnotations());
  if (primaryKeyAnnotation != null) {
    if (primaryKeyAnnotation.getElements().size() > 1) {
      throw new OperationNotSupportedException(SiddhiConstants.ANNOTATION_PRIMARY_KEY + "String_Node_Str" + primaryKeyAnnotation.getElements().size()+ "String_Node_Str");
    }
    if (primaryKeyAnnotation.getElements().size() == 0) {
      throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_PRIMARY_KEY + "String_Node_Str" + primaryKeyAnnotation.getElements().size()+ "String_Node_Str");
    }
    primaryKeyAttribute=primaryKeyAnnotation.getElements().get(0).getValue().trim();
    primaryKeyPosition=tableDefinition.getAttributePosition(primaryKeyAttribute);
  }
  Annotation indexAnnotation=AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_INDEX,tableDefinition.getAnnotations());
  if (indexAnnotation != null) {
    if (indexAnnotation.getElements().size() == 0) {
      throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_INDEX + "String_Node_Str" + indexAnnotation.getElements().size()+ "String_Node_Str");
    }
    for (    Element element : indexAnnotation.getElements()) {
      indexMetaData.put(element.getValue().trim(),tableDefinition.getAttributePosition(element.getValue().trim()));
    }
  }
  if (primaryKeyAttribute == null) {
    Annotation indexByAnnotation=AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_INDEX_BY,tableDefinition.getAnnotations());
    if (indexByAnnotation != null) {
      if (indexByAnnotation.getElements().size() > 1) {
        throw new OperationNotSupportedException(SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str" + indexByAnnotation.getElements().size()+ "String_Node_Str");
      }
      if (indexByAnnotation.getElements().size() == 0) {
        throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str" + indexByAnnotation.getElements().size()+ "String_Node_Str");
      }
      primaryKeyAttribute=indexByAnnotation.getElements().get(0).getValue().trim();
      primaryKeyPosition=tableDefinition.getAttributePosition(primaryKeyAttribute);
    }
 else {
      log.info("String_Node_Str" + SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str"+ SiddhiConstants.ANNOTATION_PRIMARY_KEY+ "String_Node_Str"+ tableDefinition.getId());
    }
  }
  if (primaryKeyAttribute != null || indexMetaData.size() > 0) {
    return new IndexEventHolder(tableStreamEventPool,eventConverter,primaryKeyPosition,primaryKeyAttribute,indexMetaData);
  }
 else {
    return new ListEventHolder(tableStreamEventPool,eventConverter);
  }
}

Fixed version (ground truth):
public static EventHolder parse(AbstractDefinition tableDefinition,StreamEventPool tableStreamEventPool){
  ZeroStreamEventConverter eventConverter=new ZeroStreamEventConverter();
  String primaryKeyAttribute=null;
  int primaryKeyPosition=-1;
  Map<String,Integer> indexMetaData=new HashMap<String,Integer>();
  Annotation primaryKeyAnnotation=AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_PRIMARY_KEY,tableDefinition.getAnnotations());
  if (primaryKeyAnnotation != null) {
    if (primaryKeyAnnotation.getElements().size() > 1) {
      throw new OperationNotSupportedException(SiddhiConstants.ANNOTATION_PRIMARY_KEY + "String_Node_Str" + primaryKeyAnnotation.getElements().size()+ "String_Node_Str");
    }
    if (primaryKeyAnnotation.getElements().size() == 0) {
      throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_PRIMARY_KEY + "String_Node_Str" + primaryKeyAnnotation.getElements().size()+ "String_Node_Str");
    }
    primaryKeyAttribute=primaryKeyAnnotation.getElements().get(0).getValue().trim();
    primaryKeyPosition=tableDefinition.getAttributePosition(primaryKeyAttribute);
  }
  Annotation indexAnnotation=AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_INDEX,tableDefinition.getAnnotations());
  if (indexAnnotation != null) {
    if (indexAnnotation.getElements().size() == 0) {
      throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_INDEX + "String_Node_Str" + indexAnnotation.getElements().size()+ "String_Node_Str");
    }
    for (    Element element : indexAnnotation.getElements()) {
      indexMetaData.put(element.getValue().trim(),tableDefinition.getAttributePosition(element.getValue().trim()));
    }
  }
  Annotation indexByAnnotation=AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_INDEX_BY,tableDefinition.getAnnotations());
  if (indexByAnnotation != null) {
    if (primaryKeyAttribute != null) {
      log.info("String_Node_Str" + SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str"+ SiddhiConstants.ANNOTATION_PRIMARY_KEY+ "String_Node_Str"+ tableDefinition.getId());
    }
 else {
      if (indexByAnnotation.getElements().size() > 1) {
        throw new OperationNotSupportedException(SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str" + indexByAnnotation.getElements().size()+ "String_Node_Str");
      }
      if (indexByAnnotation.getElements().size() == 0) {
        throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str" + indexByAnnotation.getElements().size()+ "String_Node_Str");
      }
      primaryKeyAttribute=indexByAnnotation.getElements().get(0).getValue().trim();
      primaryKeyPosition=tableDefinition.getAttributePosition(primaryKeyAttribute);
    }
  }
  if (primaryKeyAttribute != null || indexMetaData.size() > 0) {
    return new IndexEventHolder(tableStreamEventPool,eventConverter,primaryKeyPosition,primaryKeyAttribute,indexMetaData);
  }
 else {
    return new ListEventHolder(tableStreamEventPool,eventConverter);
  }
}