Program: 63334
Project: 63334
Buggy source:
private void loadLookupTableValues(String lookupTableName,LinkedList<String> columnNames,int distinctRowCount) throws Exception {
  KylinConfig config=KylinConfig.getInstanceFromEnv();
  if (columnNames.size() > 1 && !lookupTableCompositeKeyValues.containsKey(lookupTableName)) {
    lookupTableCompositeKeyValues.put(lookupTableName,new HashSet<Array<String>>());
  }
  InputStream tableStream=null;
  BufferedReader tableReader=null;
  try {
    Hashtable<String,Integer> zeroBasedInice=new Hashtable<String,Integer>();
    for (    String columnName : columnNames) {
      ColumnDesc cDesc=MetadataManager.getInstance(config).getTableDesc(lookupTableName).findColumnByName(columnName);
      zeroBasedInice.put(columnName,cDesc.getZeroBasedIndex());
    }
    String path="String_Node_Str" + lookupTableName + "String_Node_Str";
    tableStream=store.getResource(path);
    tableReader=new BufferedReader(new InputStreamReader(tableStream));
    int rowCount=0;
    int curRowNum=0;
    String curRow;
    while (tableReader.readLine() != null)     rowCount++;
    HashSet<Integer> rows=new HashSet<Integer>();
    distinctRowCount=(distinctRowCount < rowCount) ? distinctRowCount : rowCount;
    while (rows.size() < distinctRowCount) {
      rows.add(new Integer(r.nextInt(rowCount)));
    }
    tableStream.close();
    tableReader.close();
    tableStream=store.getResource(path);
    tableReader=new BufferedReader(new InputStreamReader(tableStream));
    while ((curRow=tableReader.readLine()) != null) {
      if (rows.contains(curRowNum)) {
        String[] tokens=curRow.split("String_Node_Str");
        String[] comboKeys=null;
        int index=0;
        if (columnNames.size() > 1)         comboKeys=new String[columnNames.size()];
        for (        String columnName : columnNames) {
          int zeroBasedIndex=zeroBasedInice.get(columnName);
          if (!feasibleValues.containsKey(lookupTableName + "String_Node_Str" + columnName))           feasibleValues.put(lookupTableName + "String_Node_Str" + columnName,new ArrayList<String>());
          feasibleValues.get(lookupTableName + "String_Node_Str" + columnName).add(tokens[zeroBasedIndex]);
          if (columnNames.size() > 1) {
            comboKeys[index]=tokens[zeroBasedIndex];
            index++;
          }
        }
        if (columnNames.size() > 1) {
          Array<String> wrap=new Array<String>(comboKeys);
          if (lookupTableCompositeKeyValues.get(lookupTableName).contains(wrap)) {
            throw new Exception("String_Node_Str");
          }
          lookupTableCompositeKeyValues.get(lookupTableName).add(wrap);
        }
      }
      curRowNum++;
    }
    if (tableStream != null)     tableStream.close();
    if (tableReader != null)     tableReader.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
    System.exit(1);
  }
}

Fixed version (ground truth):
private void loadLookupTableValues(String lookupTableName,LinkedList<String> columnNames,int distinctRowCount) throws Exception {
  KylinConfig config=KylinConfig.getInstanceFromEnv();
  if (columnNames.size() > 1 && !lookupTableCompositeKeyValues.containsKey(lookupTableName)) {
    lookupTableCompositeKeyValues.put(lookupTableName,new HashSet<Array<String>>());
  }
  InputStream tableStream=null;
  BufferedReader tableReader=null;
  try {
    Hashtable<String,Integer> zeroBasedInice=new Hashtable<String,Integer>();
    for (    String columnName : columnNames) {
      ColumnDesc cDesc=MetadataManager.getInstance(config).getTableDesc(lookupTableName).findColumnByName(columnName);
      zeroBasedInice.put(columnName,cDesc.getZeroBasedIndex());
    }
    String path="String_Node_Str" + lookupTableName + "String_Node_Str";
    tableStream=store.getResource(path);
    tableReader=new BufferedReader(new InputStreamReader(tableStream));
    tableReader.mark(0);
    int rowCount=0;
    int curRowNum=0;
    String curRow;
    while (tableReader.readLine() != null)     rowCount++;
    HashSet<Integer> rows=new HashSet<Integer>();
    distinctRowCount=(distinctRowCount < rowCount) ? distinctRowCount : rowCount;
    while (rows.size() < distinctRowCount) {
      rows.add(r.nextInt(rowCount));
    }
    tableStream.close();
    tableReader.close();
    tableStream=null;
    tableReader=null;
    tableStream=store.getResource(path);
    tableReader=new BufferedReader(new InputStreamReader(tableStream));
    while ((curRow=tableReader.readLine()) != null) {
      if (rows.contains(curRowNum)) {
        String[] tokens=curRow.split("String_Node_Str");
        String[] comboKeys=null;
        int index=0;
        if (columnNames.size() > 1)         comboKeys=new String[columnNames.size()];
        for (        String columnName : columnNames) {
          int zeroBasedIndex=zeroBasedInice.get(columnName);
          if (!feasibleValues.containsKey(lookupTableName + "String_Node_Str" + columnName))           feasibleValues.put(lookupTableName + "String_Node_Str" + columnName,new ArrayList<String>());
          feasibleValues.get(lookupTableName + "String_Node_Str" + columnName).add(tokens[zeroBasedIndex]);
          if (columnNames.size() > 1) {
            comboKeys[index]=tokens[zeroBasedIndex];
            index++;
          }
        }
        if (columnNames.size() > 1) {
          Array<String> wrap=new Array<String>(comboKeys);
          if (lookupTableCompositeKeyValues.get(lookupTableName).contains(wrap)) {
            throw new Exception("String_Node_Str");
          }
          lookupTableCompositeKeyValues.get(lookupTableName).add(wrap);
        }
      }
      curRowNum++;
    }
    if (tableStream != null)     tableStream.close();
    if (tableReader != null)     tableReader.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
    System.exit(1);
  }
}