nus-yam/ex-repair huggingface dataset:
Program: 28840
Project: 28840
Buggy source:
/** 
 * This method uses for validate @Extension -> @Parameter element.
 * @param parameters parameter array which needs to be validate.
 * @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validateexception with proper message.
 */
public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!PARAMETER_NAME_PATTERN.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
/** 
 * This method uses for validate @Extension / @Parameter element.
 * @param parameters parameter array which needs to be validate.
 * @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validateexception with proper message.
 */
public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!PARAMETER_NAME_PATTERN.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}
Program: 28841
Project: 28841
Buggy source:
/** 
 * Get the names of the available queries.
 * @return {@link Set<String>} of query names.
 */
public Set<String> getQueryNames(){
  return queryProcessorMap.keySet();
}

Fixed version (ground truth):
/** 
 * Get the names of the available queries.
 * @return string set of query names.
 */
public Set<String> getQueryNames(){
  return queryProcessorMap.keySet();
}
Program: 28842
Project: 28842
Buggy source:
/** 
 * The initialization method for FunctionExecutor, this method will be called before the other methods
 * @param attributeExpressionExecutors are the executors of each function parameters
 * @param configReader
 * @param executionPlanContext         the context of the execution plan
 */
protected abstract void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext);

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor, this method will be called before the other methods
 * @param attributeExpressionExecutors are the executors of each function parameters
 * @param configReader This hold the {@link FunctionExecutor} extensions configuration reader.
 * @param executionPlanContext         the context of the execution plan
 */
protected abstract void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext);
Program: 28843
Project: 28843
Buggy source:
/** 
 * Join the given two event streams
 * @param leftStream  event left stream
 * @param rightStream event right stream
 * @return StateEvent state event
 */
public StateEvent joinEventBuilder(StreamEvent leftStream,StreamEvent rightStream,ComplexEvent.Type type){
  StateEvent returnEvent=stateEventPool.borrowEvent();
  returnEvent.setEvent(0,leftStream);
  returnEvent.setEvent(1,rightStream);
  returnEvent.setType(type);
  if (!leftJoinProcessor) {
    returnEvent.setTimestamp(rightStream.getTimestamp());
  }
 else {
    returnEvent.setTimestamp(leftStream.getTimestamp());
  }
  return returnEvent;
}

Fixed version (ground truth):
/** 
 * Join the given two event streams
 * @param leftStream  event left stream
 * @param rightStream event right stream
 * @param type complex event type
 * @return StateEvent state event
 */
public StateEvent joinEventBuilder(StreamEvent leftStream,StreamEvent rightStream,ComplexEvent.Type type){
  StateEvent returnEvent=stateEventPool.borrowEvent();
  returnEvent.setEvent(0,leftStream);
  returnEvent.setEvent(1,rightStream);
  returnEvent.setType(type);
  if (!leftJoinProcessor) {
    returnEvent.setTimestamp(rightStream.getTimestamp());
  }
 else {
    returnEvent.setTimestamp(leftStream.getTimestamp());
  }
  return returnEvent;
}
Program: 28844
Project: 28844
Buggy source:
/** 
 * The init method of the StreamProcessor, this method will be called before other methods
 * @param inputDefinition              the incoming stream definition
 * @param attributeExpressionExecutors the executors of each function parameters
 * @param configReader
 * @param executionPlanContext         the context of the execution plan
 * @param outputExpectsExpiredEvents   is output expects ExpiredEvents   @return the additional output attributesintroduced by the function
 */
protected abstract List<Attribute> init(AbstractDefinition inputDefinition,ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext,boolean outputExpectsExpiredEvents);

Fixed version (ground truth):
/** 
 * The init method of the StreamProcessor, this method will be called before other methods
 * @param inputDefinition              the incoming stream definition
 * @param attributeExpressionExecutors the executors of each function parameters
 * @param configReader this hold the {@link AbstractStreamProcessor} extensions configuration reader.
 * @param executionPlanContext         the context of the execution plan
 * @param outputExpectsExpiredEvents   is output expects ExpiredEvents   @return the additional output attributesintroduced by the function
 * @return list of attributes.
 */
protected abstract List<Attribute> init(AbstractDefinition inputDefinition,ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext,boolean outputExpectsExpiredEvents);
Program: 28845
Project: 28845
Buggy source:
/** 
 * To construct a finder having the capability of finding events at the processor that corresponds to the incoming matchingEvent and the given matching expression logic.
 * @param expression                  the matching expression
 * @param matchingMetaInfoHolder      the meta structure of the incoming matchingEvent
 * @param executionPlanContext        current execution plan context
 * @param variableExpressionExecutors the list of variable ExpressionExecutors already created
 * @param tableMap               map of event tables
 * @param queryName
 * @return compiled Condition having the capability of matching events against the incoming matchingEvent
 */
CompiledCondition compileCondition(Expression expression,MatchingMetaInfoHolder matchingMetaInfoHolder,ExecutionPlanContext executionPlanContext,List<VariableExpressionExecutor> variableExpressionExecutors,Map<String,Table> tableMap,String queryName);

Fixed version (ground truth):
/** 
 * To construct a finder having the capability of finding events at the processor that corresponds to the incoming matchingEvent and the given matching expression logic.
 * @param expression                  the matching expression
 * @param matchingMetaInfoHolder      the meta structure of the incoming matchingEvent
 * @param executionPlanContext        current execution plan context
 * @param variableExpressionExecutors the list of variable ExpressionExecutors already created
 * @param tableMap               map of event tables
 * @param queryName                   query name of findable processor belongs to.
 * @return compiled Condition having the capability of matching events against the incoming matchingEvent
 */
CompiledCondition compileCondition(Expression expression,MatchingMetaInfoHolder matchingMetaInfoHolder,ExecutionPlanContext executionPlanContext,List<VariableExpressionExecutor> variableExpressionExecutors,Map<String,Table> tableMap,String queryName);
Program: 28846
Project: 28846
Buggy source:
/** 
 * The init method of the WindowProcessor, this method will be called before other methods
 * @param attributeExpressionExecutors the executors of each function parameters
 * @param configReader                 the config reader of window
 * @param outputExpectsExpiredEvents
 * @param executionPlanContext         the context of the execution plan
 */
protected abstract void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,boolean outputExpectsExpiredEvents,ExecutionPlanContext executionPlanContext);

Fixed version (ground truth):
/** 
 * The init method of the WindowProcessor, this method will be called before other methods
 * @param attributeExpressionExecutors the executors of each function parameters
 * @param configReader                 the config reader of window
 * @param outputExpectsExpiredEvents   is expired event out put or not
 * @param executionPlanContext         the context of the execution plan
 */
protected abstract void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,boolean outputExpectsExpiredEvents,ExecutionPlanContext executionPlanContext);
Program: 28847
Project: 28847
Buggy source:
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader
 * @param executionPlanContext         Execution plan runtime context
 */
protected abstract void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext);

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader this hold the {@link AttributeAggregator} extensions configuration reader.
 * @param executionPlanContext         Execution plan runtime context
 */
protected abstract void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext);
Program: 28848
Project: 28848
Buggy source:
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    avgOutputAttributeAggregator=new AvgAttributeAggregatorFloat();
  break;
case INT:
avgOutputAttributeAggregator=new AvgAttributeAggregatorInt();
break;
case LONG:
avgOutputAttributeAggregator=new AvgAttributeAggregatorLong();
break;
case DOUBLE:
avgOutputAttributeAggregator=new AvgAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader this hold the {@link AvgAttributeAggregator} configuration reader.
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    avgOutputAttributeAggregator=new AvgAttributeAggregatorFloat();
  break;
case INT:
avgOutputAttributeAggregator=new AvgAttributeAggregatorInt();
break;
case LONG:
avgOutputAttributeAggregator=new AvgAttributeAggregatorLong();
break;
case DOUBLE:
avgOutputAttributeAggregator=new AvgAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}
Program: 28849
Project: 28849
Buggy source:
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
}

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader this hold the {@link CountAttributeAggregator} configuration reader.
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
}
Program: 28850
Project: 28850
Buggy source:
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    maxOutputAttributeAggregator=new MaxAttributeAggregatorFloat();
  break;
case INT:
maxOutputAttributeAggregator=new MaxAttributeAggregatorInt();
break;
case LONG:
maxOutputAttributeAggregator=new MaxAttributeAggregatorLong();
break;
case DOUBLE:
maxOutputAttributeAggregator=new MaxAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader this hold the {@link MaxAttributeAggregator} configuration reader.
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    maxOutputAttributeAggregator=new MaxAttributeAggregatorFloat();
  break;
case INT:
maxOutputAttributeAggregator=new MaxAttributeAggregatorInt();
break;
case LONG:
maxOutputAttributeAggregator=new MaxAttributeAggregatorLong();
break;
case DOUBLE:
maxOutputAttributeAggregator=new MaxAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}
Program: 28851
Project: 28851
Buggy source:
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + "String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    maxForeverAttributeAggregator=new MaxForeverAttributeAggregatorFloat();
  break;
case INT:
maxForeverAttributeAggregator=new MaxForeverAttributeAggregatorInt();
break;
case LONG:
maxForeverAttributeAggregator=new MaxForeverAttributeAggregatorLong();
break;
case DOUBLE:
maxForeverAttributeAggregator=new MaxForeverAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader this hold the {@link MaxForeverAttributeAggregator} configuration reader.
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + "String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    maxForeverAttributeAggregator=new MaxForeverAttributeAggregatorFloat();
  break;
case INT:
maxForeverAttributeAggregator=new MaxForeverAttributeAggregatorInt();
break;
case LONG:
maxForeverAttributeAggregator=new MaxForeverAttributeAggregatorLong();
break;
case DOUBLE:
maxForeverAttributeAggregator=new MaxForeverAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}
Program: 28852
Project: 28852
Buggy source:
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    minOutputAttributeAggregator=new MinAttributeAggregatorFloat();
  break;
case INT:
minOutputAttributeAggregator=new MinAttributeAggregatorInt();
break;
case LONG:
minOutputAttributeAggregator=new MinAttributeAggregatorLong();
break;
case DOUBLE:
minOutputAttributeAggregator=new MinAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader this hold the {@link MinAttributeAggregator} configuration reader.
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    minOutputAttributeAggregator=new MinAttributeAggregatorFloat();
  break;
case INT:
minOutputAttributeAggregator=new MinAttributeAggregatorInt();
break;
case LONG:
minOutputAttributeAggregator=new MinAttributeAggregatorLong();
break;
case DOUBLE:
minOutputAttributeAggregator=new MinAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}
Program: 28853
Project: 28853
Buggy source:
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + "String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    minForeverAttributeAggregator=new MinForeverAttributeAggregatorFloat();
  break;
case INT:
minForeverAttributeAggregator=new MinForeverAttributeAggregatorInt();
break;
case LONG:
minForeverAttributeAggregator=new MinForeverAttributeAggregatorLong();
break;
case DOUBLE:
minForeverAttributeAggregator=new MinForeverAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader this hold the {@link MinForeverAttributeAggregator} configuration reader.
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + "String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    minForeverAttributeAggregator=new MinForeverAttributeAggregatorFloat();
  break;
case INT:
minForeverAttributeAggregator=new MinForeverAttributeAggregatorInt();
break;
case LONG:
minForeverAttributeAggregator=new MinForeverAttributeAggregatorLong();
break;
case DOUBLE:
minForeverAttributeAggregator=new MinForeverAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}
Program: 28854
Project: 28854
Buggy source:
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case INT:
    stdDevOutputAttributeAggregator=new StdDevAttributeAggregatorInt();
  break;
case LONG:
stdDevOutputAttributeAggregator=new StdDevAttributeAggregatorLong();
break;
case FLOAT:
stdDevOutputAttributeAggregator=new StdDevAttributeAggregatorFloat();
break;
case DOUBLE:
stdDevOutputAttributeAggregator=new StdDevAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader this hold the {@link StdDevAttributeAggregator} configuration reader.
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case INT:
    stdDevOutputAttributeAggregator=new StdDevAttributeAggregatorInt();
  break;
case LONG:
stdDevOutputAttributeAggregator=new StdDevAttributeAggregatorLong();
break;
case FLOAT:
stdDevOutputAttributeAggregator=new StdDevAttributeAggregatorFloat();
break;
case DOUBLE:
stdDevOutputAttributeAggregator=new StdDevAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}
Program: 28855
Project: 28855
Buggy source:
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    sumOutputAttributeAggregator=new SumAttributeAggregatorFloat();
  break;
case INT:
sumOutputAttributeAggregator=new SumAttributeAggregatorInt();
break;
case LONG:
sumOutputAttributeAggregator=new SumAttributeAggregatorLong();
break;
case DOUBLE:
sumOutputAttributeAggregator=new SumAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
/** 
 * The initialization method for FunctionExecutor
 * @param attributeExpressionExecutors are the executors of each attributes in the function
 * @param configReader this hold the {@link SumAttributeAggregator} configuration reader.
 * @param executionPlanContext         Execution plan runtime context
 */
@Override protected void init(ExpressionExecutor[] attributeExpressionExecutors,ConfigReader configReader,ExecutionPlanContext executionPlanContext){
  if (attributeExpressionExecutors.length != 1) {
    throw new OperationNotSupportedException("String_Node_Str" + attributeExpressionExecutors.length + "String_Node_Str");
  }
  Attribute.Type type=attributeExpressionExecutors[0].getReturnType();
switch (type) {
case FLOAT:
    sumOutputAttributeAggregator=new SumAttributeAggregatorFloat();
  break;
case INT:
sumOutputAttributeAggregator=new SumAttributeAggregatorInt();
break;
case LONG:
sumOutputAttributeAggregator=new SumAttributeAggregatorLong();
break;
case DOUBLE:
sumOutputAttributeAggregator=new SumAttributeAggregatorDouble();
break;
default :
throw new OperationNotSupportedException("String_Node_Str" + type);
}
}
Program: 28856
Project: 28856
Buggy source:
/** 
 * Will be called for initialing the   {@link Sink}
 * @param outputStreamDefinition
 * @param optionHolder           Option holder containing static and dynamic options related to the {@link Sink}
 * @param sinkConfigReader
 * @param executionPlanContext
 */
protected abstract void init(StreamDefinition outputStreamDefinition,OptionHolder optionHolder,ConfigReader sinkConfigReader,ExecutionPlanContext executionPlanContext);

Fixed version (ground truth):
/** 
 * Will be called for initialing the   {@link Sink}
 * @param outputStreamDefinition containing stream definition bind to the {@link Sink}
 * @param optionHolder           Option holder containing static and dynamic options related to the {@link Sink}
 * @param sinkConfigReader  this hold the {@link Sink} extensions configuration reader.
 * @param executionPlanContext {@link ExecutionPlanContext} of the parent execution plan.
 */
protected abstract void init(StreamDefinition outputStreamDefinition,OptionHolder optionHolder,ConfigReader sinkConfigReader,ExecutionPlanContext executionPlanContext);
Program: 28857
Project: 28857
Buggy source:
/** 
 * Sending events via output transport
 * @param payload          payload of the event
 * @param transportOptions one of the event constructing the payload
 * @throws ConnectionUnavailableException
 */
void publish(Object payload,DynamicOptions transportOptions) throws ConnectionUnavailableException ;

Fixed version (ground truth):
/** 
 * Sending events via output transport
 * @param payload          payload of the event
 * @param transportOptions one of the event constructing the payload
 * @throws ConnectionUnavailableException throw when connections are unavailable.
 */
void publish(Object payload,DynamicOptions transportOptions) throws ConnectionUnavailableException ;
Program: 28858
Project: 28858
Buggy source:
/** 
 * Initialize the mapper and the mapping configurations.
 * @param streamDefinition       The stream definition
 * @param optionHolder           Option holder containing static and dynamic options related to the mapper
 * @param payloadTemplateBuilder un mapped payload for reference
 * @param mapperConfigReader
 */
public abstract void init(StreamDefinition streamDefinition,OptionHolder optionHolder,TemplateBuilder payloadTemplateBuilder,ConfigReader mapperConfigReader);

Fixed version (ground truth):
/** 
 * Initialize the mapper and the mapping configurations.
 * @param streamDefinition       The stream definition
 * @param optionHolder           Option holder containing static and dynamic options related to the mapper
 * @param payloadTemplateBuilder un mapped payload for reference
 * @param mapperConfigReader this hold the {@link SinkMapper} extensions configuration reader.
 */
public abstract void init(StreamDefinition streamDefinition,OptionHolder optionHolder,TemplateBuilder payloadTemplateBuilder,ConfigReader mapperConfigReader);
Program: 28859
Project: 28859
Buggy source:
/** 
 * Initialize the Distribution strategy with the information it will require to make decisions.
 * @param streamDefinition         The stream attached to the sink this DistributionStrategy is used in
 * @param transportOptionHolder    Sink options of the sink which uses this DistributionStrategy
 * @param distributionOptionHolder
 * @param destinationOptionHolders The list of options under @destination of the relevant sink.
 * @param configReader
 */
@Override public void init(StreamDefinition streamDefinition,OptionHolder transportOptionHolder,OptionHolder distributionOptionHolder,List<OptionHolder> destinationOptionHolders,ConfigReader configReader){
}

Fixed version (ground truth):
/** 
 * Initialize the Distribution strategy with the information it will require to make decisions.
 * @param streamDefinition         The stream attached to the sink this DistributionStrategy is used in
 * @param transportOptionHolder    Sink options of the sink which uses this DistributionStrategy
 * @param distributionOptionHolder Option holder containing static and dynamic options related to thedistribution strategy.
 * @param destinationOptionHolders The list of options under @destination of the relevant sink.
 * @param configReader This hold the {@link BroadcastDistributionStrategy} extensions configuration reader.
 */
@Override public void init(StreamDefinition streamDefinition,OptionHolder transportOptionHolder,OptionHolder distributionOptionHolder,List<OptionHolder> destinationOptionHolders,ConfigReader configReader){
}
Program: 28860
Project: 28860
Buggy source:
/** 
 * Initialize the Distribution strategy with the information it will require to make decisions.
 * @param streamDefinition         The stream attached to the sink this DistributionStrategy is used in
 * @param transportOptionHolder    Sink options of the sink which uses this DistributionStrategy
 * @param destinationOptionHolders The list of options under @destination of the relevant sink.
 * @param configReader
 */
public abstract void init(StreamDefinition streamDefinition,OptionHolder transportOptionHolder,OptionHolder distributionOptionHolder,List<OptionHolder> destinationOptionHolders,ConfigReader configReader);

Fixed version (ground truth):
/** 
 * Initialize the Distribution strategy with the information it will require to make decisions.
 * @param streamDefinition         The stream attached to the sink this DistributionStrategy is used in
 * @param transportOptionHolder    Sink options of the sink which uses this DistributionStrategy
 * @param distributionOptionHolder The option under @destination of the relevant sink.
 * @param destinationOptionHolders The list of options under @destination of the relevant sink.
 * @param configReader This hold the {@link DistributionStrategy} extensions configuration reader.
 */
public abstract void init(StreamDefinition streamDefinition,OptionHolder transportOptionHolder,OptionHolder distributionOptionHolder,List<OptionHolder> destinationOptionHolders,ConfigReader configReader);
Program: 28861
Project: 28861
Buggy source:
/** 
 * Remove a destination to available set of destination IDs. Once this method is called for a given destination ID, that particular destination ID will be considered when getDestinationsToPublish() is called
 * @param destinationId
 */
public void destinationAvailable(int destinationId){
  if (destinationIds.contains(destinationId)) {
    throw new ExecutionPlanValidationException("String_Node_Str" + destinationId + "String_Node_Str");
  }
  destinationIds.add(destinationId);
  Collections.sort(destinationIds);
}

Fixed version (ground truth):
/** 
 * Remove a destination to available set of destination IDs. Once this method is called for a given destination ID, that particular destination ID will be considered when getDestinationsToPublish() is called
 * @param destinationId the ID of the destination to be check for availability.
 */
public void destinationAvailable(int destinationId){
  if (destinationIds.contains(destinationId)) {
    throw new ExecutionPlanValidationException("String_Node_Str" + destinationId + "String_Node_Str");
  }
  destinationIds.add(destinationId);
  Collections.sort(destinationIds);
}
Program: 28862
Project: 28862
Buggy source:
/** 
 * Initialize the Distribution strategy with the information it will require to make decisions.
 * @param streamDefinition         The stream attached to the sink this DistributionStrategy is used in
 * @param transportOptionHolder    Sink options of the sink which uses this DistributionStrategy
 * @param destinationOptionHolders The list of options under @destination of the relevant sink.
 * @param configReader
 */
@Override public void init(StreamDefinition streamDefinition,OptionHolder transportOptionHolder,OptionHolder distributionOptionHolder,List<OptionHolder> destinationOptionHolders,ConfigReader configReader){
  totalDestinationCount=destinationOptionHolders.size();
  String partitionKey=distributionOptionHolder.validateAndGetStaticValue(SiddhiConstants.PARTITION_KEY_FIELD_KEY);
  if (partitionKey == null || partitionKey.isEmpty()) {
    throw new ExecutionPlanValidationException("String_Node_Str" + "String_Node_Str");
  }
  try {
    int partitionKeyFieldPosition=streamDefinition.getAttributePosition(partitionKey);
    partitionOption=new Option(partitionKeyFieldPosition);
  }
 catch (  AttributeNotExistException e) {
    throw new ExecutionPlanValidationException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Initialize the Distribution strategy with the information it will require to make decisions.
 * @param streamDefinition         The stream attached to the sink this DistributionStrategy is used in
 * @param transportOptionHolder    Sink options of the sink which uses this DistributionStrategy
 * @param destinationOptionHolders The list of options under @destination of the relevant sink.
 * @param configReader This hold the {@link PartitionedDistributionStrategy} configuration reader.
 */
@Override public void init(StreamDefinition streamDefinition,OptionHolder transportOptionHolder,OptionHolder distributionOptionHolder,List<OptionHolder> destinationOptionHolders,ConfigReader configReader){
  totalDestinationCount=destinationOptionHolders.size();
  String partitionKey=distributionOptionHolder.validateAndGetStaticValue(SiddhiConstants.PARTITION_KEY_FIELD_KEY);
  if (partitionKey == null || partitionKey.isEmpty()) {
    throw new ExecutionPlanValidationException("String_Node_Str" + "String_Node_Str");
  }
  try {
    int partitionKeyFieldPosition=streamDefinition.getAttributePosition(partitionKey);
    partitionOption=new Option(partitionKeyFieldPosition);
  }
 catch (  AttributeNotExistException e) {
    throw new ExecutionPlanValidationException("String_Node_Str",e);
  }
}
Program: 28863
Project: 28863
Buggy source:
/** 
 * Initialize the Distribution strategy with the information it will require to make decisions.
 * @param streamDefinition         The stream attached to the sink this DistributionStrategy is used in
 * @param transportOptionHolder    Sink options of the sink which uses this DistributionStrategy
 * @param destinationOptionHolders The list of options under @destination of the relevant sink.
 * @param configReader
 */
@Override public void init(StreamDefinition streamDefinition,OptionHolder transportOptionHolder,OptionHolder distributionOptionHolder,List<OptionHolder> destinationOptionHolders,ConfigReader configReader){
}

Fixed version (ground truth):
/** 
 * Initialize the Distribution strategy with the information it will require to make decisions.
 * @param streamDefinition         The stream attached to the sink this DistributionStrategy is used in
 * @param transportOptionHolder    Sink options of the sink which uses this DistributionStrategy
 * @param destinationOptionHolders The list of options under @destination of the relevant sink.
 * @param configReader This hold the {@link RoundRobinDistributionStrategy} configuration reader.
 */
@Override public void init(StreamDefinition streamDefinition,OptionHolder transportOptionHolder,OptionHolder distributionOptionHolder,List<OptionHolder> destinationOptionHolders,ConfigReader configReader){
}
Program: 28864
Project: 28864
Buggy source:
/** 
 * Initializing the Record Table
 * @param tableDefinition definintion of the table with annotations if any
 * @param configReader
 */
protected abstract void init(TableDefinition tableDefinition,ConfigReader configReader);

Fixed version (ground truth):
/** 
 * Initializing the Record Table
 * @param tableDefinition definintion of the table with annotations if any
 * @param configReader this hold the {@link AbstractRecordTable} configuration reader.
 */
protected abstract void init(TableDefinition tableDefinition,ConfigReader configReader);
Program: 28869
Project: 28869
Buggy source:
private Event[] convertToEventArrayForDefaultMapping(Object eventObject){
  Gson gson=new Gson();
  JsonObject[] eventObjects=gson.fromJson(eventObject.toString(),JsonObject[].class);
  Event[] events=new Event[eventObjects.length];
  int index=0;
  JsonObject eventObj=null;
  for (  JsonObject jsonEvent : eventObjects) {
    if (jsonEvent.has(DEFAULT_JSON_EVENT_IDENTIFIER)) {
      eventObj=jsonEvent.get(DEFAULT_JSON_EVENT_IDENTIFIER).getAsJsonObject();
    }
 else {
      log.error("String_Node_Str" + eventObj.toString() + "String_Node_Str"+ "String_Node_Str");
      continue;
    }
    Event event=new Event(streamAttributes.size());
    Object[] data=event.getData();
    if (failOnMissingAttribute && eventObj.size() < streamAttributes.size()) {
      log.error("String_Node_Str" + eventObj.toString() + "String_Node_Str"+ "String_Node_Str");
      continue;
    }
    int position=0;
    for (    Attribute attribute : streamAttributes) {
      String attributeName=attribute.getName();
      Attribute.Type type=attribute.getType();
      Object attributeValue=eventObj.get(attributeName);
      if (attributeValue == null) {
        data[position++]=null;
      }
 else {
        data[position++]=attributeConverter.getPropertyValue(eventObj.get(attributeName).toString(),type);
      }
    }
    events[index++]=event;
  }
  return Arrays.copyOfRange(events,0,index);
}

Fixed version (ground truth):
private Event[] convertToEventArrayForDefaultMapping(Object eventObject){
  Gson gson=new Gson();
  JsonObject[] eventObjects=gson.fromJson(eventObject.toString(),JsonObject[].class);
  Event[] events=new Event[eventObjects.length];
  int index=0;
  JsonObject eventObj=null;
  for (  JsonObject jsonEvent : eventObjects) {
    if (jsonEvent.has(DEFAULT_JSON_EVENT_IDENTIFIER)) {
      eventObj=jsonEvent.get(DEFAULT_JSON_EVENT_IDENTIFIER).getAsJsonObject();
      if (failOnMissingAttribute && eventObj.size() < streamAttributes.size()) {
        log.error("String_Node_Str" + eventObj.toString() + "String_Node_Str"+ "String_Node_Str");
        continue;
      }
    }
 else {
      log.error("String_Node_Str" + eventObj.toString() + "String_Node_Str"+ "String_Node_Str");
      continue;
    }
    Event event=new Event(streamAttributes.size());
    Object[] data=event.getData();
    int position=0;
    for (    Attribute attribute : streamAttributes) {
      String attributeName=attribute.getName();
      Attribute.Type type=attribute.getType();
      Object attributeValue=eventObj.get(attributeName);
      if (attributeValue == null) {
        data[position++]=null;
      }
 else {
        data[position++]=attributeConverter.getPropertyValue(eventObj.get(attributeName).toString(),type);
      }
    }
    events[index++]=event;
  }
  return Arrays.copyOfRange(events,0,index);
}
Program: 28870
Project: 28870
Buggy source:
@Override public void receive(Event[] events){
  EventPrinter.print(events);
  for (  Event event : events) {
switch (count.incrementAndGet()) {
case 1:
      junit.framework.Assert.assertEquals(55.6f,event.getData(1));
    break;
case 2:
  junit.framework.Assert.assertEquals(56.6f,event.getData(1));
break;
case 3:
junit.framework.Assert.assertEquals(100L,event.getData(2));
break;
case 4:
junit.framework.Assert.assertEquals(200L,event.getData(2));
break;
case 5:
junit.framework.Assert.assertEquals("String_Node_Str",event.getData(0));
break;
case 6:
junit.framework.Assert.assertEquals(null,event.getData(0));
break;
default :
Assert.fail();
}
}
}

Fixed version (ground truth):
@Override public void receive(Event[] events){
  EventPrinter.print(events);
  for (  Event event : events) {
switch (count.incrementAndGet()) {
case 1:
      Assert.assertEquals(55.6f,event.getData(1));
    break;
case 2:
  Assert.assertEquals(56.6f,event.getData(1));
break;
case 3:
Assert.assertEquals(100L,event.getData(2));
break;
case 4:
Assert.assertEquals(200L,event.getData(2));
break;
case 5:
Assert.assertEquals("String_Node_Str",event.getData(0));
break;
case 6:
Assert.assertEquals(null,event.getData(0));
break;
default :
Assert.fail();
}
}
}
Program: 28871
Project: 28871
Buggy source:
@Test public void jsonSourceMapperTest8() throws InterruptedException {
  log.info("String_Node_Str");
  String streams="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String query="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  executionPlanRuntime.addCallback("String_Node_Str",new StreamCallback(){
    @Override public void receive(    Event[] events){
      EventPrinter.print(events);
      for (      Event event : events) {
switch (count.incrementAndGet()) {
case 1:
          junit.framework.Assert.assertEquals(55.6f,event.getData(1));
        break;
default :
      Assert.fail();
  }
}
}
}
);
executionPlanRuntime.start();
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
Thread.sleep(100);
Assert.assertEquals("String_Node_Str",1,count.get());
executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void jsonSourceMapperTest8() throws InterruptedException {
  log.info("String_Node_Str");
  String streams="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String query="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  executionPlanRuntime.addCallback("String_Node_Str",new StreamCallback(){
    @Override public void receive(    Event[] events){
      EventPrinter.print(events);
      for (      Event event : events) {
switch (count.incrementAndGet()) {
case 1:
          Assert.assertEquals(55.6f,event.getData(1));
        break;
default :
      Assert.fail();
  }
}
}
}
);
executionPlanRuntime.start();
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
Thread.sleep(100);
Assert.assertEquals("String_Node_Str",1,count.get());
executionPlanRuntime.shutdown();
}