Program: 28768
Project: 28768
Buggy source:
public CompiledCondition compileExpression(Expression expression,Within within,Expression per,MatchingMetaInfoHolder matchingMetaInfoHolder,List<VariableExpressionExecutor> variableExpressionExecutors,Map<String,Table> tableMap,String queryName,SiddhiAppContext siddhiAppContext){
  Map<TimePeriod.Duration,CompiledCondition> withinTableCompiledConditions=new HashMap<>();
  CompiledCondition withinInMemoryCompileCondition;
  CompiledCondition onCompiledCondition;
  perExpressionExecutor=ExpressionParser.parseExpression(per,matchingMetaInfoHolder.getMetaStateEvent(),matchingMetaInfoHolder.getCurrentState(),tableMap,variableExpressionExecutors,siddhiAppContext,false,0,queryName);
  if (perExpressionExecutor.getReturnType() != Attribute.Type.STRING) {
    throw new SiddhiAppCreationException("String_Node_Str" + queryName + "String_Node_Str"+ perExpressionExecutor.getReturnType(),per.getQueryContextStartIndex(),per.getQueryContextEndIndex());
  }
  onCompiledCondition=OperatorParser.constructOperator(new ComplexEventChunk<>(true),expression,matchingMetaInfoHolder,siddhiAppContext,variableExpressionExecutors,tableMap,queryName);
  AbstractDefinition tableDefinition=((Table)aggregationTables.values().toArray()[0]).getTableDefinition();
  MatchingMetaInfoHolder newMatchingMetaInfoHolder=aggregationTableMetaInfoHolder(matchingMetaInfoHolder,tableDefinition);
  Expression withinExpression;
  Expression start=Expression.variable("String_Node_Str");
  Expression end=Expression.variable("String_Node_Str");
  Expression compareWithStartTime=Compare.compare(start,Compare.Operator.LESS_THAN_EQUAL,Expression.variable("String_Node_Str"));
  Expression compareWithEndTime=Compare.compare(Expression.variable("String_Node_Str"),Compare.Operator.LESS_THAN,end);
  withinExpression=Expression.and(compareWithStartTime,compareWithEndTime);
  Expression startEndTimeExpression;
  if (within.getTimeRange().size() == 1) {
    startEndTimeExpression=new AttributeFunction("String_Node_Str","String_Node_Str",within.getTimeRange().get(0));
  }
 else {
    startEndTimeExpression=new AttributeFunction("String_Node_Str","String_Node_Str",within.getTimeRange().get(0),within.getTimeRange().get(1));
  }
  startTimeEndTimeExpressionExecutor=ExpressionParser.parseExpression(startEndTimeExpression,matchingMetaInfoHolder.getMetaStateEvent(),matchingMetaInfoHolder.getCurrentState(),tableMap,variableExpressionExecutors,siddhiAppContext,false,0,queryName);
  for (  Map.Entry<TimePeriod.Duration,Table> entry : aggregationTables.entrySet()) {
    CompiledCondition withinTableCompileCondition=entry.getValue().compileCondition(withinExpression,newMatchingMetaInfoHolder,siddhiAppContext,variableExpressionExecutors,tableMap,queryName);
    withinTableCompiledConditions.put(entry.getKey(),withinTableCompileCondition);
  }
  withinInMemoryCompileCondition=OperatorParser.constructOperator(new ComplexEventChunk<>(true),withinExpression,newMatchingMetaInfoHolder,siddhiAppContext,variableExpressionExecutors,tableMap,queryName);
  return new IncrementalAggregateCompileCondition(withinTableCompiledConditions,withinInMemoryCompileCondition,onCompiledCondition,tableMetaStreamEvent,aggregateMetaSteamEvent,metaStreamArraySizes);
}

Fixed version (ground truth):
public CompiledCondition compileExpression(Expression expression,Within within,Expression per,MatchingMetaInfoHolder matchingMetaInfoHolder,List<VariableExpressionExecutor> variableExpressionExecutors,Map<String,Table> tableMap,String queryName,SiddhiAppContext siddhiAppContext){
  Map<TimePeriod.Duration,CompiledCondition> withinTableCompiledConditions=new HashMap<>();
  CompiledCondition withinInMemoryCompileCondition;
  CompiledCondition onCompiledCondition;
  perExpressionExecutor=ExpressionParser.parseExpression(per,matchingMetaInfoHolder.getMetaStateEvent(),matchingMetaInfoHolder.getCurrentState(),tableMap,variableExpressionExecutors,siddhiAppContext,false,0,queryName);
  if (perExpressionExecutor.getReturnType() != Attribute.Type.STRING) {
    throw new SiddhiAppCreationException("String_Node_Str" + queryName + "String_Node_Str"+ perExpressionExecutor.getReturnType(),per.getQueryContextStartIndex(),per.getQueryContextEndIndex());
  }
  onCompiledCondition=OperatorParser.constructOperator(new ComplexEventChunk<>(true),expression,matchingMetaInfoHolder,siddhiAppContext,variableExpressionExecutors,tableMap,queryName);
  AbstractDefinition tableDefinition=((Table)aggregationTables.values().toArray()[0]).getTableDefinition();
  MatchingMetaInfoHolder newMatchingMetaInfoHolder=aggregationTableMetaInfoHolder(matchingMetaInfoHolder,tableDefinition);
  Expression withinExpression;
  Expression start=Expression.variable("String_Node_Str");
  Expression end=Expression.variable("String_Node_Str");
  Expression compareWithStartTime=Compare.compare(start,Compare.Operator.LESS_THAN_EQUAL,Expression.variable("String_Node_Str"));
  Expression compareWithEndTime=Compare.compare(Expression.variable("String_Node_Str"),Compare.Operator.LESS_THAN,end);
  withinExpression=Expression.and(compareWithStartTime,compareWithEndTime);
  Expression startEndTimeExpression;
  if (within.getTimeRange().size() == 1) {
    startEndTimeExpression=new AttributeFunction("String_Node_Str","String_Node_Str",within.getTimeRange().get(0));
  }
 else {
    startEndTimeExpression=new AttributeFunction("String_Node_Str","String_Node_Str",within.getTimeRange().get(0),within.getTimeRange().get(1));
  }
  startTimeEndTimeExpressionExecutor=ExpressionParser.parseExpression(startEndTimeExpression,matchingMetaInfoHolder.getMetaStateEvent(),matchingMetaInfoHolder.getCurrentState(),tableMap,variableExpressionExecutors,siddhiAppContext,false,0,queryName);
  for (  Map.Entry<TimePeriod.Duration,Table> entry : aggregationTables.entrySet()) {
    CompiledCondition withinTableCompileCondition=entry.getValue().compileCondition(withinExpression,newMatchingMetaInfoHolder,siddhiAppContext,variableExpressionExecutors,tableMap,queryName);
    withinTableCompiledConditions.put(entry.getKey(),withinTableCompileCondition);
  }
  withinInMemoryCompileCondition=OperatorParser.constructOperator(new ComplexEventChunk<>(true),withinExpression,newMatchingMetaInfoHolder,siddhiAppContext,variableExpressionExecutors,tableMap,queryName);
  return new IncrementalAggregateCompileCondition(withinTableCompiledConditions,withinInMemoryCompileCondition,onCompiledCondition,tableMetaStreamEvent,aggregateMetaSteamEvent);
}