Bean Method Invocation regression in 2.11

2013-07-12 Thread Ashwin Pejavar
I'm testing my upgrade to 2.11 and noticed a bug in how beanMethod
invocations are parsed. 

I'm using Spring to define my routes.

The following invocation expression: exec(*, '', 'arg3') gets parsed as
arg1: *
arg2: ""
arg3: ",arg3" (notice the comma).

I tracked down the bug to the class org.apache.camel.util.StringQuoteHelper.
The code-block
} else if (ch == separator) {
// add as answer if we are not in a quote
if (!singleQuoted && !doubleQuoted && sb.length() > 0) {
String text = sb.toString();
if (trim) {
text = text.trim();
}
answer.add(text);
sb.setLength(0);
continue;
}
}

Should instead be
} else if (ch == separator) {
// add as answer if we are not in a quote
if (!singleQuoted && !doubleQuoted) {
if (sb.length() > 0) {
String text = sb.toString();
if (trim) {
text = text.trim();
}
answer.add(text);
sb.setLength(0);
}
continue; //always skip separator if not in quotes
}
}



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bean-Method-Invocation-regression-in-2-11-tp5735576.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bean Method Invocation regression in 2.11

2013-07-12 Thread Willem jiang
Hi,
Thanks for reporting this.
I just filled a JIRA[1] for it.

[1]https://issues.apache.org/jira/browse/CAMEL-6544  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Saturday, July 13, 2013 at 1:27 AM, Ashwin Pejavar wrote:

> I'm testing my upgrade to 2.11 and noticed a bug in how beanMethod
> invocations are parsed.  
>  
> I'm using Spring to define my routes.
>  
> The following invocation expression: exec(*, '', 'arg3') gets parsed as
> arg1: *
> arg2: ""
> arg3: ",arg3" (notice the comma).
>  
> I tracked down the bug to the class org.apache.camel.util.StringQuoteHelper.
> The code-block
> } else if (ch == separator) {
> // add as answer if we are not in a quote
> if (!singleQuoted && !doubleQuoted && sb.length() > 0) {
> String text = sb.toString();
> if (trim) {
> text = text.trim();
> }
> answer.add(text);
> sb.setLength(0);
> continue;
> }
> }
>  
> Should instead be
> } else if (ch == separator) {
> // add as answer if we are not in a quote
> if (!singleQuoted && !doubleQuoted) {
> if (sb.length() > 0) {
> String text = sb.toString();
> if (trim) {
> text = text.trim();
> }
> answer.add(text);
> sb.setLength(0);
> }
> continue; //always skip separator if not in quotes
> }
> }
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bean-Method-Invocation-regression-in-2-11-tp5735576.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).