Skip to content

Commit 2d21fa1

Browse files
fix(syncmap): ensure amended is set true after assigning the new table and use the previous length for the transfer index
1 parent e0d33b5 commit 2d21fa1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

collections-fastutil/src/main/java-templates/space/vectrix/sync/collections/fastutil/{{key}}2ObjectSyncMap.java.peb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,7 @@ public class {{ key }}2ObjectSyncMap<V> extends Abstract{{ key }}2ObjectMap<V> {
17651765
}
17661766

17671767
this.capacity = length << 1;
1768-
{{ key }}2ObjectSyncMap.TRANSFER_INDEX.setRelease(this, this.capacity);
1768+
{{ key }}2ObjectSyncMap.TRANSFER_INDEX.setRelease(this, length);
17691769
this.transferTable = destination = new Node[this.capacity];
17701770
break;
17711771
} else if(operation == StampLock.OPERATION_RESIZE
@@ -1921,6 +1921,7 @@ public class {{ key }}2ObjectSyncMap<V> extends Abstract{{ key }}2ObjectMap<V> {
19211921

19221922
this.transferTable = null;
19231923
this.mutableTable = destination;
1924+
this.amended = true;
19241925
break;
19251926
}
19261927
}

collections/src/main/java/space/vectrix/sync/collections/SyncMap.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ public Set<Map.Entry<K, V>> entrySet() {
16391639
}
16401640

16411641
this.capacity = length << 1;
1642-
SyncMap.TRANSFER_INDEX.setRelease(this, this.capacity);
1642+
SyncMap.TRANSFER_INDEX.setRelease(this, length);
16431643
this.transferTable = destination = new Node[this.capacity];
16441644
break;
16451645
} else if(operation == StampLock.OPERATION_RESIZE
@@ -1795,6 +1795,7 @@ public Set<Map.Entry<K, V>> entrySet() {
17951795

17961796
this.transferTable = null;
17971797
this.mutableTable = destination;
1798+
this.amended = true;
17981799
break;
17991800
}
18001801
}

0 commit comments

Comments
 (0)