diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/internal/ResultSetProcessingContextImpl.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/internal/ResultSetProcessingContextImpl.java index 791132e67d..8b9cfe8486 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/internal/ResultSetProcessingContextImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/internal/ResultSetProcessingContextImpl.java @@ -281,8 +281,9 @@ public class ResultSetProcessingContextImpl implements ResultSetProcessingContex // managing the running list of registrations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + final int sizeHint = currentRowHydratedEntityRegistrationList.size(); if ( hydratedEntityRegistrationList == null ) { - hydratedEntityRegistrationList = new ArrayList<>(); + hydratedEntityRegistrationList = new ArrayList<>( sizeHint ); } hydratedEntityRegistrationList.addAll( currentRowHydratedEntityRegistrationList );