Skip to content

CAMEL-24186: camel-cxf - code-quality cleanup#24801

Merged
Croway merged 1 commit into
apache:mainfrom
Croway:CAMEL-24186-cxf-code-quality-cleanup
Jul 16, 2026
Merged

CAMEL-24186: camel-cxf - code-quality cleanup#24801
Croway merged 1 commit into
apache:mainfrom
Croway:CAMEL-24186-cxf-code-quality-cleanup

Conversation

@Croway

@Croway Croway commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

CAMEL-24186: camel-cxf — code-quality cleanup

Behaviour-preserving cleanups from an AI-assisted code review of the camel-cxf component 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

  • CxfConvertertoDataFormat now calls toUpperCase(Locale.ROOT) instead of the default-locale toUpperCase() (avoids the Turkish-i class of bug when resolving the data-format enum).
  • CxfRsInvoker — fix the misspelled private constant SUSPENEDSUSPENDED (internal key; no functional change).
  • CxfRsProducer — remove two discarded sfb.getResourceClasses(); calls whose result is thrown away and immediately re-fetched on the next line.
  • CxfConsumer — remove the no-op out-fault observer wrapper (setOutFaultObserver(m -> original.onMessage(m))) that just re-delegated to the original observer, plus the now-unused MessageObserver import.
  • SpringBusFactoryBean — make bf a method-local variable instead of an instance field (it was only used within getObject()).
  • CxfMessageMapper — fix a Javadoc {@link} pointing at a class that does not exist in the module.

Testing

  • mvn formatter:format impsort:sort clean; all six modules build.
  • Existing test suites pass for the touched modules (transport, spring-common in full; converter/producer/binding and consumer smoke tests for rest/soap). No behaviour change is intended or observed.

Authored by Claude Code (Claude Fable) on behalf of Federico Mariani (GitHub: @Croway).

🤖 Generated with Claude Code

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
@Croway
Croway requested review from davsclaus and ffang July 16, 2026 13:54

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code on behalf of gnodet

Review — CAMEL-24186: camel-cxf — code-quality cleanup

Clean, behaviour-preserving mechanical fixes — all six changes verified:

  1. CxfConverter.toDataFormattoUpperCase()toUpperCase(Locale.ROOT). Correct fix for the Turkish-i class of locale-sensitive bugs (e.g. "info".toUpperCase()"İNFO" on tr_TR locale, breaking DataFormat.valueOf()). ✅

  2. CxfRsInvoker.SUSPENEDSUSPENDED — Typo fix on a private constant. The string value "org.apache.camel.component.cxf.jaxrs.suspend" is unchanged, so no key-lookup compatibility concern. ✅

  3. CxfRsProducer — Removed two standalone sfb.getResourceClasses() calls whose return values were discarded. getResourceClasses() is a pure getter with no side effects. ✅

  4. 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 unused MessageObserver import. ✅

  5. SpringBusFactoryBeanbf from instance field to method-local. Only used within getObject(), so this is a correct scope reduction that avoids unnecessary retention. ✅

  6. CxfMessageMapper — Javadoc fix: removed {@link CxfBeanDestination} reference to a class that doesn't exist in the module. ✅

LGTM — nice cleanup batch.

@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@Croway
Croway merged commit 9461609 into apache:main Jul 16, 2026
5 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-cxf/camel-cxf-rest
  • components/camel-cxf/camel-cxf-soap
  • components/camel-cxf/camel-cxf-spring-common
  • components/camel-cxf/camel-cxf-transport

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.


🔬 Scalpel shadow comparison — Scalpel: 22 tested, 29 compile-only — current: 22 all tested

Maveniverse Scalpel detected 51 affected modules (current approach: 22).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 22 modules (4 direct + 18 downstream), skip tests for 29 (generated code, meta-modules)

Modules Scalpel would test (22)
  • camel-cxf-rest
  • camel-cxf-soap
  • camel-cxf-spring-common
  • camel-cxf-spring-rest
  • camel-cxf-spring-soap
  • camel-cxf-spring-transport
  • camel-cxf-transport
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-micrometer-observability
  • camel-observability-services
  • camel-opentelemetry
  • camel-opentelemetry2
  • camel-soap
  • camel-telemetry
  • camel-telemetry-dev
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules with tests skipped (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

Build reactor — dependencies compiled but only changed modules were tested (51 modules)
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: CXF :: Common :: Spring
  • Camel :: CXF :: REST
  • Camel :: CXF :: REST :: Spring
  • Camel :: CXF :: SOAP
  • Camel :: CXF :: SOAP :: Spring
  • Camel :: CXF :: Transport
  • Camel :: CXF :: Transport :: Spring
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Common Telemetry
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: Micrometer :: Observability 2
  • Camel :: Observability Services
  • Camel :: OpenTelemetry (deprecated)
  • Camel :: Opentelemetry 2
  • Camel :: SOAP
  • Camel :: Telemetry :: Dev
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants