CAMEL-24186: camel-cxf - code-quality cleanup#24801
Conversation
Behaviour-preserving cleanups from the July 2026 camel-cxf review: - CxfConverter: use Locale.ROOT in toDataFormat toUpperCase (locale-safe) - CxfRsInvoker: fix misspelled SUSPENED constant -> SUSPENDED - CxfRsProducer: drop discarded sfb.getResourceClasses() calls - CxfConsumer: remove no-op out-fault observer wrapper (and unused import) - SpringBusFactoryBean: make bf a local variable instead of a field - CxfMessageMapper: fix Javadoc link to a non-existent class
gnodet
left a comment
There was a problem hiding this comment.
Claude Code on behalf of gnodet
Review — CAMEL-24186: camel-cxf — code-quality cleanup
Clean, behaviour-preserving mechanical fixes — all six changes verified:
-
CxfConverter.toDataFormat—toUpperCase()→toUpperCase(Locale.ROOT). Correct fix for the Turkish-i class of locale-sensitive bugs (e.g."info".toUpperCase()→"İNFO"ontr_TRlocale, breakingDataFormat.valueOf()). ✅ -
CxfRsInvoker.SUSPENED→SUSPENDED— Typo fix on a private constant. The string value"org.apache.camel.component.cxf.jaxrs.suspend"is unchanged, so no key-lookup compatibility concern. ✅ -
CxfRsProducer— Removed two standalonesfb.getResourceClasses()calls whose return values were discarded.getResourceClasses()is a pure getter with no side effects. ✅ -
CxfConsumer— Removed the no-op out-fault observer wrapper (m -> original.onMessage(m)) that just re-delegated to the original observer. Also cleaned up the unusedMessageObserverimport. ✅ -
SpringBusFactoryBean—bffrom instance field to method-local. Only used withingetObject(), so this is a correct scope reduction that avoids unnecessary retention. ✅ -
CxfMessageMapper— Javadoc fix: removed{@link CxfBeanDestination}reference to a class that doesn't exist in the module. ✅
LGTM — nice cleanup batch.
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 22 tested, 29 compile-only — current: 22 all testedMaveniverse Scalpel detected 51 affected modules (current approach: 22).
|
CAMEL-24186: camel-cxf — code-quality cleanup
Behaviour-preserving cleanups from an AI-assisted code review of the
camel-cxfcomponent family. This is the safe, mechanical batch 1 of the improvements umbrella CAMEL-24186; remaining items (refactors, deprecated-API migrations that touch semantics, fail-loud changes) are tracked there as follow-ups.Changes
toDataFormatnow callstoUpperCase(Locale.ROOT)instead of the default-localetoUpperCase()(avoids the Turkish-i class of bug when resolving the data-format enum).SUSPENED→SUSPENDED(internal key; no functional change).sfb.getResourceClasses();calls whose result is thrown away and immediately re-fetched on the next line.setOutFaultObserver(m -> original.onMessage(m))) that just re-delegated to the original observer, plus the now-unusedMessageObserverimport.bfa method-local variable instead of an instance field (it was only used withingetObject()).{@link}pointing at a class that does not exist in the module.Testing
mvn formatter:format impsort:sortclean; all six modules build.Authored by Claude Code (Claude Fable) on behalf of Federico Mariani (GitHub: @Croway).
🤖 Generated with Claude Code