gnodet opened a new pull request, #31265: URL: https://github.com/apache/camel/pull/31265
## Summary Fix a `NullPointerException` in `camel-telemetry-dev` that occurs when an unrecognized `traceFormat` value is configured and a trace completes. ## Root Cause `DevSpanLifecycleManager`'s constructor uses a `switch` on the configured `traceFormat`. The `default` branch logged a warning but never assigned `this.stf`, leaving it `null`. When `close()` was subsequently called it invoked `stf.format(trace)`, causing an NPE. ## Fix Assign `new DevTraceFormatDefault()` to `this.stf` in the `default` branch — the same fallback that is already used when `traceFormat` is `null`. ## Tests `UnknownTraceFormatTest` configures the tracer with the unrecognized format `"bogus"`, sends a message through a route, and asserts no exception is thrown. The test was RED on the unfixed code path (NPE in `close()`) and GREEN after the fix. Fixes CAMEL-27988 --- _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_ -- 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]
