HHH-11634 - ActionQueue#InsertActionSorter fails to generate right order

Use the same object for both the remove and the add operations

(cherry picked from commit 020414e1aa)
This commit is contained in:
Vlad Mihalcea 2017-04-19 21:02:02 +03:00 committed by Gail Badner
parent f1eb8672d7
commit 98a98eefe5
1 changed files with 2 additions and 2 deletions

View File

@ -1105,7 +1105,7 @@ public class ActionQueue {
for ( int j = i - 1; j >= 0; j-- ) {
BatchIdentifier prevBatchIdentifier = latestBatches.get( j );
if(prevBatchIdentifier.getParentEntityNames().contains( entityName )) {
latestBatches.remove( i );
latestBatches.remove( batchIdentifier );
latestBatches.add( j, batchIdentifier );
}
}
@ -1116,7 +1116,7 @@ public class ActionQueue {
//Take care of unidirectional @OneToOne associations but exclude bidirectional @ManyToMany
if(nextBatchIdentifier.getChildEntityNames().contains( entityName ) &&
!batchIdentifier.getChildEntityNames().contains( nextBatchIdentifier.getEntityName() )) {
latestBatches.remove( i );
latestBatches.remove( batchIdentifier );
latestBatches.add( j, batchIdentifier );
}
}