We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae0ed7c commit 4bb43e4Copy full SHA for 4bb43e4
netty-utils/src/main/java/org/asynchttpclient/netty/util/Utf8ByteBufCharsetDecoder.java
@@ -28,11 +28,7 @@ public class Utf8ByteBufCharsetDecoder {
28
private static final int UTF_8_MAX_BYTES_PER_CHAR = 4;
29
private static final char INVALID_CHAR_REPLACEMENT = '�';
30
31
- private static final ThreadLocal<Utf8ByteBufCharsetDecoder> POOL = new ThreadLocal<Utf8ByteBufCharsetDecoder>() {
32
- protected Utf8ByteBufCharsetDecoder initialValue() {
33
- return new Utf8ByteBufCharsetDecoder();
34
- }
35
- };
+ private static final ThreadLocal<Utf8ByteBufCharsetDecoder> POOL = ThreadLocal.withInitial(() ->new Utf8ByteBufCharsetDecoder());
36
37
private static Utf8ByteBufCharsetDecoder pooledDecoder() {
38
Utf8ByteBufCharsetDecoder decoder = POOL.get();
0 commit comments