Skip to content

Commit c3e43ec

Browse files
NathanQingyangXuSanne
authored andcommitted
HHH-14248 Refactor latestBatches from InsertActionSorter's field to temporary variable in its sort method
1 parent 112d215 commit c3e43ec

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

hibernate-core/src/main/java/org/hibernate/engine/spi/ActionQueue.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,9 +1129,6 @@ private boolean hasParent(BatchIdentifier batchIdentifier, List<BatchIdentifier>
11291129
}
11301130
}
11311131

1132-
// the mapping of entity names to their latest batch numbers.
1133-
private List<BatchIdentifier> latestBatches;
1134-
11351132
// the map of batch numbers to EntityInsertAction lists
11361133
private Map<BatchIdentifier, List<AbstractEntityInsertAction>> actionBatches;
11371134

@@ -1143,9 +1140,11 @@ public InsertActionSorter() {
11431140
*/
11441141
public void sort(List<AbstractEntityInsertAction> insertions) {
11451142
// optimize the hash size to eliminate a rehash.
1146-
this.latestBatches = new ArrayList<>( );
11471143
this.actionBatches = new HashMap<>();
11481144

1145+
// the mapping of entity names to their latest batch numbers.
1146+
final List<BatchIdentifier> latestBatches = new ArrayList<>();
1147+
11491148
for ( AbstractEntityInsertAction action : insertions ) {
11501149
BatchIdentifier batchIdentifier = new BatchIdentifier(
11511150
action.getEntityName(),

0 commit comments

Comments
 (0)