Program: 29147
Project: 29147
Buggy source:
/** 
 * Match the attribute index values of stream with feature index value of the model
 * @throws Exception
 */
private void populateFeatureAttributeMapping() throws Exception {
  attributeIndexMap=new HashMap<Integer,Integer>();
  Map<String,Integer> featureIndexMap=modelHandler.getFeatures();
  if (attributeSelectionAvailable) {
    int index=0;
    for (    ExpressionExecutor expressionExecutor : attributeExpressionExecutors) {
      if (expressionExecutor instanceof VariableExpressionExecutor) {
        VariableExpressionExecutor variable=(VariableExpressionExecutor)expressionExecutor;
        String variableName=variable.getAttribute().getName();
        if (featureIndexMap.get(variableName) != null) {
          int featureIndex=featureIndexMap.get(variableName);
          int attributeIndex=index;
          attributeIndexMap.put(featureIndex,attributeIndex);
        }
 else {
          throw new ExecutionPlanCreationException("String_Node_Str" + "String_Node_Str" + variableName);
        }
        index++;
      }
    }
  }
 else {
    String[] attributeNames=inputDefinition.getAttributeNameArray();
    for (    String attributeName : attributeNames) {
      if (featureIndexMap.get(attributeName) != null) {
        int featureIndex=featureIndexMap.get(attributeName);
        int attributeIndex=inputDefinition.getAttributePosition(attributeName);
        attributeIndexMap.put(featureIndex,attributeIndex);
      }
 else {
        throw new ExecutionPlanCreationException("String_Node_Str" + "String_Node_Str" + attributeName);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Match the attribute index values of stream with feature index value of the model
 * @throws Exception
 */
private void populateFeatureAttributeMapping() throws Exception {
  attributeIndexMap=new HashMap<Integer,Integer>();
  Map<String,Integer> featureIndexMap=modelHandler.getFeatures();
  List<Integer> newToOldIndicesList=modelHandler.getNewToOldIndicesList();
  if (attributeSelectionAvailable) {
    for (    ExpressionExecutor expressionExecutor : attributeExpressionExecutors) {
      if (expressionExecutor instanceof VariableExpressionExecutor) {
        VariableExpressionExecutor variable=(VariableExpressionExecutor)expressionExecutor;
        String variableName=variable.getAttribute().getName();
        if (featureIndexMap.get(variableName) != null) {
          int featureIndex=featureIndexMap.get(variableName);
          int newFeatureIndex=newToOldIndicesList.indexOf(featureIndex);
          int attributeIndex=inputDefinition.getAttributePosition(variableName);
          attributeIndexMap.put(newFeatureIndex,attributeIndex);
        }
 else {
          throw new ExecutionPlanCreationException("String_Node_Str" + "String_Node_Str" + variableName);
        }
      }
    }
  }
 else {
    String[] attributeNames=inputDefinition.getAttributeNameArray();
    for (    String attributeName : attributeNames) {
      if (featureIndexMap.get(attributeName) != null) {
        int featureIndex=featureIndexMap.get(attributeName);
        int newFeatureIndex=newToOldIndicesList.indexOf(featureIndex);
        int attributeIndex=inputDefinition.getAttributePosition(attributeName);
        attributeIndexMap.put(newFeatureIndex,attributeIndex);
      }
 else {
        throw new ExecutionPlanCreationException("String_Node_Str" + "String_Node_Str" + attributeName);
      }
    }
  }
}