From cf461639582b99c428c8ce155c4de01ba5a6f9d9 Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Sat, 29 Feb 2020 22:25:49 -0500 Subject: [PATCH] Fix a subtle double-checked locking issue --- .../persister/collection/AbstractCollectionPersister.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java index f42cd9cb1d..25ef03db87 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java @@ -753,7 +753,7 @@ public abstract class AbstractCollectionPersister } // lazily initialize instance field via 'double-checked locking' - // see https://en.wikipedia.org/wiki/Double-checked_locking + // see https://en.wikipedia.org/wiki/Double-checked_locking on why 'volatile' and local copy is used protected CollectionLoader getStandardCollectionLoader() { CollectionLoader localCopy = standardCollectionLoader; if ( localCopy == null ) {