mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid test failure due to field assignment rearrangements?
This commit is contained in:
+5
-5
@@ -389,19 +389,19 @@ public class ConcurrentMapsTest {
|
||||
while (!map.isEmpty());
|
||||
}
|
||||
|
||||
private volatile Object strong;
|
||||
@Test
|
||||
public void testConcurrentWeakValueSize() {
|
||||
Map<String, Object> map = ContainerUtil.createConcurrentWeakValueMap();
|
||||
Object o = new Object();
|
||||
map.put("a", o);
|
||||
strong = new Object();
|
||||
map.put("a", strong);
|
||||
map.put("b", new Object());
|
||||
|
||||
GCUtil.tryGcSoftlyReachableObjects();
|
||||
assertEquals(1, map.size());
|
||||
|
||||
o = null;
|
||||
strong = null;
|
||||
GCUtil.tryGcSoftlyReachableObjects();
|
||||
assertTrue(map.isEmpty());
|
||||
assertTrue(map.toString(), map.isEmpty());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user