From 9f71bd890d32bbcc02e0e8572cb632a8975e938c Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 28 Aug 2019 11:21:04 +0100 Subject: [PATCH] HHH-13600 Unguarded log statement in CollectionCacheInvalidator --- .../hibernate/cache/internal/CollectionCacheInvalidator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java b/hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java index e3d35c0b7e..81793fb23d 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java @@ -111,6 +111,7 @@ public class CollectionCacheInvalidator return; } final EntityMetamodel entityMetamodel = persister.getEntityMetamodel(); + final boolean debugEnabled = LOG.isDebugEnabled(); for ( String role : collectionRoles ) { final CollectionPersister collectionPersister = metamodel.collectionPersister( role ); if ( !collectionPersister.hasCache() ) { @@ -142,7 +143,9 @@ public class CollectionCacheInvalidator } } else { - LOG.debug( "Evict CollectionRegion " + role ); + if ( debugEnabled ) { + LOG.debug( "Evict CollectionRegion " + role ); + } final CollectionDataAccess cacheAccessStrategy = collectionPersister.getCacheAccessStrategy(); final SoftLock softLock = cacheAccessStrategy.lockRegion(); session.getActionQueue().registerProcess( (success, session1) -> {