Program: 29223
Project: 29223
Buggy source:
public static void updateVariablePosition(MetaComplexEvent metaComplexEvent,List<VariableExpressionExecutor> variableExpressionExecutorList){
  for (  VariableExpressionExecutor variableExpressionExecutor : variableExpressionExecutorList) {
    int streamEventChainIndex=variableExpressionExecutor.getPosition()[STREAM_EVENT_CHAIN_INDEX];
    if (streamEventChainIndex == HAVING_STATE) {
      if (metaComplexEvent instanceof MetaStreamEvent) {
        variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=OUTPUT_DATA_INDEX;
      }
 else {
        variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=STATE_OUTPUT_DATA_INDEX;
      }
      variableExpressionExecutor.getPosition()[STREAM_EVENT_CHAIN_INDEX]=UNKNOWN_STATE;
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_INDEX]=metaComplexEvent.getOutputStreamDefinition().getAttributeList().indexOf(variableExpressionExecutor.getAttribute());
      continue;
    }
    MetaStreamEvent metaStreamEvent;
    if (metaComplexEvent instanceof MetaStreamEvent) {
      metaStreamEvent=(MetaStreamEvent)metaComplexEvent;
    }
 else {
      metaStreamEvent=((MetaStateEvent)metaComplexEvent).getMetaStreamEvent(streamEventChainIndex);
    }
    if (metaStreamEvent.getOutputData().contains(variableExpressionExecutor.getAttribute())) {
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=OUTPUT_DATA_INDEX;
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_INDEX]=metaStreamEvent.getOutputData().indexOf(variableExpressionExecutor.getAttribute());
    }
 else     if (metaStreamEvent.getOnAfterWindowData().contains(variableExpressionExecutor.getAttribute())) {
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=ON_AFTER_WINDOW_DATA_INDEX;
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_INDEX]=metaStreamEvent.getOnAfterWindowData().indexOf(variableExpressionExecutor.getAttribute());
    }
 else     if (metaStreamEvent.getBeforeWindowData().contains(variableExpressionExecutor.getAttribute())) {
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=BEFORE_WINDOW_DATA_INDEX;
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_INDEX]=metaStreamEvent.getBeforeWindowData().indexOf(variableExpressionExecutor.getAttribute());
    }
  }
}

Fixed version (ground truth):
public static void updateVariablePosition(MetaComplexEvent metaComplexEvent,List<VariableExpressionExecutor> variableExpressionExecutorList){
  for (  VariableExpressionExecutor variableExpressionExecutor : variableExpressionExecutorList) {
    int streamEventChainIndex=variableExpressionExecutor.getPosition()[STREAM_EVENT_CHAIN_INDEX];
    if (streamEventChainIndex == HAVING_STATE) {
      if (metaComplexEvent instanceof MetaStreamEvent) {
        variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=OUTPUT_DATA_INDEX;
      }
 else {
        variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=STATE_OUTPUT_DATA_INDEX;
      }
      variableExpressionExecutor.getPosition()[STREAM_EVENT_CHAIN_INDEX]=UNKNOWN_STATE;
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_INDEX]=metaComplexEvent.getOutputStreamDefinition().getAttributeList().indexOf(variableExpressionExecutor.getAttribute());
      continue;
    }
 else     if (metaComplexEvent instanceof MetaStreamEvent && streamEventChainIndex >= 1) {
      continue;
    }
 else     if (metaComplexEvent instanceof MetaStateEvent && streamEventChainIndex >= ((MetaStateEvent)metaComplexEvent).getMetaStreamEvents().length) {
      continue;
    }
    MetaStreamEvent metaStreamEvent;
    if (metaComplexEvent instanceof MetaStreamEvent) {
      metaStreamEvent=(MetaStreamEvent)metaComplexEvent;
    }
 else {
      metaStreamEvent=((MetaStateEvent)metaComplexEvent).getMetaStreamEvent(streamEventChainIndex);
    }
    if (metaStreamEvent.getOutputData().contains(variableExpressionExecutor.getAttribute())) {
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=OUTPUT_DATA_INDEX;
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_INDEX]=metaStreamEvent.getOutputData().indexOf(variableExpressionExecutor.getAttribute());
    }
 else     if (metaStreamEvent.getOnAfterWindowData().contains(variableExpressionExecutor.getAttribute())) {
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=ON_AFTER_WINDOW_DATA_INDEX;
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_INDEX]=metaStreamEvent.getOnAfterWindowData().indexOf(variableExpressionExecutor.getAttribute());
    }
 else     if (metaStreamEvent.getBeforeWindowData().contains(variableExpressionExecutor.getAttribute())) {
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_TYPE_INDEX]=BEFORE_WINDOW_DATA_INDEX;
      variableExpressionExecutor.getPosition()[STREAM_ATTRIBUTE_INDEX]=metaStreamEvent.getBeforeWindowData().indexOf(variableExpressionExecutor.getAttribute());
    }
  }
}