HHH-15124 Relax usage of DeprecationLogger: avoid some confusing reports

This commit is contained in:
Sanne Grinovero 2022-03-16 13:26:09 +00:00 committed by Sanne Grinovero
parent 6a7afe8efc
commit 8c8a097e12
4 changed files with 7 additions and 24 deletions

View File

@ -246,12 +246,7 @@ public final class FastSessionServices {
() -> defaultSessionProperties.get( AvailableSettings.FLUSH_MODE ),
() -> {
final Object oldSetting = defaultSessionProperties.get( org.hibernate.jpa.AvailableSettings.FLUSH_MODE );
if ( oldSetting != null ) {
DeprecationLogger.DEPRECATION_LOGGER.deprecatedSetting(
org.hibernate.jpa.AvailableSettings.FLUSH_MODE,
AvailableSettings.FLUSH_MODE
);
}
//Not invoking the DeprecationLogger in this case as the user can't avoid using this property (the string value is the same)
return oldSetting;
}
);

View File

@ -274,12 +274,7 @@ public class SessionImpl
() -> getSessionProperty( AvailableSettings.FLUSH_MODE ),
() -> {
final Object oldSetting = getSessionProperty( org.hibernate.jpa.AvailableSettings.FLUSH_MODE );
if ( oldSetting != null ) {
DeprecationLogger.DEPRECATION_LOGGER.deprecatedSetting(
org.hibernate.jpa.AvailableSettings.FLUSH_MODE,
AvailableSettings.FLUSH_MODE
);
}
//Not invoking the DeprecationLogger in this case as the user can't avoid using this property (the string value is the same)
return oldSetting;
}
);

View File

@ -62,12 +62,7 @@ public class CdiBeanContainerBuilder {
() -> cfgService.getSetting( AvailableSettings.DELAY_CDI_ACCESS, StandardConverters.BOOLEAN ),
() -> {
final Boolean oldSetting = cfgService.getSetting( org.hibernate.jpa.AvailableSettings.DELAY_CDI_ACCESS, StandardConverters.BOOLEAN );
if ( oldSetting != null ) {
DeprecationLogger.DEPRECATION_LOGGER.deprecatedSetting(
org.hibernate.jpa.AvailableSettings.DELAY_CDI_ACCESS,
AvailableSettings.DELAY_CDI_ACCESS
);
}
//Not invoking the DeprecationLogger in this case as the user can't avoid using this property (the string value is the same)
return oldSetting;
},
() -> false

View File

@ -564,9 +564,8 @@ public class SchemaManagementToolCoordinator {
() -> configurationValues.get( JAKARTA_HBM2DDL_DATABASE_ACTION ),
() -> {
final Object setting = configurationValues.get( HBM2DDL_DATABASE_ACTION );
if ( setting != null ) {
DEPRECATION_LOGGER.deprecatedSetting( HBM2DDL_DATABASE_ACTION, JAKARTA_HBM2DDL_DATABASE_ACTION );
}
//Not using the DEPRECATION_LOGGER as while this branch understands Jakarta configuration,
//it's not meant to be the primary one yet.
return setting;
}
);
@ -579,9 +578,8 @@ public class SchemaManagementToolCoordinator {
() -> configurationValues.get( JAKARTA_HBM2DDL_SCRIPTS_ACTION ),
() -> {
final Object setting = configurationValues.get( HBM2DDL_SCRIPTS_ACTION );
if ( setting != null ) {
DEPRECATION_LOGGER.deprecatedSetting( HBM2DDL_SCRIPTS_ACTION, JAKARTA_HBM2DDL_SCRIPTS_ACTION );
}
//Not using the DEPRECATION_LOGGER as while this branch understands Jakarta configuration,
//it's not meant to be the primary one yet.
return setting;
}
);