HHH-13475 SessionImpl#applyQuerySettingsAndHints should not rely on defensive copies to just read properties

This commit is contained in:
Sanne Grinovero 2019-07-02 10:12:27 +01:00
parent e044397df2
commit 078c0df460
1 changed files with 4 additions and 4 deletions

View File

@ -323,12 +323,12 @@ public final class SessionImpl
if ( lockOptions.getLockMode() != LockMode.NONE ) { if ( lockOptions.getLockMode() != LockMode.NONE ) {
query.setLockMode( getLockMode( lockOptions.getLockMode() ) ); query.setLockMode( getLockMode( lockOptions.getLockMode() ) );
} }
Object queryTimeout; final Object queryTimeout;
if ( (queryTimeout = getProperties().get( QueryHints.SPEC_HINT_TIMEOUT ) ) != null ) { if ( ( queryTimeout = properties.get( QueryHints.SPEC_HINT_TIMEOUT ) ) != null ) {
query.setHint( QueryHints.SPEC_HINT_TIMEOUT, queryTimeout ); query.setHint( QueryHints.SPEC_HINT_TIMEOUT, queryTimeout );
} }
Object lockTimeout; final Object lockTimeout;
if( (lockTimeout = getProperties().get( JPA_LOCK_TIMEOUT ))!=null){ if ( ( lockTimeout = properties.get( JPA_LOCK_TIMEOUT ) ) != null ) {
query.setHint( JPA_LOCK_TIMEOUT, lockTimeout ); query.setHint( JPA_LOCK_TIMEOUT, lockTimeout );
} }
} }