Program: 28931
Project: 28931
Buggy source:
private void buildVariableExecutors(Expression expression,ConditionVisitor conditionVisitor){
  if (expression instanceof And) {
    conditionVisitor.beginVisitAnd();
    conditionVisitor.beginVisitAndLeftOperand();
    buildVariableExecutors(((And)expression).getLeftExpression(),conditionVisitor);
    conditionVisitor.endVisitAndLeftOperand();
    conditionVisitor.beginVisitAndRightOperand();
    buildVariableExecutors(((And)expression).getRightExpression(),conditionVisitor);
    conditionVisitor.endVisitAndRightOperand();
    conditionVisitor.endVisitAnd();
  }
 else   if (expression instanceof Or) {
    conditionVisitor.beginVisitOr();
    conditionVisitor.beginVisitOrLeftOperand();
    buildVariableExecutors(((Or)expression).getLeftExpression(),conditionVisitor);
    conditionVisitor.endVisitOrLeftOperand();
    conditionVisitor.beginVisitOrRightOperand();
    buildVariableExecutors(((Or)expression).getRightExpression(),conditionVisitor);
    conditionVisitor.endVisitOrRightOperand();
    conditionVisitor.endVisitOr();
  }
 else   if (expression instanceof Not) {
    conditionVisitor.beginVisitNot();
    buildVariableExecutors(((Not)expression).getExpression(),conditionVisitor);
    conditionVisitor.endVisitNot();
  }
 else   if (expression instanceof Compare) {
    conditionVisitor.beginVisitCompare(((Compare)expression).getOperator());
    conditionVisitor.beginVisitCompareLeftOperand(((Compare)expression).getOperator());
    buildVariableExecutors(((Compare)expression).getLeftExpression(),conditionVisitor);
    conditionVisitor.endVisitCompareLeftOperand(((Compare)expression).getOperator());
    conditionVisitor.beginVisitCompareRightOperand(((Compare)expression).getOperator());
    buildVariableExecutors(((Compare)expression).getRightExpression(),conditionVisitor);
    conditionVisitor.endVisitCompareRightOperand(((Compare)expression).getOperator());
    conditionVisitor.endVisitCompare(((Compare)expression).getOperator());
  }
 else   if (expression instanceof Add) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.ADD);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.ADD);
    buildVariableExecutors(((Add)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.ADD);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.ADD);
    buildVariableExecutors(((Add)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.ADD);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.ADD);
  }
 else   if (expression instanceof Subtract) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.SUBTRACT);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.SUBTRACT);
    buildVariableExecutors(((Subtract)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.SUBTRACT);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.SUBTRACT);
    buildVariableExecutors(((Subtract)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.SUBTRACT);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.SUBTRACT);
  }
 else   if (expression instanceof Divide) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.DIVIDE);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.DIVIDE);
    buildVariableExecutors(((Divide)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.DIVIDE);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.DIVIDE);
    buildVariableExecutors(((Divide)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.DIVIDE);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.DIVIDE);
  }
 else   if (expression instanceof Multiply) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.MULTIPLY);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.MULTIPLY);
    buildVariableExecutors(((Multiply)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.MULTIPLY);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.MULTIPLY);
    buildVariableExecutors(((Multiply)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.MULTIPLY);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.MULTIPLY);
  }
 else   if (expression instanceof Mod) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.MOD);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.MOD);
    buildVariableExecutors(((Mod)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.MOD);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.MOD);
    buildVariableExecutors(((Mod)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.MOD);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.MOD);
  }
 else   if (expression instanceof IsNull) {
    IsNull isNull=(IsNull)expression;
    if (isNull.getExpression() != null) {
      conditionVisitor.beginVisitIsNull(null);
      buildVariableExecutors(((IsNull)expression).getExpression(),conditionVisitor);
      conditionVisitor.endVisitIsNull(null);
    }
 else {
      String streamId=isNull.getStreamId();
      MetaStateEvent metaStateEvent=matchingMetaInfoHolder.getMetaStateEvent();
      if (streamId == null) {
        throw new ExecutionPlanCreationException("String_Node_Str");
      }
 else {
        AbstractDefinition definitionOutput=null;
        MetaStreamEvent[] metaStreamEvents=metaStateEvent.getMetaStreamEvents();
        for (int i=0, metaStreamEventsLength=metaStreamEvents.length; i < metaStreamEventsLength; i++) {
          MetaStreamEvent metaStreamEvent=metaStreamEvents[i];
          AbstractDefinition definition=metaStreamEvent.getLastInputDefinition();
          if (metaStreamEvent.getInputReferenceId() == null) {
            if (definition.getId().equals(streamId)) {
              definitionOutput=definition;
              break;
            }
          }
 else {
            if (metaStreamEvent.getInputReferenceId().equals(streamId)) {
              definitionOutput=definition;
              break;
            }
          }
        }
        if (definitionOutput != null) {
          conditionVisitor.beginVisitIsNull(definitionOutput.getId());
          conditionVisitor.endVisitIsNull(definitionOutput.getId());
        }
 else {
          conditionVisitor.beginVisitIsNull(null);
          conditionVisitor.endVisitIsNull(null);
        }
      }
    }
  }
 else   if (expression instanceof In) {
    conditionVisitor.beginVisitIn(((In)expression).getSourceId());
    buildVariableExecutors(((In)expression).getExpression(),conditionVisitor);
    conditionVisitor.endVisitIn(((In)expression).getSourceId());
  }
 else   if (expression instanceof Constant) {
    if (expression instanceof DoubleConstant) {
      conditionVisitor.beginVisitConstant(((DoubleConstant)expression).getValue(),Attribute.Type.BOOL);
      conditionVisitor.endVisitConstant(((DoubleConstant)expression).getValue(),Attribute.Type.BOOL);
    }
 else     if (expression instanceof StringConstant) {
      conditionVisitor.beginVisitConstant(((StringConstant)expression).getValue(),Attribute.Type.STRING);
      conditionVisitor.endVisitConstant(((StringConstant)expression).getValue(),Attribute.Type.STRING);
    }
 else     if (expression instanceof IntConstant) {
      conditionVisitor.beginVisitConstant(((IntConstant)expression).getValue(),Attribute.Type.INT);
      conditionVisitor.endVisitConstant(((IntConstant)expression).getValue(),Attribute.Type.INT);
    }
 else     if (expression instanceof BoolConstant) {
      conditionVisitor.beginVisitConstant(((BoolConstant)expression).getValue(),Attribute.Type.BOOL);
      conditionVisitor.endVisitConstant(((BoolConstant)expression).getValue(),Attribute.Type.BOOL);
    }
 else     if (expression instanceof FloatConstant) {
      conditionVisitor.beginVisitConstant(((FloatConstant)expression).getValue(),Attribute.Type.FLOAT);
      conditionVisitor.endVisitConstant(((FloatConstant)expression).getValue(),Attribute.Type.FLOAT);
    }
 else     if (expression instanceof LongConstant) {
      conditionVisitor.beginVisitConstant(((LongConstant)expression).getValue(),Attribute.Type.LONG);
      conditionVisitor.endVisitConstant(((LongConstant)expression).getValue(),Attribute.Type.LONG);
    }
 else {
      throw new OperationNotSupportedException("String_Node_Str" + expression.getClass().getName());
    }
  }
 else   if (expression instanceof AttributeFunction) {
    conditionVisitor.beginVisitAttributeFunction(((AttributeFunction)expression).getNamespace(),((AttributeFunction)expression).getName());
    Expression[] expressions=((AttributeFunction)expression).getParameters();
    for (int i=0; i < expressions.length; i++) {
      conditionVisitor.beginVisitParameterAttributeFunction(i);
      buildVariableExecutors(expressions[i],conditionVisitor);
      conditionVisitor.endVisitParameterAttributeFunction(i);
    }
    conditionVisitor.endVisitAttributeFunction(((AttributeFunction)expression).getNamespace(),((AttributeFunction)expression).getName());
  }
 else   if (expression instanceof Variable) {
    Variable variable=((Variable)expression);
    String attributeName=variable.getAttributeName();
    AbstractDefinition definition;
    Attribute.Type type=null;
    int streamEventChainIndex=UNKNOWN_STATE;
    if (variable.getStreamId() == null) {
      MetaStreamEvent[] metaStreamEvents=matchingMetaInfoHolder.getMetaStateEvent().getMetaStreamEvents();
      if (matchingMetaInfoHolder.getCurrentState() == UNKNOWN_STATE) {
        String firstInput=null;
        for (int i=0; i < metaStreamEvents.length; i++) {
          MetaStreamEvent metaStreamEvent=metaStreamEvents[i];
          definition=metaStreamEvent.getLastInputDefinition();
          if (type == null) {
            try {
              type=definition.getAttributeType(attributeName);
              firstInput="String_Node_Str" + definition.getId() + "String_Node_Str"+ "String_Node_Str"+ metaStreamEvent.getInputReferenceId();
              streamEventChainIndex=i;
            }
 catch (            AttributeNotExistException e) {
            }
          }
 else {
            try {
              definition.getAttributeType(attributeName);
              throw new ExecutionPlanValidationException(firstInput + "String_Node_Str" + definition.getId()+ "String_Node_Str"+ "String_Node_Str"+ metaStreamEvent.getInputReferenceId()+ "String_Node_Str"+ "String_Node_Str"+ attributeName+ "String_Node_Str");
            }
 catch (            AttributeNotExistException e) {
            }
          }
        }
        if (streamEventChainIndex != UNKNOWN_STATE) {
          if (matchingMetaInfoHolder.getMatchingStreamEventIndex() == streamEventChainIndex) {
            buildStreamVariableExecutor(variable,streamEventChainIndex,conditionVisitor,type);
          }
 else {
            buildStoreVariableExecutor(variable,conditionVisitor,type,matchingMetaInfoHolder.getStoreDefinition());
          }
        }
      }
 else {
        MetaStreamEvent metaStreamEvent=matchingMetaInfoHolder.getMetaStateEvent().getMetaStreamEvent(matchingMetaInfoHolder.getCurrentState());
        definition=metaStreamEvent.getLastInputDefinition();
        try {
          type=definition.getAttributeType(attributeName);
        }
 catch (        AttributeNotExistException e) {
          throw new ExecutionPlanValidationException(e.getMessage() + "String_Node_Str" + definition.getId()+ "String_Node_Str"+ "String_Node_Str"+ metaStreamEvent.getInputReferenceId());
        }
        if (matchingMetaInfoHolder.getCurrentState() == matchingMetaInfoHolder.getMatchingStreamEventIndex()) {
          buildStreamVariableExecutor(variable,streamEventChainIndex,conditionVisitor,type);
        }
 else {
          buildStoreVariableExecutor(variable,conditionVisitor,type,matchingMetaInfoHolder.getStoreDefinition());
        }
      }
    }
 else {
      MetaStreamEvent[] metaStreamEvents=matchingMetaInfoHolder.getMetaStateEvent().getMetaStreamEvents();
      for (int i=0, metaStreamEventsLength=metaStreamEvents.length; i < metaStreamEventsLength; i++) {
        MetaStreamEvent metaStreamEvent=metaStreamEvents[i];
        definition=metaStreamEvent.getLastInputDefinition();
        if (metaStreamEvent.getInputReferenceId() == null) {
          if (definition.getId().equals(variable.getStreamId())) {
            type=definition.getAttributeType(attributeName);
            streamEventChainIndex=i;
            break;
          }
        }
 else {
          if (metaStreamEvent.getInputReferenceId().equals(variable.getStreamId())) {
            type=definition.getAttributeType(attributeName);
            streamEventChainIndex=i;
            break;
          }
        }
      }
      if (matchingMetaInfoHolder.getMatchingStreamEventIndex() == streamEventChainIndex) {
        buildStreamVariableExecutor(variable,streamEventChainIndex,conditionVisitor,type);
      }
 else {
        buildStoreVariableExecutor(variable,conditionVisitor,type,matchingMetaInfoHolder.getStoreDefinition());
      }
    }
  }
}

Fixed version (ground truth):
private void buildVariableExecutors(Expression expression,ConditionVisitor conditionVisitor){
  if (expression instanceof And) {
    conditionVisitor.beginVisitAnd();
    conditionVisitor.beginVisitAndLeftOperand();
    buildVariableExecutors(((And)expression).getLeftExpression(),conditionVisitor);
    conditionVisitor.endVisitAndLeftOperand();
    conditionVisitor.beginVisitAndRightOperand();
    buildVariableExecutors(((And)expression).getRightExpression(),conditionVisitor);
    conditionVisitor.endVisitAndRightOperand();
    conditionVisitor.endVisitAnd();
  }
 else   if (expression instanceof Or) {
    conditionVisitor.beginVisitOr();
    conditionVisitor.beginVisitOrLeftOperand();
    buildVariableExecutors(((Or)expression).getLeftExpression(),conditionVisitor);
    conditionVisitor.endVisitOrLeftOperand();
    conditionVisitor.beginVisitOrRightOperand();
    buildVariableExecutors(((Or)expression).getRightExpression(),conditionVisitor);
    conditionVisitor.endVisitOrRightOperand();
    conditionVisitor.endVisitOr();
  }
 else   if (expression instanceof Not) {
    conditionVisitor.beginVisitNot();
    buildVariableExecutors(((Not)expression).getExpression(),conditionVisitor);
    conditionVisitor.endVisitNot();
  }
 else   if (expression instanceof Compare) {
    conditionVisitor.beginVisitCompare(((Compare)expression).getOperator());
    conditionVisitor.beginVisitCompareLeftOperand(((Compare)expression).getOperator());
    buildVariableExecutors(((Compare)expression).getLeftExpression(),conditionVisitor);
    conditionVisitor.endVisitCompareLeftOperand(((Compare)expression).getOperator());
    conditionVisitor.beginVisitCompareRightOperand(((Compare)expression).getOperator());
    buildVariableExecutors(((Compare)expression).getRightExpression(),conditionVisitor);
    conditionVisitor.endVisitCompareRightOperand(((Compare)expression).getOperator());
    conditionVisitor.endVisitCompare(((Compare)expression).getOperator());
  }
 else   if (expression instanceof Add) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.ADD);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.ADD);
    buildVariableExecutors(((Add)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.ADD);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.ADD);
    buildVariableExecutors(((Add)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.ADD);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.ADD);
  }
 else   if (expression instanceof Subtract) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.SUBTRACT);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.SUBTRACT);
    buildVariableExecutors(((Subtract)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.SUBTRACT);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.SUBTRACT);
    buildVariableExecutors(((Subtract)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.SUBTRACT);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.SUBTRACT);
  }
 else   if (expression instanceof Divide) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.DIVIDE);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.DIVIDE);
    buildVariableExecutors(((Divide)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.DIVIDE);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.DIVIDE);
    buildVariableExecutors(((Divide)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.DIVIDE);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.DIVIDE);
  }
 else   if (expression instanceof Multiply) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.MULTIPLY);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.MULTIPLY);
    buildVariableExecutors(((Multiply)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.MULTIPLY);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.MULTIPLY);
    buildVariableExecutors(((Multiply)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.MULTIPLY);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.MULTIPLY);
  }
 else   if (expression instanceof Mod) {
    conditionVisitor.beginVisitMath(ConditionVisitor.MathOperator.MOD);
    conditionVisitor.beginVisitMathLeftOperand(ConditionVisitor.MathOperator.MOD);
    buildVariableExecutors(((Mod)expression).getLeftValue(),conditionVisitor);
    conditionVisitor.endVisitMathLeftOperand(ConditionVisitor.MathOperator.MOD);
    conditionVisitor.beginVisitMathRightOperand(ConditionVisitor.MathOperator.MOD);
    buildVariableExecutors(((Mod)expression).getRightValue(),conditionVisitor);
    conditionVisitor.endVisitMathRightOperand(ConditionVisitor.MathOperator.MOD);
    conditionVisitor.endVisitMath(ConditionVisitor.MathOperator.MOD);
  }
 else   if (expression instanceof IsNull) {
    IsNull isNull=(IsNull)expression;
    if (isNull.getExpression() != null) {
      conditionVisitor.beginVisitIsNull(null);
      buildVariableExecutors(((IsNull)expression).getExpression(),conditionVisitor);
      conditionVisitor.endVisitIsNull(null);
    }
 else {
      String streamId=isNull.getStreamId();
      MetaStateEvent metaStateEvent=matchingMetaInfoHolder.getMetaStateEvent();
      if (streamId == null) {
        throw new ExecutionPlanCreationException("String_Node_Str");
      }
 else {
        AbstractDefinition definitionOutput=null;
        MetaStreamEvent[] metaStreamEvents=metaStateEvent.getMetaStreamEvents();
        for (int i=0, metaStreamEventsLength=metaStreamEvents.length; i < metaStreamEventsLength; i++) {
          MetaStreamEvent metaStreamEvent=metaStreamEvents[i];
          AbstractDefinition definition=metaStreamEvent.getLastInputDefinition();
          if (metaStreamEvent.getInputReferenceId() == null) {
            if (definition.getId().equals(streamId)) {
              definitionOutput=definition;
              break;
            }
          }
 else {
            if (metaStreamEvent.getInputReferenceId().equals(streamId)) {
              definitionOutput=definition;
              break;
            }
          }
        }
        if (definitionOutput != null) {
          conditionVisitor.beginVisitIsNull(definitionOutput.getId());
          conditionVisitor.endVisitIsNull(definitionOutput.getId());
        }
 else {
          conditionVisitor.beginVisitIsNull(null);
          conditionVisitor.endVisitIsNull(null);
        }
      }
    }
  }
 else   if (expression instanceof In) {
    conditionVisitor.beginVisitIn(((In)expression).getSourceId());
    buildVariableExecutors(((In)expression).getExpression(),conditionVisitor);
    conditionVisitor.endVisitIn(((In)expression).getSourceId());
  }
 else   if (expression instanceof Constant) {
    if (expression instanceof DoubleConstant) {
      conditionVisitor.beginVisitConstant(((DoubleConstant)expression).getValue(),Attribute.Type.BOOL);
      conditionVisitor.endVisitConstant(((DoubleConstant)expression).getValue(),Attribute.Type.BOOL);
    }
 else     if (expression instanceof StringConstant) {
      conditionVisitor.beginVisitConstant(((StringConstant)expression).getValue(),Attribute.Type.STRING);
      conditionVisitor.endVisitConstant(((StringConstant)expression).getValue(),Attribute.Type.STRING);
    }
 else     if (expression instanceof IntConstant) {
      conditionVisitor.beginVisitConstant(((IntConstant)expression).getValue(),Attribute.Type.INT);
      conditionVisitor.endVisitConstant(((IntConstant)expression).getValue(),Attribute.Type.INT);
    }
 else     if (expression instanceof BoolConstant) {
      conditionVisitor.beginVisitConstant(((BoolConstant)expression).getValue(),Attribute.Type.BOOL);
      conditionVisitor.endVisitConstant(((BoolConstant)expression).getValue(),Attribute.Type.BOOL);
    }
 else     if (expression instanceof FloatConstant) {
      conditionVisitor.beginVisitConstant(((FloatConstant)expression).getValue(),Attribute.Type.FLOAT);
      conditionVisitor.endVisitConstant(((FloatConstant)expression).getValue(),Attribute.Type.FLOAT);
    }
 else     if (expression instanceof LongConstant) {
      conditionVisitor.beginVisitConstant(((LongConstant)expression).getValue(),Attribute.Type.LONG);
      conditionVisitor.endVisitConstant(((LongConstant)expression).getValue(),Attribute.Type.LONG);
    }
 else {
      throw new OperationNotSupportedException("String_Node_Str" + expression.getClass().getName());
    }
  }
 else   if (expression instanceof AttributeFunction) {
    conditionVisitor.beginVisitAttributeFunction(((AttributeFunction)expression).getNamespace(),((AttributeFunction)expression).getName());
    Expression[] expressions=((AttributeFunction)expression).getParameters();
    for (int i=0; i < expressions.length; i++) {
      conditionVisitor.beginVisitParameterAttributeFunction(i);
      buildVariableExecutors(expressions[i],conditionVisitor);
      conditionVisitor.endVisitParameterAttributeFunction(i);
    }
    conditionVisitor.endVisitAttributeFunction(((AttributeFunction)expression).getNamespace(),((AttributeFunction)expression).getName());
  }
 else   if (expression instanceof Variable) {
    Variable variable=((Variable)expression);
    String attributeName=variable.getAttributeName();
    AbstractDefinition definition;
    Attribute.Type type=null;
    int streamEventChainIndex=matchingMetaInfoHolder.getCurrentState();
    if (variable.getStreamId() == null) {
      MetaStreamEvent[] metaStreamEvents=matchingMetaInfoHolder.getMetaStateEvent().getMetaStreamEvents();
      if (streamEventChainIndex == UNKNOWN_STATE) {
        String firstInput=null;
        for (int i=0; i < metaStreamEvents.length; i++) {
          MetaStreamEvent metaStreamEvent=metaStreamEvents[i];
          definition=metaStreamEvent.getLastInputDefinition();
          if (type == null) {
            try {
              type=definition.getAttributeType(attributeName);
              firstInput="String_Node_Str" + definition.getId() + "String_Node_Str"+ "String_Node_Str"+ metaStreamEvent.getInputReferenceId();
              streamEventChainIndex=i;
            }
 catch (            AttributeNotExistException e) {
            }
          }
 else {
            try {
              definition.getAttributeType(attributeName);
              throw new ExecutionPlanValidationException(firstInput + "String_Node_Str" + definition.getId()+ "String_Node_Str"+ "String_Node_Str"+ metaStreamEvent.getInputReferenceId()+ "String_Node_Str"+ "String_Node_Str"+ attributeName+ "String_Node_Str");
            }
 catch (            AttributeNotExistException e) {
            }
          }
        }
        if (streamEventChainIndex != UNKNOWN_STATE) {
          if (matchingMetaInfoHolder.getMatchingStreamEventIndex() == streamEventChainIndex) {
            buildStreamVariableExecutor(variable,streamEventChainIndex,conditionVisitor,type);
          }
 else {
            buildStoreVariableExecutor(variable,conditionVisitor,type,matchingMetaInfoHolder.getStoreDefinition());
          }
        }
      }
 else {
        MetaStreamEvent metaStreamEvent=matchingMetaInfoHolder.getMetaStateEvent().getMetaStreamEvent(matchingMetaInfoHolder.getCurrentState());
        definition=metaStreamEvent.getLastInputDefinition();
        try {
          type=definition.getAttributeType(attributeName);
        }
 catch (        AttributeNotExistException e) {
          throw new ExecutionPlanValidationException(e.getMessage() + "String_Node_Str" + definition.getId()+ "String_Node_Str"+ "String_Node_Str"+ metaStreamEvent.getInputReferenceId());
        }
        if (matchingMetaInfoHolder.getCurrentState() == matchingMetaInfoHolder.getMatchingStreamEventIndex()) {
          buildStreamVariableExecutor(variable,streamEventChainIndex,conditionVisitor,type);
        }
 else {
          buildStoreVariableExecutor(variable,conditionVisitor,type,matchingMetaInfoHolder.getStoreDefinition());
        }
      }
    }
 else {
      MetaStreamEvent[] metaStreamEvents=matchingMetaInfoHolder.getMetaStateEvent().getMetaStreamEvents();
      for (int i=0, metaStreamEventsLength=metaStreamEvents.length; i < metaStreamEventsLength; i++) {
        MetaStreamEvent metaStreamEvent=metaStreamEvents[i];
        definition=metaStreamEvent.getLastInputDefinition();
        if (metaStreamEvent.getInputReferenceId() == null) {
          if (definition.getId().equals(variable.getStreamId())) {
            type=definition.getAttributeType(attributeName);
            streamEventChainIndex=i;
            break;
          }
        }
 else {
          if (metaStreamEvent.getInputReferenceId().equals(variable.getStreamId())) {
            type=definition.getAttributeType(attributeName);
            streamEventChainIndex=i;
            break;
          }
        }
      }
      if (matchingMetaInfoHolder.getMatchingStreamEventIndex() == streamEventChainIndex) {
        buildStreamVariableExecutor(variable,streamEventChainIndex,conditionVisitor,type);
      }
 else {
        buildStoreVariableExecutor(variable,conditionVisitor,type,matchingMetaInfoHolder.getStoreDefinition());
      }
    }
  }
}