Program: 29054
Project: 29054
Buggy source:
public void buildBloomFilters(){
  this.bloomFilters=new CountingBloomFilter[tableDefinition.getAttributeList().size()];
  this.isBloomFilterEnabled=true;
  for (int i=0; i < bloomFilters.length; i++) {
    bloomFilters[i]=new CountingBloomFilter(bloomFilterSize,bloomFilterHashFunction,Hash.MURMUR_HASH);
  }
  Connection con=null;
  Statement stmt=null;
  try {
    con=dataSource.getConnection();
    stmt=con.createStatement();
    String selectTableRowQuery=constructQuery(tableName,elementMappings.get(RDBMSEventTableConstants.EVENT_TABLE_GENERIC_RDBMS_SELECT_TABLE),null,null,null,null,null);
    ResultSet results=stmt.executeQuery(selectTableRowQuery);
    while (results.next()) {
      for (int i=0; i < bloomFilters.length; i++) {
switch (tableDefinition.getAttributeList().get(i).getType()) {
case INT:
          bloomFilters[i].add(new Key(Integer.toString(results.getInt(i + 1)).getBytes()));
        break;
case LONG:
      bloomFilters[i].add(new Key(Long.toString(results.getLong(i + 1)).getBytes()));
    break;
case FLOAT:
  bloomFilters[i].add(new Key(Float.toString(results.getFloat(i + 1)).getBytes()));
break;
case DOUBLE:
bloomFilters[i].add(new Key(Double.toString(results.getDouble(i + 1)).getBytes()));
break;
case STRING:
bloomFilters[i].add(new Key(results.getString(i + 1).getBytes()));
break;
case BOOL:
bloomFilters[i].add(new Key(Boolean.toString(results.getBoolean(i + 1)).getBytes()));
break;
}
}
}
results.close();
}
 catch (SQLException ex) {
throw new ExecutionPlanRuntimeException("String_Node_Str" + ex.getMessage(),ex);
}
 finally {
cleanUpConnections(stmt,con);
}
}

Fixed version (ground truth):
public void buildBloomFilters(){
  CountingBloomFilter[] bloomFilters=new CountingBloomFilter[tableDefinition.getAttributeList().size()];
  for (int i=0; i < bloomFilters.length; i++) {
    bloomFilters[i]=new CountingBloomFilter(bloomFilterSize,bloomFilterHashFunction,Hash.MURMUR_HASH);
  }
  Connection con=null;
  Statement stmt=null;
  try {
    con=dataSource.getConnection();
    stmt=con.createStatement();
    String selectTableRowQuery=constructQuery(tableName,elementMappings.get(RDBMSEventTableConstants.EVENT_TABLE_GENERIC_RDBMS_SELECT_TABLE),null,null,null,null,null);
    ResultSet results=stmt.executeQuery(selectTableRowQuery);
    while (results.next()) {
      for (int i=0; i < bloomFilters.length; i++) {
switch (tableDefinition.getAttributeList().get(i).getType()) {
case INT:
          bloomFilters[i].add(new Key(Integer.toString(results.getInt(i + 1)).getBytes()));
        break;
case LONG:
      bloomFilters[i].add(new Key(Long.toString(results.getLong(i + 1)).getBytes()));
    break;
case FLOAT:
  bloomFilters[i].add(new Key(Float.toString(results.getFloat(i + 1)).getBytes()));
break;
case DOUBLE:
bloomFilters[i].add(new Key(Double.toString(results.getDouble(i + 1)).getBytes()));
break;
case STRING:
bloomFilters[i].add(new Key(results.getString(i + 1).getBytes()));
break;
case BOOL:
bloomFilters[i].add(new Key(Boolean.toString(results.getBoolean(i + 1)).getBytes()));
break;
}
}
}
results.close();
this.bloomFilters=bloomFilters;
this.isBloomFilterEnabled=true;
}
 catch (SQLException ex) {
throw new ExecutionPlanRuntimeException("String_Node_Str" + ex.getMessage(),ex);
}
 finally {
cleanUpConnections(stmt,con);
}
}