|
33 | 33 | import java.nio.ByteBuffer;
|
34 | 34 | import java.nio.charset.StandardCharsets;
|
35 | 35 | import java.util.Iterator;
|
36 |
| -import java.util.LinkedList; |
37 | 36 | import java.util.List;
|
38 | 37 | import java.util.Locale;
|
39 | 38 | import java.util.Map;
|
40 | 39 | import java.util.Set;
|
41 | 40 | import java.util.concurrent.CompletableFuture;
|
42 | 41 | import java.util.ArrayList;
|
43 | 42 | import java.util.Objects;
|
| 43 | +import java.util.concurrent.ConcurrentMap; |
44 | 44 | import java.util.concurrent.ConcurrentHashMap;
|
45 | 45 | import java.util.concurrent.ConcurrentLinkedQueue;
|
46 | 46 | import java.util.concurrent.Flow;
|
@@ -248,7 +248,7 @@ void markPrefaceSent() {
|
248 | 248 | //-------------------------------------
|
249 | 249 | final HttpConnection connection;
|
250 | 250 | private final Http2ClientImpl client2;
|
251 |
| - private final Map<Integer,Stream<?>> streams = new ConcurrentHashMap<>(); |
| 251 | + private final ConcurrentMap<Integer,Stream<?>> streams = new ConcurrentHashMap<>(); |
252 | 252 | private int nextstreamid;
|
253 | 253 | private int nextPushStream = 2;
|
254 | 254 | // actual stream ids are not allocated until the Headers frame is ready
|
@@ -700,8 +700,7 @@ void shutdown(Throwable t) {
|
700 | 700 | Throwable initialCause = this.cause;
|
701 | 701 | if (initialCause == null) this.cause = t;
|
702 | 702 | client2.deleteConnection(this);
|
703 |
| - List<Stream<?>> c = new LinkedList<>(streams.values()); |
704 |
| - for (Stream<?> s : c) { |
| 703 | + for (Stream<?> s : streams.values()) { |
705 | 704 | try {
|
706 | 705 | s.connectionClosing(t);
|
707 | 706 | } catch (Throwable e) {
|
|
0 commit comments