[ 
https://issues.apache.org/activemq/browse/CAMEL-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45108#action_45108
 ] 

Claus Ibsen commented on CAMEL-840:
-----------------------------------

Okay got a much better solution now with better end-user feedback

{code}
java.lang.IllegalArgumentException: Could not find a suitable setter for 
property: expression as there isn't a setter method with same type: 
java.lang.String nor type convertion possbile: Could not convert "${id}.bak" to 
org.apache.camel.Expression
{code}

Would be thrown in case there isn't a setExpression(String stringType) or no 
type converters from Expression -> String.
Adding the setExpression(String stringType) will let Camel pick this overloaded 
method instead and use it.

> IntrospectionSupport to support overloaded setter methods
> ---------------------------------------------------------
>
>                 Key: CAMEL-840
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-840
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>
> If you have overloaded setter methods for a given property Camel can only use 
> the first found.
> {code}
>     private Expression expression;
>     public void setExpression(Expression expression) {
>         this.expression = expression;
>     }
>     public void setExpression(String fileLanguageExpression) {
>         this.expression = FileLanguage.file(fileLanguageExpression);
>     }
> {code}
> isn't supported. As Camel will try to convert the type before finding the 2nd 
> setter method with the correct type.
> Maybe the solution is to improve the code so it finds the String setter if 
> the input is a string property instead of the Expression object, ie find the 
> setter with a 100% match and use it, if not then fallback to type convertions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to