Skip to content

Commit 33f8c90

Browse files
fix(syncmap): correct constructor default value for load factor
1 parent e3b2a26 commit 33f8c90

File tree

1 file changed

+9
-6
lines changed
  • collections/src/main/java/space/vectrix/sync/collections

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public SyncMap(final int initialCapacity) {
326326
* @since 1.0.0
327327
*/
328328
public SyncMap(final Hashing.MixFunction mixFunction, final int initialCapacity) {
329-
this(mixFunction, initialCapacity, SyncMap.DEFAULT_CAPACITY);
329+
this(mixFunction, initialCapacity, SyncMap.DEFAULT_LOAD_FACTOR);
330330
}
331331

332332
/**
@@ -1498,11 +1498,14 @@ public void clear() {
14981498
/**
14991499
* {@inheritDoc}
15001500
*
1501-
* <p>Creating an {@link Iterator} from this view, takes an immutable
1502-
* snapshot of the entries, meaning, modifications after calling
1503-
* {@link Set#iterator()} will not be visible. Calling
1504-
* {@link Iterator#remove()} will work provided the key-value pair is
1505-
* identical to the pair currently in the map.</p>
1501+
* <p>The {@link Iterator} produced by this view is weakly consistent: it
1502+
* iterates over an immutable snapshot captured at iterator creation time.
1503+
* New insertions after calling {@link Set#iterator()} are not reflected in
1504+
* the traversal.</p>
1505+
*
1506+
* <p>{@link Iterator#remove()} attempts to remove the last returned entry
1507+
* from the backing map, and succeeds only if the key still maps to the same
1508+
* value at the time of removal.</p>
15061509
*/
15071510
@Override
15081511
public Set<Map.Entry<K, V>> entrySet() {

0 commit comments

Comments
 (0)