This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 1dbf795ab421d73262982498258ce96dfddd78a6
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Tue Jan 27 14:44:29 2026 +0000

    (chores): address PR comment - simplify null check in 
removeNonMatchingMethods
---
 .../src/main/java/org/apache/camel/component/bean/BeanInfo.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
 
b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
index 1aab72b52ede..f51695b2796a 100644
--- 
a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
+++ 
b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
@@ -1114,11 +1114,9 @@ public class BeanInfo {
     }
 
     private void removeNonMatchingMethods(List<MethodInfo> methods, String 
name) {
-        if (methods == null) {
-            return;
+        if (methods != null) {
+            methods.removeIf(info -> !matchMethod(info.getMethod(), name));
         }
-        // method does not match so remove it
-        methods.removeIf(info -> !matchMethod(info.getMethod(), name));
     }
 
     private void removeAllAbstractMethods(List<MethodInfo> methods) {

Reply via email to