davsclaus commented on code in PR #23738:
URL: https://github.com/apache/camel/pull/23738#discussion_r3350655153
##########
core/camel-support/src/main/java/org/apache/camel/support/DefaultMessage.java:
##########
@@ -36,7 +36,8 @@
* implementation uses the {@link org.apache.camel.util.CaseInsensitiveMap
CaseInsensitiveMap}.
*/
public class DefaultMessage extends MessageSupport {
- private Map<String, Object> headers;
+ protected Map<String, Object> headers;
Review Comment:
Widening `headers` from `private` to `protected` exposes it to subclasses
(`JmsMessage`, `GenericFileMessage`, `HttpMessage`, `NettyHttpMessage`, etc.)
which could directly modify the field and bypass the COW invariant. Consider
keeping it `private` and providing accessor methods instead.
Also, the `headersShared` flag should arguably be `private` too — subclasses
should go through the COW-aware methods.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]