Program: 28752
Project: 28752
Buggy source:
public IndexEventHolder(StreamEventPool tableStreamEventPool,StreamEventConverter eventConverter,PrimaryKeyReferenceHolder[] primaryKeyReferenceHolders,boolean isPrimaryNumeric,Map<String,Integer> indexMetaData){
  this.tableStreamEventPool=tableStreamEventPool;
  this.eventConverter=eventConverter;
  this.primaryKeyReferenceHolders=primaryKeyReferenceHolders;
  this.indexMetaData=indexMetaData;
  if (primaryKeyReferenceHolders != null) {
    if (isPrimaryNumeric) {
      primaryKeyData=new TreeMap<Object,StreamEvent>();
    }
 else {
      primaryKeyData=new HashMap<Object,StreamEvent>();
    }
    if (primaryKeyReferenceHolders.length == 1) {
      allIndexMetaData.put(primaryKeyReferenceHolders[0].getPrimaryKeyAttribute(),primaryKeyReferenceHolders[0].getPrimaryKeyPosition());
      primaryKeyAttributes=primaryKeyReferenceHolders[0].getPrimaryKeyAttribute();
    }
 else {
      StringBuilder primaryKeyAttributesBuilder=new StringBuilder();
      for (      PrimaryKeyReferenceHolder primaryKeyReferenceHolder : primaryKeyReferenceHolders) {
        multiPrimaryKeyMetaData.put(primaryKeyReferenceHolder.getPrimaryKeyAttribute(),primaryKeyReferenceHolder.getPrimaryKeyPosition());
        primaryKeyAttributesBuilder.append(primaryKeyReferenceHolder.getPrimaryKeyAttribute()).append(SiddhiConstants.KEY_DELIMITER);
      }
      primaryKeyAttributes=primaryKeyAttributesBuilder.toString();
    }
  }
 else {
    primaryKeyData=null;
  }
  if (indexMetaData.size() > 0) {
    indexData=new HashMap<String,TreeMap<Object,Set<StreamEvent>>>();
    for (    String indexAttributeName : indexMetaData.keySet()) {
      indexData.put(indexAttributeName,new TreeMap<Object,Set<StreamEvent>>());
    }
    allIndexMetaData.putAll(indexMetaData);
  }
 else {
    indexData=null;
  }
}

Fixed version (ground truth):
public IndexEventHolder(StreamEventPool tableStreamEventPool,StreamEventConverter eventConverter,PrimaryKeyReferenceHolder[] primaryKeyReferenceHolders,boolean isPrimaryNumeric,Map<String,Integer> indexMetaData,AbstractDefinition tableDefinition,SiddhiAppContext siddhiAppContext){
  this.tableStreamEventPool=tableStreamEventPool;
  this.eventConverter=eventConverter;
  this.primaryKeyReferenceHolders=primaryKeyReferenceHolders;
  this.indexMetaData=indexMetaData;
  this.tableName=tableDefinition.getId();
  this.siddhiAppName=siddhiAppContext.getName();
  if (primaryKeyReferenceHolders != null) {
    if (isPrimaryNumeric) {
      primaryKeyData=new TreeMap<Object,StreamEvent>();
    }
 else {
      primaryKeyData=new HashMap<Object,StreamEvent>();
    }
    if (primaryKeyReferenceHolders.length == 1) {
      allIndexMetaData.put(primaryKeyReferenceHolders[0].getPrimaryKeyAttribute(),primaryKeyReferenceHolders[0].getPrimaryKeyPosition());
      primaryKeyAttributes=primaryKeyReferenceHolders[0].getPrimaryKeyAttribute();
    }
 else {
      StringBuilder primaryKeyAttributesBuilder=new StringBuilder();
      for (      PrimaryKeyReferenceHolder primaryKeyReferenceHolder : primaryKeyReferenceHolders) {
        multiPrimaryKeyMetaData.put(primaryKeyReferenceHolder.getPrimaryKeyAttribute(),primaryKeyReferenceHolder.getPrimaryKeyPosition());
        primaryKeyAttributesBuilder.append(primaryKeyReferenceHolder.getPrimaryKeyAttribute()).append(SiddhiConstants.KEY_DELIMITER);
      }
      primaryKeyAttributes=primaryKeyAttributesBuilder.toString();
    }
  }
 else {
    primaryKeyData=null;
  }
  if (indexMetaData.size() > 0) {
    indexData=new HashMap<String,TreeMap<Object,Set<StreamEvent>>>();
    for (    String indexAttributeName : indexMetaData.keySet()) {
      indexData.put(indexAttributeName,new TreeMap<Object,Set<StreamEvent>>());
    }
    allIndexMetaData.putAll(indexMetaData);
  }
 else {
    indexData=null;
  }
}