diff --git a/platform/platform-tests/testSrc/com/intellij/util/containers/ConcurrentMapsTest.java b/platform/platform-tests/testSrc/com/intellij/util/containers/ConcurrentMapsTest.java index 45110b312d22..a81d910ea556 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/containers/ConcurrentMapsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/containers/ConcurrentMapsTest.java @@ -389,19 +389,19 @@ public class ConcurrentMapsTest { while (!map.isEmpty()); } + private volatile Object strong; @Test public void testConcurrentWeakValueSize() { Map 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()); } - }