orpiske opened a new pull request, #22304: URL: https://github.com/apache/camel/pull/22304
## Summary _Claude Code on behalf of Otavio Piske_ - Replace lambdas with method references where applicable (SonarCloud rule S1612) - Covers 145 files across core, components, dsl, test-infra, and tooling modules - ~220 lambda-to-method-reference replacements ## Details SonarCloud rule S1612 flags lambdas that can be replaced with method references for improved readability. Examples: - `x -> x.method()` → `Type::method` - `() -> obj.method()` → `obj::method` - `x -> x instanceof Type` → `Type.class::isInstance` - `() -> new Type()` → `Type::new` A few cases were intentionally left as lambdas where method references cause type inference ambiguity (e.g., `assertDoesNotThrow` with methods that throw checked exceptions, or Camel DSL `body()` overloads). ## Test plan - [x] Core module tests pass (ObjectHelperTest, ServiceSupportTest, FluentProducerTemplateTest, MainTest, etc.) - [x] All changed modules compile successfully (some modules have pre-existing build issues unrelated to this change) - [x] Kafka unit tests pass - [ ] CI verification -- 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]
