return configuration;
}
private JDBCConfiguration cloneAndSetPassword(JDBCConfiguration configuration, String encoded) {
// do a deep clone of the config to avoid altering its contents
ConnectionPoolConfiguration original = configuration.getConnectionPool();
ConnectionPoolConfiguration clone = new ConnectionPoolConfiguration();
clone.setConnectionTimeout(original.getConnectionTimeout());
clone.setDriver(original.getDriver());
clone.setMaxConnections(original.getMaxConnections());
clone.setMaxOpenPreparedStatements(original.getMaxOpenPreparedStatements());
clone.setMinConnections(original.getMinConnections());
clone.setPassword(encoded);
clone.setUrl(original.getUrl());
clone.setUsername(original.getUsername());
clone.setValidationQuery(original.getValidationQuery());
JDBCConfiguration result = new JDBCConfiguration();
result.setConnectionPool(clone);
result.setDialect(configuration.getDialect());
result.setJNDISource(configuration.getJNDISource());