HHH-13496 Dubious putIfAbsent usages

This commit is contained in:
Sanne Grinovero 2019-07-08 20:48:32 +01:00
parent fb0da1640b
commit a76c04783e
1 changed files with 1 additions and 6 deletions

View File

@ -125,12 +125,7 @@ public class QueryPlanCache implements Serializable {
*/
public ParameterMetadata getSQLParameterMetadata(final String query, boolean isOrdinalParameterZeroBased) {
final ParameterMetadataKey key = new ParameterMetadataKey( query, isOrdinalParameterZeroBased );
ParameterMetadataImpl value = parameterMetadataCache.get( key );
if ( value == null ) {
value = nativeQueryInterpreter.getParameterMetadata( query );
parameterMetadataCache.putIfAbsent( key, value );
}
return value;
return parameterMetadataCache.computeIfAbsent( key, k -> nativeQueryInterpreter.getParameterMetadata( query ) );
}
/**