HHH-9479 Avoiding array list growth in ActionQueue constructor

This commit is contained in:
Gunnar Morling 2014-11-06 10:47:34 +01:00
parent 9ff134aee7
commit b938fa2f93

View File

@ -28,6 +28,7 @@
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@ -130,16 +131,17 @@ public ActionQueue(SessionImplementor session) {
orphanRemovals = new ExecutableList<OrphanRemovalAction>();
// Important: these lists are in execution order
List<ExecutableList<?>> tmp = new ArrayList<ExecutableList<?>>( 7 );
tmp.add( orphanRemovals );
tmp.add( insertions );
tmp.add( updates );
// do before actions are handled in the other collection queues
tmp.add( collectionQueuedOps );
tmp.add( collectionRemovals );
tmp.add( collectionUpdates );
tmp.add( collectionCreations );
tmp.add( deletions );
List<ExecutableList<?>> tmp = Arrays.asList(
orphanRemovals,
insertions,
updates,
// do before actions are handled in the other collection queues
collectionQueuedOps,
collectionRemovals,
collectionUpdates,
collectionCreations,
deletions
);
executableLists = Collections.unmodifiableList( tmp );