[
https://issues.apache.org/jira/browse/CAMEL-13158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-13158.
---------------------------------
Resolution: Fixed
Assignee: Claus Ibsen
Fix Version/s: 3.0.0
> Unable to invoke beans starting with the string "header" using toD
> ------------------------------------------------------------------
>
> Key: CAMEL-13158
> URL: https://issues.apache.org/jira/browse/CAMEL-13158
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.23.1
> Reporter: Adam Campbell
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 3.0.0
>
>
>
> I found one strange behavior when I added below to my route:
>
> {code:java}
> from(...)
> .toD("headerEnricher"){code}
>
> After some debugging with below unit test, I was able to find the culprit as
> this line which is interpreting "headerEnricher" as if it is equivalent to
> "header.Enricher" or "header[Enricher]"
> [https://github.com/apache/camel/blob/camel-2.23.x/camel-core/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java#L352]
>
>
> {code:java}
> @Test
> public void testSimpleHeaderString() {
> final Language lan = new DefaultCamelContext().resolveLanguage("simple");
> final Expression exp = lan.createExpression("hederEnricher");
> //Pass
> Assert.assertEquals(exp.toString(), "hederEnricher");
> final Expression exp2 = lan.createExpression("headerEnricher");
> //Fail
> Assert.assertEquals(exp2.toString(), "headerEnricher");
> }
> {code}
>
> My thought is that the legacy syntax should not try to parse the header
> expression unless it is followed by some kind of valid operator character
> like . or ? or [
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)