mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Fix a bug in HashSegmentIteration.forEachTierWhile()
This commit is contained in:
+16
-12
@@ -35,19 +35,23 @@ public class OverflowAllocationDuringIterationTest {
|
||||
map.put(i, x);
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
final String currentX = x;
|
||||
map.forEachEntry(e -> {
|
||||
String v = e.value().get().toString();
|
||||
if (!currentX.contentEquals(v)) {
|
||||
throw new AssertionError(currentX + " != " + v + "<=" + e.key());
|
||||
}
|
||||
e.doReplaceValue(e.context().wrapValueAsData(v + v));
|
||||
});
|
||||
x = x + x;
|
||||
for (int j = 0; j < entries; j++) {
|
||||
if (map.get(j) == null || !x.contentEquals(map.get(j))) {
|
||||
throw new AssertionError();
|
||||
try {
|
||||
final String currentX = x;
|
||||
map.forEachEntry(e -> {
|
||||
String v = e.value().get().toString();
|
||||
if (!currentX.contentEquals(v)) {
|
||||
throw new AssertionError(currentX + " != " + v + "<=" + e.key());
|
||||
}
|
||||
e.doReplaceValue(e.context().wrapValueAsData(v + v));
|
||||
});
|
||||
x = x + x;
|
||||
for (int j = 0; j < entries; j++) {
|
||||
if (map.get(j) == null || !x.contentEquals(map.get(j))) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
((VanillaChronicleMap) map).verifyTierCountersAreaData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user