diff --git a/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java b/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java index 4f1e709cb1..428c7bbb08 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java @@ -689,15 +689,10 @@ public abstract class CollectionType extends AbstractType implements Association // for a null target, or a target which is the same as the original, we // need to put the merged elements in a new collection - Object result; - if ( target == LazyPropertyInitializer.UNFETCHED_PROPERTY ) { - result = original; - } - else { - result = ( target == null || target == original ) ? - instantiateResult( original ) : - target; - } + Object result = ( target == null || + target == original || + target == LazyPropertyInitializer.UNFETCHED_PROPERTY ) ? + instantiateResult( original ) : target; //for arrays, replaceElements() may return a different reference, since //the array length might not match