author | psandoz |
Thu, 05 Dec 2013 09:44:53 +0100 | |
changeset 21981 | 48b31d370bc9 |
child 31807 | 3bd38a739ea1 |
permissions | -rw-r--r-- |
21981
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
1 |
/* |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
2 |
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
4 |
* |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
8 |
* |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
13 |
* accompanied this code). |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
14 |
* |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
18 |
* |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
21 |
* questions. |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
22 |
*/ |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
23 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
24 |
import org.testng.annotations.Test; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
25 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
26 |
import java.util.HashMap; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
27 |
import java.util.Map; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
28 |
import java.util.concurrent.CompletableFuture; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
29 |
import java.util.concurrent.CompletionException; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
30 |
import java.util.concurrent.ConcurrentHashMap; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
31 |
import java.util.concurrent.ConcurrentMap; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
32 |
import java.util.concurrent.CountDownLatch; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
33 |
import java.util.concurrent.ThreadLocalRandom; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
34 |
import java.util.function.BiConsumer; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
35 |
import java.util.function.Supplier; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
36 |
import java.util.stream.IntStream; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
37 |
import java.util.stream.Stream; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
38 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
39 |
/** |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
40 |
* @test |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
41 |
* @bug 8028564 |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
42 |
* @run testng ConcurrentAssociateTest |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
43 |
* @summary Test that association operations, such as put and compute, |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
44 |
* place entries in the map |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
45 |
*/ |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
46 |
@Test |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
47 |
public class ConcurrentAssociateTest { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
48 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
49 |
// The number of entries for each thread to place in a map |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
50 |
private static final int N = Integer.getInteger("n", 128); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
51 |
// The number of iterations of the test |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
52 |
private static final int I = Integer.getInteger("i", 256); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
53 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
54 |
// Object to be placed in the concurrent map |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
55 |
static class X { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
56 |
// Limit the hash code to trigger collisions |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
57 |
int hc = ThreadLocalRandom.current().nextInt(1, 9); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
58 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
59 |
public int hashCode() { return hc; } |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
60 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
61 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
62 |
@Test |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
63 |
public void testPut() { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
64 |
test("CHM.put", (m, o) -> m.put(o, o)); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
65 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
66 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
67 |
@Test |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
68 |
public void testCompute() { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
69 |
test("CHM.compute", (m, o) -> m.compute(o, (k, v) -> o)); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
70 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
71 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
72 |
@Test |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
73 |
public void testComputeIfAbsent() { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
74 |
test("CHM.computeIfAbsent", (m, o) -> m.computeIfAbsent(o, (k) -> o)); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
75 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
76 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
77 |
@Test |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
78 |
public void testMerge() { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
79 |
test("CHM.merge", (m, o) -> m.merge(o, o, (v1, v2) -> v1)); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
80 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
81 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
82 |
@Test |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
83 |
public void testPutAll() { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
84 |
test("CHM.putAll", (m, o) -> { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
85 |
Map<Object, Object> hm = new HashMap<>(); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
86 |
hm.put(o, o); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
87 |
m.putAll(hm); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
88 |
}); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
89 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
90 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
91 |
private static void test(String desc, BiConsumer<ConcurrentMap<Object, Object>, Object> associator) { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
92 |
for (int i = 0; i < I; i++) { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
93 |
testOnce(desc, associator); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
94 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
95 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
96 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
97 |
static class AssociationFailure extends RuntimeException { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
98 |
AssociationFailure(String message) { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
99 |
super(message); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
100 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
101 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
102 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
103 |
private static void testOnce(String desc, BiConsumer<ConcurrentMap<Object, Object>, Object> associator) { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
104 |
ConcurrentHashMap<Object, Object> m = new ConcurrentHashMap<>(); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
105 |
CountDownLatch s = new CountDownLatch(1); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
106 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
107 |
Supplier<Runnable> sr = () -> () -> { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
108 |
try { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
109 |
s.await(); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
110 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
111 |
catch (InterruptedException e) { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
112 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
113 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
114 |
for (int i = 0; i < N; i++) { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
115 |
Object o = new X(); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
116 |
associator.accept(m, o); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
117 |
if (!m.containsKey(o)) { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
118 |
throw new AssociationFailure(desc + " failed: entry does not exist"); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
119 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
120 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
121 |
}; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
122 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
123 |
int ps = Runtime.getRuntime().availableProcessors(); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
124 |
Stream<CompletableFuture> runners = IntStream.range(0, ps) |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
125 |
.mapToObj(i -> sr.get()) |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
126 |
.map(CompletableFuture::runAsync); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
127 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
128 |
CompletableFuture all = CompletableFuture.allOf( |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
129 |
runners.toArray(CompletableFuture[]::new)); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
130 |
|
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
131 |
// Trigger the runners to start associating |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
132 |
s.countDown(); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
133 |
try { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
134 |
all.join(); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
135 |
} catch (CompletionException e) { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
136 |
Throwable t = e.getCause(); |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
137 |
if (t instanceof AssociationFailure) { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
138 |
throw (AssociationFailure) t; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
139 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
140 |
else { |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
141 |
throw e; |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
142 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
143 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
144 |
} |
48b31d370bc9
8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
psandoz
parents:
diff
changeset
|
145 |
} |