HHH-13047 Deprecate Environment#verifyProperties
This commit is contained in:
parent
1fb77629e2
commit
aae9cd14a5
|
@ -281,7 +281,6 @@ public class StandardServiceRegistryBuilder {
|
|||
final Map settingsCopy = new HashMap();
|
||||
settingsCopy.putAll( settings );
|
||||
settingsCopy.put( org.hibernate.boot.cfgxml.spi.CfgXmlAccessService.LOADED_CONFIG_KEY, aggregatedCfgXml );
|
||||
Environment.verifyProperties( settingsCopy );
|
||||
ConfigurationHelper.resolvePlaceHolders( settingsCopy );
|
||||
|
||||
return new StandardServiceRegistryImpl(
|
||||
|
|
|
@ -8,7 +8,6 @@ package org.hibernate.cfg;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -160,28 +159,15 @@ public final class Environment implements AvailableSettings {
|
|||
|
||||
private static final Properties GLOBAL_PROPERTIES;
|
||||
|
||||
private static final Map OBSOLETE_PROPERTIES = new HashMap();
|
||||
private static final Map RENAMED_PROPERTIES = new HashMap();
|
||||
|
||||
/**
|
||||
* Issues warnings to the user when any obsolete or renamed property names are used.
|
||||
* No longer effective.
|
||||
*
|
||||
* @param configurationValues The specified properties.
|
||||
* @deprecated without replacement. Such verification is best done ad hoc, case by case.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void verifyProperties(Map<?,?> configurationValues) {
|
||||
final Map propertiesToAdd = new HashMap();
|
||||
for ( Map.Entry entry : configurationValues.entrySet() ) {
|
||||
final Object replacementKey = OBSOLETE_PROPERTIES.get( entry.getKey() );
|
||||
if ( replacementKey != null ) {
|
||||
LOG.unsupportedProperty( entry.getKey(), replacementKey );
|
||||
}
|
||||
final Object renamedKey = RENAMED_PROPERTIES.get( entry.getKey() );
|
||||
if ( renamedKey != null ) {
|
||||
LOG.renamedProperty( entry.getKey(), renamedKey );
|
||||
propertiesToAdd.put( renamedKey, entry.getValue() );
|
||||
}
|
||||
}
|
||||
configurationValues.putAll( propertiesToAdd );
|
||||
//Obsolete and Renamed properties are no longer handled here
|
||||
}
|
||||
|
||||
static {
|
||||
|
@ -225,8 +211,6 @@ public final class Environment implements AvailableSettings {
|
|||
LOG.unableToCopySystemProperties();
|
||||
}
|
||||
|
||||
verifyProperties(GLOBAL_PROPERTIES);
|
||||
|
||||
ENABLE_BINARY_STREAMS = ConfigurationHelper.getBoolean(USE_STREAMS_FOR_BINARY, GLOBAL_PROPERTIES);
|
||||
if ( ENABLE_BINARY_STREAMS ) {
|
||||
LOG.usingStreams();
|
||||
|
|
|
@ -1397,12 +1397,6 @@ public interface CoreMessageLogger extends BasicLogger {
|
|||
@Message(value = "Oracle 11g is not yet fully supported; using Oracle 10g dialect", id = 394)
|
||||
void unsupportedOracleVersion();
|
||||
|
||||
@LogMessage(level = WARN)
|
||||
@Message(value = "Usage of obsolete property: %s no longer supported, use: %s", id = 395)
|
||||
void unsupportedProperty(
|
||||
Object propertyName,
|
||||
Object newPropertyName);
|
||||
|
||||
@LogMessage(level = INFO)
|
||||
@Message(value = "Updating schema", id = 396)
|
||||
void updatingSchema();
|
||||
|
|
|
@ -49,7 +49,6 @@ class ManagedProviderConnectionHelper implements ConnectionHelper {
|
|||
}
|
||||
|
||||
private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
|
||||
Environment.verifyProperties( properties );
|
||||
ConfigurationHelper.resolvePlaceHolders( properties );
|
||||
return (StandardServiceRegistryImpl) new StandardServiceRegistryBuilder().applySettings( properties ).build();
|
||||
}
|
||||
|
|
|
@ -254,7 +254,6 @@ public abstract class BaseJpaOrNativeBootstrapFunctionalTestCase extends BaseUni
|
|||
private StandardServiceRegistryImpl buildServiceRegistry(BootstrapServiceRegistry bootRegistry, Configuration configuration) {
|
||||
Properties properties = new Properties();
|
||||
properties.putAll( configuration.getProperties() );
|
||||
Environment.verifyProperties( properties );
|
||||
ConfigurationHelper.resolvePlaceHolders( properties );
|
||||
|
||||
StandardServiceRegistryBuilder cfgRegistryBuilder = configuration.getStandardServiceRegistryBuilder();
|
||||
|
|
|
@ -267,7 +267,6 @@ public abstract class BaseCoreFunctionalTestCase extends BaseUnitTestCase {
|
|||
protected StandardServiceRegistryImpl buildServiceRegistry(BootstrapServiceRegistry bootRegistry, Configuration configuration) {
|
||||
Properties properties = new Properties();
|
||||
properties.putAll( configuration.getProperties() );
|
||||
Environment.verifyProperties( properties );
|
||||
ConfigurationHelper.resolvePlaceHolders( properties );
|
||||
|
||||
StandardServiceRegistryBuilder cfgRegistryBuilder = configuration.getStandardServiceRegistryBuilder();
|
||||
|
|
Loading…
Reference in New Issue