Github user jvz commented on a diff in the pull request:
https://github.com/apache/logging-log4j2/pull/71#discussion_r115505200
--- Diff:
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/StringBuilderEncoder.java
---
@@ -32,9 +32,14 @@
public class StringBuilderEncoder implements Encoder<StringBuilder> {
private static final int DEFAULT_BYTE_BUFFER_SIZE = 8 * 1024;
- private final ThreadLocal<CharBuffer> charBufferThreadLocal = new
ThreadLocal<>();
- private final ThreadLocal<ByteBuffer> byteBufferThreadLocal = new
ThreadLocal<>();
- private final ThreadLocal<CharsetEncoder> charsetEncoderThreadLocal =
new ThreadLocal<>();
+ /**
+ * This ThreadLocal uses raw and inconvenient Object[] to store three
heterogeneous objects (CharEncoder, CharBuffer
--- End diff --
So why can't you use three separate thread locals?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---