You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "orpiske (via GitHub)" <gi...@apache.org> on 2026/03/28 13:44:52 UTC

[PR] fix SonarCloud S5993: abstract class constructors should be protected [camel]

orpiske opened a new pull request, #22305:
URL: https://github.com/apache/camel/pull/22305

   ## Summary
   
   - Change `public` constructors of `abstract` classes to `protected` across 37 modules (179 issues)
   - SonarCloud rule [S5993](https://sonarcloud.io/project/issues?rules=java%3AS5993&issueStatuses=OPEN%2CCONFIRMED&id=apache_camel): constructors of abstract classes should not be declared `public` since abstract classes cannot be instantiated directly — `protected` is the correct visibility
   - This is a safe, behavior-preserving change: subclasses can still call `super()` with `protected` constructors
   
   ## Affected modules
   
   **Core:** camel-api, camel-base, camel-core-languages, camel-core-model, camel-core-processor, camel-core-reifier, camel-core-xml, camel-main, camel-support
   
   **Components:** camel-djl, camel-as2-api, camel-aws2-timestream, camel-infinispan-common, camel-oauth, camel-salesforce-component, camel-servicenow-component, camel-sjms, camel-smpp, camel-splunk, camel-sql, camel-telegram, camel-twitter, camel-whatsapp, camel-wordpress, camel-workday, camel-xmlsecurity, camel-zeebe, camel-zookeeper
   
   **DSL:** camel-endpointdsl, camel-jbang-core, camel-jbang-plugin-kubernetes, camel-yaml-dsl, camel-yaml-dsl-common
   
   **Test infra:** camel-test-infra-artemis, camel-test-infra-aws-v2, camel-test-infra-azure-common, camel-test-infra-jetty
   
   ## Test plan
   
   - [x] Each module built successfully with `mvn -DskipTests install` (formatting included)
   - [ ] CI passes full test suite
   
   _Claude Code on behalf of Otavio R. Piske_


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix SonarCloud S5993: abstract class constructors should be protected [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22305:
URL: https://github.com/apache/camel/pull/22305#issuecomment-4148100188

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: 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 `build-all`, `build-dependents`, `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](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix SonarCloud S5993: abstract class constructors should be protected [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #22305:
URL: https://github.com/apache/camel/pull/22305#discussion_r3005060495


##########
core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties:
##########
@@ -173,6 +185,12 @@ sample
 script
 security
 securityDefinitions
+serviceCall
+serviceCallConfiguration
+serviceChooserConfiguration
+serviceDiscoveryConfiguration
+serviceExpression
+serviceFilterConfiguration
 setBody
 setExchangePattern

Review Comment:
   **Blocking**: These 6 entries (plus 14 others spread across this file: `blacklistServiceFilter`, `cachingServiceDiscovery`, `combinedServiceDiscovery`, `combinedServiceFilter`, `consulServiceDiscovery`, `customServiceFilter`, `defaultLoadBalancer`, `dnsServiceDiscovery`, `healthyServiceFilter`, `kubernetesServiceDiscovery`, `loadBalancerConfiguration`, `passThroughServiceFilter`, `staticServiceDiscovery`, `zookeeperServiceDiscovery`) were intentionally removed in c216fd94aead (CAMEL-22290, CAMEL-22289: _"Remove deprecated camel-cloud and ServiceCall"_).
   
   The corresponding Java model classes no longer exist in the codebase — they were part of `org.apache.camel.model.cloud.*` which was deleted in that commit. Re-adding these entries to `model.properties` is a regression.
   
   This likely happened because `mvn install -pl core/camel-core-model` regenerated this file from a local Maven repository that still contained stale metadata. To fix: revert all 20 additions to this file (the diff should show 0 additions / 0 deletions for this file).



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix SonarCloud S5993: abstract class constructors should be protected [camel]

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on code in PR #22305:
URL: https://github.com/apache/camel/pull/22305#discussion_r3009687659


##########
core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties:
##########
@@ -173,6 +185,12 @@ sample
 script
 security
 securityDefinitions
+serviceCall
+serviceCallConfiguration
+serviceChooserConfiguration
+serviceDiscoveryConfiguration
+serviceExpression
+serviceFilterConfiguration
 setBody
 setExchangePattern

Review Comment:
   Good catch. Reverted. 



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix SonarCloud S5993: abstract class constructors should be protected [camel]

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske merged PR #22305:
URL: https://github.com/apache/camel/pull/22305


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org