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