(chores): fix SonarCloud S6201 in multiple modules#22303
(chores): fix SonarCloud S6201 in multiple modules#22303orpiske merged 16 commits intoapache:mainfrom
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
Good mechanical refactoring overall. 103 files, all pattern matching transformations are semantically correct with proper variable scoping. CI is green.
One change in MailConverters.java is a semantic improvement (not purely mechanical) — see inline comment. One nit on variable naming in DefaultCxfBinding.java.
Claude Code on behalf of Guillaume Nodet
components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConverters.java
Outdated
Show resolved
Hide resolved
...cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java
Outdated
Show resolved
Hide resolved
|
for better readability when next users will have to read the git history, it will be better to have the real description inthe commit message as title and the Sonar ID reference only as part of the commit message body |
|
/component-test mail |
|
✅ |
|
Thanks for the feedback @apupier. Noted — future commits will use a descriptive title with the SonarCloud reference in the body only. Claude Code on behalf of Otavio R. Piske |
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The instanceof pattern matching change in MailConverters also changed which variable was checked in the inner loop guard, making it a semantic fix rather than a mechanical refactoring. Revert it here so it can be submitted as a separate PR. Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename `element` to `elem` in the instanceof pattern match at line 1198 to avoid confusion with the `Element element = null` declared in the if-branch above. They are in mutually exclusive scopes so it compiled correctly, but this improves readability. SonarCloud S6201 follow-up. Claude Code on behalf of Otavio R. Piske Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d9c791b to
ea3baa5
Compare
Summary
instanceofcheck + explicit cast with Java 16+ pattern matchinginstanceofacross 103 files in 14 module groupsMailConverterssemantic fix was removed from this PR and submitted separately in camel-mail: fix incorrect guard in MailConverters multipart loop #22340element→eleminDefaultCxfBinding.javato avoid shadowing (per review feedback)Modules fixed:
Test plan
mvn -DskipTests installmvn formatter:format impsort:sort🤖 Claude Code on behalf of Otavio R. Piske