Program: 42568
Project: 42568
Buggy source:
@Override public Workflow getWorkflow(long modelId) throws DatabaseHandlerException {
  Connection connection=null;
  ResultSet result=null;
  PreparedStatement getStatement=null;
  try {
    Workflow mlWorkflow=new Workflow();
    mlWorkflow.setWorkflowID(modelId);
    connection=dbh.getDataSource().getConnection();
    connection.setAutoCommit(false);
    List<Feature> mlFeatures=new ArrayList<Feature>();
    getStatement=connection.prepareStatement(SQLQueries.GET_CUSTOMIZED_FEATURES);
    getStatement.setLong(1,modelId);
    result=getStatement.executeQuery();
    while (result.next()) {
      if (result.getBoolean(5) == true) {
        Feature mlFeature=new Feature();
        mlFeature.setName(result.getString(1));
        mlFeature.setIndex(result.getInt(2));
        mlFeature.setType(result.getString(3));
        mlFeature.setImputeOption(result.getString(4));
        mlFeature.setInclude(result.getBoolean(5));
        mlFeatures.add(mlFeature);
      }
    }
    mlWorkflow.setFeatures(mlFeatures);
    mlWorkflow.setAlgorithmName(getAStringModelConfiguration(modelId,MLConstants.ALGORITHM_NAME));
    mlWorkflow.setAlgorithmClass(getAStringModelConfiguration(modelId,MLConstants.ALGORITHM_TYPE));
    mlWorkflow.setResponseVariable(getAStringModelConfiguration(modelId,MLConstants.RESPONSE));
    mlWorkflow.setTrainDataFraction(Double.valueOf(getAStringModelConfiguration(modelId,MLConstants.TRAIN_DATA_FRACTION)));
    mlWorkflow.setHyperParameters(getHyperParametersOfModelAsMap(modelId));
    return mlWorkflow;
  }
 catch (  SQLException e) {
    throw new DatabaseHandlerException(e.getMessage(),e);
  }
 finally {
    MLDatabaseUtils.enableAutoCommit(connection);
    MLDatabaseUtils.closeDatabaseResources(connection,getStatement,result);
  }
}

Fixed version (ground truth):
@Override public Workflow getWorkflow(long modelId) throws DatabaseHandlerException {
  Connection connection=null;
  ResultSet result=null;
  PreparedStatement getStatement=null;
  ResultSet analysisIdResult=null;
  PreparedStatement getAnalysisIdStatement=null;
  try {
    Workflow mlWorkflow=new Workflow();
    mlWorkflow.setWorkflowID(modelId);
    connection=dbh.getDataSource().getConnection();
    connection.setAutoCommit(false);
    List<Feature> mlFeatures=new ArrayList<Feature>();
    getStatement=connection.prepareStatement(SQLQueries.GET_CUSTOMIZED_FEATURES);
    getStatement.setLong(1,modelId);
    result=getStatement.executeQuery();
    while (result.next()) {
      if (result.getBoolean(5) == true) {
        Feature mlFeature=new Feature();
        mlFeature.setName(result.getString(1));
        mlFeature.setIndex(result.getInt(2));
        mlFeature.setType(result.getString(3));
        mlFeature.setImputeOption(result.getString(4));
        mlFeature.setInclude(result.getBoolean(5));
        mlFeatures.add(mlFeature);
      }
    }
    mlWorkflow.setFeatures(mlFeatures);
    getAnalysisIdStatement=connection.prepareStatement(SQLQueries.GET_ANALYSIS_ID_OF_MODEL);
    getAnalysisIdStatement.setLong(1,modelId);
    analysisIdResult=getAnalysisIdStatement.executeQuery();
    long analysisId;
    if (analysisIdResult.first()) {
      analysisId=analysisIdResult.getLong(1);
    }
 else {
      throw new DatabaseHandlerException("String_Node_Str" + modelId);
    }
    mlWorkflow.setAlgorithmName(getAStringModelConfiguration(analysisId,MLConstants.ALGORITHM_NAME));
    mlWorkflow.setAlgorithmClass(getAStringModelConfiguration(analysisId,MLConstants.ALGORITHM_TYPE));
    mlWorkflow.setResponseVariable(getAStringModelConfiguration(analysisId,MLConstants.RESPONSE));
    mlWorkflow.setTrainDataFraction(Double.valueOf(getAStringModelConfiguration(analysisId,MLConstants.TRAIN_DATA_FRACTION)));
    mlWorkflow.setHyperParameters(getHyperParametersOfModelAsMap(modelId));
    return mlWorkflow;
  }
 catch (  SQLException e) {
    throw new DatabaseHandlerException(e.getMessage(),e);
  }
 finally {
    MLDatabaseUtils.enableAutoCommit(connection);
    MLDatabaseUtils.closeDatabaseResources(connection,getStatement,result);
    MLDatabaseUtils.closeDatabaseResources(getAnalysisIdStatement,analysisIdResult);
  }
}