camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashwin Pejavar <ashwin.peja...@gmail.com>
Subject Bean Method Invocation regression in 2.11
Date Fri, 12 Jul 2013 17:27:22 GMT
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.

Mime
View raw message