gnodet-bot commented on code in PR #29165:
URL: https://github.com/apache/camel/pull/29165#discussion_r4466908966
##########
components/camel-netty/src/generated/java/org/apache/camel/component/netty/NettyComponentConfigurer.java:
##########
@@ -30,7 +29,7 @@ private org.apache.camel.component.netty.NettyConfiguration
getOrCreateConfigura
@Override
public boolean configure(CamelContext camelContext, Object obj, String
name, Object value, boolean ignoreCase) {
NettyComponent target = (NettyComponent) obj;
- switch (ignoreCase ? name.toLowerCase(Locale.ROOT) : name) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
case "allowdefaultcodec":
Review Comment:
⚠️ **Generated file — do not edit directly.** This file is annotated with
`@Generated` and will be overwritten on the next `mvn generate-sources` run,
reverting this change. The `Locale.ROOT` removal must be applied to the
**generator template** (Freemarker/Velocity), not to the generated output. The
same applies to the two other `*Configurer.java` files in this PR.
##########
components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyPayloadHelper.java:
##########
@@ -153,6 +153,38 @@ public static void setOut(Exchange exchange, Object
payload) {
}
}
+ /**
+ * A decoded {@link DefaultExchangeHolder} rebuilds the entire Exchange
(id, body, headers, out message, properties
+ * and variables), so it is only unmarshalled when the endpoint has
explicitly enabled exchange transfer via
+ * {@code transferExchange=true}. Otherwise the payload is treated as a
normal message body.
+ */
+ private static boolean isExchangeTransfer(NettyEndpoint endpoint, Object
payload) {
+ return payload instanceof DefaultExchangeHolder
+ && endpoint != null &&
endpoint.getConfiguration().isTransferExchange();
+ }
+
+ /**
Review Comment:
⚠️ **Silent behavioral regression in deprecated overload.** The old
`setIn(Exchange, Object)` always unmarshalled a `DefaultExchangeHolder`; the
new overload delegates to `setIn(null, exchange, payload)` which routes through
`isExchangeTransfer(null, payload)` — `endpoint != null` is `false`, so the
holder is **never** unmarshalled and lands in the exchange body as-is.
The Javadoc must explicitly state this: *"Note: when called with a null
endpoint, `DefaultExchangeHolder` payloads are **not** unmarshalled and are
treated as an ordinary message body. Callers that relied on the previous
unconditional-unmarshal behaviour must migrate to `setIn(NettyEndpoint,
Exchange, Object)`."*
Also consider:
```suggestion
@Deprecated(since = "4.11.0", forRemoval = true)
```
(same for the `setOut` overload below)
--
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]