You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/04/18 06:33:40 UTC

[camel] branch main updated: (chores) camel-bean: remove unused parameter

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


The following commit(s) were added to refs/heads/main by this push:
     new 85ded4105e9 (chores) camel-bean: remove unused parameter
85ded4105e9 is described below

commit 85ded4105e9fc1b612bbbcab439316762c4352d6
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Apr 18 06:52:15 2023 +0200

    (chores) camel-bean: remove unused parameter
---
 .../src/main/java/org/apache/camel/component/bean/BeanHelper.java   | 6 +++---
 .../src/main/java/org/apache/camel/component/bean/BeanInfo.java     | 4 ++--
 .../src/main/java/org/apache/camel/component/bean/MethodInfo.java   | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanHelper.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanHelper.java
index 68bd15062c9..f50b93745d4 100644
--- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanHelper.java
+++ b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanHelper.java
@@ -35,7 +35,7 @@ public final class BeanHelper {
      * @param  value the value
      * @return       the parameter type the given value is being mapped as, or <tt>null</tt> if not valid.
      */
-    public static Class<?> getValidParameterType(ClassResolver resolver, String value) {
+    public static Class<?> getValidParameterType(String value) {
         if (ObjectHelper.isEmpty(value)) {
             return null;
         }
@@ -95,13 +95,13 @@ public final class BeanHelper {
      * @param  value the value
      * @return       <tt>true</tt> if valid, <tt>false</tt> otherwise
      */
-    public static boolean isValidParameterValue(ClassResolver classResolver, String value) {
+    public static boolean isValidParameterValue(String value) {
         if (ObjectHelper.isEmpty(value)) {
             // empty value is valid
             return true;
         }
 
-        return getValidParameterType(classResolver, value) != null;
+        return getValidParameterType(value) != null;
     }
 
     /**
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 61e52942c63..03282944ff1 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
@@ -682,7 +682,7 @@ public class BeanInfo {
                     parameter = parameter.trim();
                 }
 
-                Class<?> parameterType = BeanHelper.getValidParameterType(exchange.getContext().getClassResolver(), parameter);
+                Class<?> parameterType = BeanHelper.getValidParameterType(parameter);
                 Class<?> expectedType = info.getParameters().get(index).getType();
 
                 if (parameterType != null && expectedType != null) {
@@ -1133,7 +1133,7 @@ public class BeanInfo {
                     }
 
                     if (!qualifyType.endsWith(".class")
-                            && !BeanHelper.isValidParameterValue(getCamelContext().getClassResolver(), value)) {
+                            && !BeanHelper.isValidParameterValue(value)) {
                         // its a parameter value, so continue to next parameter
                         // as we should only check for FQN/type parameters
                         return false;
diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/MethodInfo.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/MethodInfo.java
index ee1b5cbb06f..0aa6d29123b 100644
--- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/MethodInfo.java
+++ b/components/camel-bean/src/main/java/org/apache/camel/component/bean/MethodInfo.java
@@ -656,7 +656,7 @@ public class MethodInfo {
                 }
 
                 // check if its a valid parameter value (no type declared via .class syntax)
-                valid = BeanHelper.isValidParameterValue(exchange.getContext().getClassResolver(), exp);
+                valid = BeanHelper.isValidParameterValue(exp);
                 if (!valid) {
                     // it may be a parameter type instead, and if so, then we should return null,
                     // as this method is only for evaluating parameter values
@@ -702,7 +702,7 @@ public class MethodInfo {
                             // which may change the parameterValue, so we have to check it again to see if it is now valid
                             exp = exchange.getContext().getTypeConverter().tryConvertTo(String.class, parameterValue);
                             // re-validate if the parameter was not valid the first time
-                            valid = BeanHelper.isValidParameterValue(exchange.getContext().getClassResolver(), exp);
+                            valid = BeanHelper.isValidParameterValue(exp);
                         }
                     }
                 }