Program: 51987
Project: 51987
Buggy source:
/** 
 * Setup/Initialize the Flyway API to run against our DSpace database and point at our migration scripts.
 * @param datasource DataSource object initialized by DatabaseManager
 * @return initialized Flyway object
 */
private static Flyway setupFlyway(DataSource datasource){
  if (flywaydb == null) {
    try (Connection connection=datasource.getConnection()){
      flywaydb=new Flyway();
      flywaydb.setDataSource(datasource);
      flywaydb.setEncoding("String_Node_Str");
      DatabaseMetaData meta=connection.getMetaData();
      String dbType=findDbKeyword(meta);
      connection.close();
      ArrayList<String> scriptLocations=new ArrayList<String>();
      if (!dbType.equals(DBMS_H2)) {
        scriptLocations.add("String_Node_Str" + ConfigurationManager.getProperty("String_Node_Str") + "String_Node_Str"+ dbType);
      }
      scriptLocations.add("String_Node_Str" + dbType);
      scriptLocations.add("String_Node_Str");
      if (ConfigurationManager.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
        scriptLocations.add("String_Node_Str");
      }
      log.info("String_Node_Str" + StringUtils.join(scriptLocations,"String_Node_Str"));
      flywaydb.setLocations(scriptLocations.toArray(new String[scriptLocations.size()]));
      List<FlywayCallback> flywayCallbacks=new DSpace().getServiceManager().getServicesByType(FlywayCallback.class);
      flywaydb.setCallbacks(flywayCallbacks.toArray(new FlywayCallback[flywayCallbacks.size()]));
    }
 catch (    SQLException e) {
      log.error("String_Node_Str",e);
    }
  }
  return flywaydb;
}

Fixed version (ground truth):
/** 
 * Setup/Initialize the Flyway API to run against our DSpace database and point at our migration scripts.
 * @param datasource DataSource object initialized by DatabaseManager
 * @return initialized Flyway object
 */
private static Flyway setupFlyway(DataSource datasource){
  if (flywaydb == null) {
    try (Connection connection=datasource.getConnection()){
      flywaydb=new Flyway();
      flywaydb.setDataSource(datasource);
      flywaydb.setEncoding("String_Node_Str");
      String dbType=getDbType(connection);
      connection.close();
      ArrayList<String> scriptLocations=new ArrayList<String>();
      if (!dbType.equals(DBMS_H2)) {
        scriptLocations.add("String_Node_Str" + ConfigurationManager.getProperty("String_Node_Str") + "String_Node_Str"+ dbType);
      }
      scriptLocations.add("String_Node_Str" + dbType);
      scriptLocations.add("String_Node_Str");
      if (ConfigurationManager.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
        scriptLocations.add("String_Node_Str");
      }
      log.info("String_Node_Str" + StringUtils.join(scriptLocations,"String_Node_Str"));
      flywaydb.setLocations(scriptLocations.toArray(new String[scriptLocations.size()]));
      List<FlywayCallback> flywayCallbacks=new DSpace().getServiceManager().getServicesByType(FlywayCallback.class);
      flywaydb.setCallbacks(flywayCallbacks.toArray(new FlywayCallback[flywayCallbacks.size()]));
    }
 catch (    SQLException e) {
      log.error("String_Node_Str",e);
    }
  }
  return flywaydb;
}