jamesnetherton opened a new pull request, #30195: URL: https://github.com/apache/camel/pull/30195
[CAMEL-27027](https://issues.apache.org/jira/browse/CAMEL-27027) With message history on (the default in Camel JBang), the body type registry from CAMEL-25750 recorded each body by its canonical name. An anonymous, local or hidden class (such as a lambda) has none, so `null` was stored, and the next exchange to reach that step failed with: ``` java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "org.apache.camel.impl.engine.DefaultBodyTypeRegistry$TypeKind.type()" is null at org.apache.camel.impl.engine.DefaultBodyTypeRegistry$NodeTypes.containsType(DefaultBodyTypeRegistry.java:154) ``` `DefaultMessageHistory` now falls back to the class name (for example `Foo$1`), which also shows in the message history instead of `null`. `BodyTypeRegistryTest.testClassWithoutCanonicalName` sends an anonymous-class body and then a String through the same step; it fails with the NPE above without the fix. CAMEL-25750 is unreleased (4.24.0), so there is no upgrade guide entry. _Claude Code on behalf of jamesnetherton_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
