Program: 29234
Project: 29234
Buggy source:
@Override protected void init(Expression[] parameters,List<ExpressionExecutor> expressionExecutors,StreamDefinition inStreamDefinition,StreamDefinition outStreamDefinition,String elementId,SiddhiContext siddhiContext){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + inStreamDefinition.toString());
  }
  if (parameters[0] instanceof IntConstant) {
    try {
      calcInterval=((IntConstant)parameters[0]).getValue();
      batchSize=((IntConstant)parameters[1]).getValue();
    }
 catch (    ClassCastException c) {
      throw new QueryCreationException("String_Node_Str");
    }
    try {
      ci=((DoubleConstant)parameters[2]).getValue();
    }
 catch (    ClassCastException c) {
      throw new QueryCreationException("String_Node_Str");
    }
    exp=expressionExecutors.get(3);
    for (int i=4; i < parameters.length; i++) {
      if (parameters[i] instanceof Variable) {
        Variable var=(Variable)parameters[i];
        String attributeName=var.getAttributeName();
        paramPositions.put(inStreamDefinition.getAttributePosition(attributeName),attributeName);
        paramCount++;
      }
    }
  }
 else {
    exp=expressionExecutors.get(0);
    for (int i=1; i < parameters.length; i++) {
      if (parameters[i] instanceof Variable) {
        Variable var=(Variable)parameters[i];
        String attributeName=var.getAttributeName();
        paramPositions.put(inStreamDefinition.getAttributePosition(attributeName),attributeName);
        paramCount++;
      }
    }
  }
  if (paramCount > SIMPLE_LINREG_INPUT_PARAM_COUNT) {
    throw new QueryCreationException("String_Node_Str");
  }
 else {
    regressionCalculator=new SimpleLinearRegressionCalculator(paramCount,calcInterval,batchSize,ci);
  }
  if (outStreamDefinition == null) {
    this.outStreamDefinition=new StreamDefinition().name("String_Node_Str");
    this.outStreamDefinition.attribute("String_Node_Str",Attribute.Type.DOUBLE);
    this.outStreamDefinition.attribute("String_Node_Str",Attribute.Type.DOUBLE);
    this.outStreamDefinition.attribute("String_Node_Str",Attribute.Type.DOUBLE);
    this.outStreamDefinition.attribute("String_Node_Str",Attribute.Type.DOUBLE);
    for (    Attribute strDef : inStreamDefinition.getAttributeList()) {
      this.outStreamDefinition.attribute(strDef.getName(),strDef.getType());
    }
  }
}

Fixed version (ground truth):
@Override protected void init(Expression[] parameters,List<ExpressionExecutor> expressionExecutors,StreamDefinition inStreamDefinition,StreamDefinition outStreamDefinition,String elementId,SiddhiContext siddhiContext){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + inStreamDefinition.toString());
  }
  if (parameters[1] instanceof IntConstant) {
    try {
      calcInterval=((IntConstant)parameters[0]).getValue();
      batchSize=((IntConstant)parameters[1]).getValue();
    }
 catch (    ClassCastException c) {
      throw new QueryCreationException("String_Node_Str");
    }
    try {
      ci=((DoubleConstant)parameters[2]).getValue();
    }
 catch (    ClassCastException c) {
      throw new QueryCreationException("String_Node_Str");
    }
    exp=expressionExecutors.get(3);
    for (int i=4; i < parameters.length; i++) {
      if (parameters[i] instanceof Variable) {
        Variable var=(Variable)parameters[i];
        String attributeName=var.getAttributeName();
        paramPositions.put(inStreamDefinition.getAttributePosition(attributeName),attributeName);
        paramCount++;
      }
    }
  }
 else {
    exp=expressionExecutors.get(0);
    for (int i=1; i < parameters.length; i++) {
      if (parameters[i] instanceof Variable) {
        Variable var=(Variable)parameters[i];
        String attributeName=var.getAttributeName();
        paramPositions.put(inStreamDefinition.getAttributePosition(attributeName),attributeName);
        paramCount++;
      }
    }
  }
  if (paramCount > SIMPLE_LINREG_INPUT_PARAM_COUNT) {
    throw new QueryCreationException("String_Node_Str");
  }
 else {
    regressionCalculator=new SimpleLinearRegressionCalculator(paramCount,calcInterval,batchSize,ci);
  }
  if (outStreamDefinition == null) {
    this.outStreamDefinition=new StreamDefinition().name("String_Node_Str");
    this.outStreamDefinition.attribute("String_Node_Str",Attribute.Type.DOUBLE);
    this.outStreamDefinition.attribute("String_Node_Str",Attribute.Type.DOUBLE);
    this.outStreamDefinition.attribute("String_Node_Str",Attribute.Type.DOUBLE);
    this.outStreamDefinition.attribute("String_Node_Str",Attribute.Type.DOUBLE);
    for (    Attribute strDef : inStreamDefinition.getAttributeList()) {
      this.outStreamDefinition.attribute(strDef.getName(),strDef.getType());
    }
  }
}