Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ public final class Environment implements AvailableSettings {
InputStream stream = ConfigHelper.getResourceAsStream( "/hibernate.properties" );
try {
GLOBAL_PROPERTIES.load(stream);
LOG.propertiesLoaded( ConfigurationHelper.maskOut( GLOBAL_PROPERTIES, PASS ) );
LOG.propertiesLoaded( ConfigurationHelper.maskOut( GLOBAL_PROPERTIES,
PASS, JAKARTA_JDBC_PASSWORD, JPA_JDBC_PASSWORD ) );
}
catch (Exception e) {
LOG.unableToLoadProperties();
Expand All @@ -165,8 +166,8 @@ public final class Environment implements AvailableSettings {

try {
Properties systemProperties = System.getProperties();
// Must be thread-safe in case an application changes System properties during Hibernate initialization.
// See HHH-8383.
// Must be thread-safe in case an application changes System properties during Hibernate initialization.
// See HHH-8383.
synchronized (systemProperties) {
GLOBAL_PROPERTIES.putAll(systemProperties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,24 +262,38 @@ public static Map clone(Map<?,?> configurationValues) {


/**
* replace a property by a starred version
* Replace a property by a starred version
*
* @param props properties to check
* @param key property to mask
*
* @return cloned and masked properties
*/
public static Properties maskOut(Properties props, String key) {
Properties clone = ( Properties ) props.clone();
Properties clone = (Properties) props.clone();
if ( clone.get( key ) != null ) {
clone.setProperty( key, "****" );
}
return clone;
}




/**
* Replace properties by starred version
*
* @param props properties to check
* @param keys properties to mask
*
* @return cloned and masked properties
*/
public static Properties maskOut(Properties props, String... keys) {
Properties clone = (Properties) props.clone();
for ( String key : keys ) {
if ( clone.get( key ) != null ) {
clone.setProperty( key, "****" );
}
}
return clone;
}

/**
* Extract a property value by name from the given properties object.
Expand Down
Loading