Program: 28923
Project: 28923
Buggy source:
public static AggregationRuntime parse(AggregationDefinition definition,ExecutionPlanContext executionPlanContext,Map<String,AbstractDefinition> streamDefinitionMap,Map<String,AbstractDefinition> tableDefinitionMap,Map<String,AbstractDefinition> windowDefinitionMap,Map<String,EventTable> eventTableMap,Map<String,EventWindow> eventWindowMap,Map<String,List<InputTransport>> eventSourceMap,Map<String,List<OutputTransport>> eventSinkMap,LockSynchronizer lockSynchronizer){
  if (definition == null) {
    throw new ExecutionPlanCreationException("String_Node_Str" + "String_Node_Str");
  }
  if (definition.getTimePeriod() == null) {
    throw new ExecutionPlanCreationException("String_Node_Str" + "String_Node_Str");
  }
  List<VariableExpressionExecutor> executors=new ArrayList<VariableExpressionExecutor>();
  Element nameElement=null;
  LatencyTracker latencyTracker=null;
  LockWrapper lockWrapper=null;
  AggregationRuntime aggregationRuntime=null;
  try {
    nameElement=AnnotationHelper.getAnnotationElement("String_Node_Str","String_Node_Str",definition.getAnnotations());
    String queryName=null;
    if (nameElement != null) {
      queryName=nameElement.getValue();
    }
 else {
      queryName="String_Node_Str" + UUID.randomUUID().toString();
    }
    if (executionPlanContext.isStatsEnabled() && executionPlanContext.getStatisticsManager() != null) {
      if (nameElement != null) {
        String metricName=executionPlanContext.getSiddhiContext().getStatisticsConfiguration().getMatricPrefix() + SiddhiConstants.METRIC_DELIMITER + SiddhiConstants.METRIC_INFIX_EXECUTION_PLANS+ SiddhiConstants.METRIC_DELIMITER+ executionPlanContext.getName()+ SiddhiConstants.METRIC_DELIMITER+ SiddhiConstants.METRIC_INFIX_SIDDHI+ SiddhiConstants.METRIC_DELIMITER+ SiddhiConstants.METRIC_INFIX_QUERIES+ SiddhiConstants.METRIC_DELIMITER+ queryName;
        latencyTracker=executionPlanContext.getSiddhiContext().getStatisticsConfiguration().getFactory().createLatencyTracker(metricName,executionPlanContext.getStatisticsManager());
      }
    }
    InputStream inputStream=definition.getInputStream();
    StreamRuntime streamRuntime=InputStreamParser.parse(inputStream,executionPlanContext,streamDefinitionMap,tableDefinitionMap,windowDefinitionMap,eventTableMap,eventWindowMap,executors,latencyTracker,false,queryName);
    MetaComplexEvent metaComplexEvent=streamRuntime.getMetaComplexEvent();
    List<OutputAttribute> outputAttributes=definition.getSelector().getSelectionList();
    List<AttributeFunction> functionsAttributes=new ArrayList<>();
    for (int i=1; i < outputAttributes.size(); i++) {
      OutputAttribute tmp=outputAttributes.get(i);
      functionsAttributes.add((AttributeFunction)tmp.getExpression());
    }
    List<TimePeriod.Duration> incrementalDurations=getSortedPeriods(definition.getTimePeriod());
    Variable groupByVar=getGroupByAttribute(definition.getSelector());
    IncrementalExecutor child=build(functionsAttributes,incrementalDurations.get(incrementalDurations.size() - 1),null,metaComplexEvent,0,eventTableMap,executors,executionPlanContext,true,0,queryName,groupByVar);
    IncrementalExecutor root=child;
    for (int i=incrementalDurations.size() - 2; i >= 0; i--) {
      root=build(functionsAttributes,incrementalDurations.get(i),child,metaComplexEvent,0,eventTableMap,executors,executionPlanContext,true,0,queryName,groupByVar);
      child=root;
    }
    aggregationRuntime=new AggregationRuntime(definition,executionPlanContext,streamRuntime,metaComplexEvent);
  }
 catch (  RuntimeException ex) {
  }
  return aggregationRuntime;
}

Fixed version (ground truth):
public static AggregationRuntime parse(AggregationDefinition definition,ExecutionPlanContext executionPlanContext,Map<String,AbstractDefinition> streamDefinitionMap,Map<String,AbstractDefinition> tableDefinitionMap,Map<String,AbstractDefinition> windowDefinitionMap,Map<String,Table> tableMap,Map<String,Window> windowMap,Map<String,List<Source>> eventSourceMap,Map<String,List<Sink>> eventSinkMap,LockSynchronizer lockSynchronizer){
  if (definition == null) {
    throw new ExecutionPlanCreationException("String_Node_Str" + "String_Node_Str");
  }
  if (definition.getTimePeriod() == null) {
    throw new ExecutionPlanCreationException("String_Node_Str" + "String_Node_Str");
  }
  List<VariableExpressionExecutor> executors=new ArrayList<VariableExpressionExecutor>();
  Element nameElement=null;
  LatencyTracker latencyTracker=null;
  LockWrapper lockWrapper=null;
  AggregationRuntime aggregationRuntime=null;
  try {
    nameElement=AnnotationHelper.getAnnotationElement("String_Node_Str","String_Node_Str",definition.getAnnotations());
    String queryName=null;
    if (nameElement != null) {
      queryName=nameElement.getValue();
    }
 else {
      queryName="String_Node_Str" + UUID.randomUUID().toString();
    }
    if (executionPlanContext.isStatsEnabled() && executionPlanContext.getStatisticsManager() != null) {
      if (nameElement != null) {
        String metricName=executionPlanContext.getSiddhiContext().getStatisticsConfiguration().getMatricPrefix() + SiddhiConstants.METRIC_DELIMITER + SiddhiConstants.METRIC_INFIX_EXECUTION_PLANS+ SiddhiConstants.METRIC_DELIMITER+ executionPlanContext.getName()+ SiddhiConstants.METRIC_DELIMITER+ SiddhiConstants.METRIC_INFIX_SIDDHI+ SiddhiConstants.METRIC_DELIMITER+ SiddhiConstants.METRIC_INFIX_QUERIES+ SiddhiConstants.METRIC_DELIMITER+ queryName;
        latencyTracker=executionPlanContext.getSiddhiContext().getStatisticsConfiguration().getFactory().createLatencyTracker(metricName,executionPlanContext.getStatisticsManager());
      }
    }
    InputStream inputStream=definition.getInputStream();
    StreamRuntime streamRuntime=InputStreamParser.parse(inputStream,executionPlanContext,streamDefinitionMap,tableDefinitionMap,windowDefinitionMap,tableMap,windowMap,executors,latencyTracker,false,queryName);
    MetaComplexEvent metaComplexEvent=streamRuntime.getMetaComplexEvent();
    List<OutputAttribute> outputAttributes=definition.getSelector().getSelectionList();
    List<AttributeFunction> functionsAttributes=new ArrayList<>();
    for (int i=1; i < outputAttributes.size(); i++) {
      OutputAttribute tmp=outputAttributes.get(i);
      functionsAttributes.add((AttributeFunction)tmp.getExpression());
    }
    List<TimePeriod.Duration> incrementalDurations=getSortedPeriods(definition.getTimePeriod());
    Variable groupByVar=getGroupByAttribute(definition.getSelector());
    IncrementalExecutor child=build(functionsAttributes,incrementalDurations.get(incrementalDurations.size() - 1),null,metaComplexEvent,0,tableMap,executors,executionPlanContext,true,0,queryName,groupByVar);
    IncrementalExecutor root=child;
    for (int i=incrementalDurations.size() - 2; i >= 0; i--) {
      root=build(functionsAttributes,incrementalDurations.get(i),child,metaComplexEvent,0,tableMap,executors,executionPlanContext,true,0,queryName,groupByVar);
      child=root;
    }
    aggregationRuntime=new AggregationRuntime(definition,executionPlanContext,streamRuntime,metaComplexEvent);
  }
 catch (  RuntimeException ex) {
  }
  return aggregationRuntime;
}