From 0093ee8e46baba9aa69071ff394e95f37fe8c70d Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 15 Jun 2017 19:39:09 +0300 Subject: [PATCH] avoid test failure due to field assignment rearrangements? --- .../intellij/util/containers/ConcurrentMapsTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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()); } - }