This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new f1017e0  Polished
f1017e0 is described below

commit f1017e096f54574d299e9f78b259f13842114ffe
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu Apr 18 10:55:18 2019 +0200

    Polished
---
 .../main/java/org/apache/camel/language/bean/BeanExpression.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/core/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
 
b/core/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
index 594aa24..38d4a52 100644
--- 
a/core/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
+++ 
b/core/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
@@ -30,8 +30,9 @@ import org.apache.camel.component.bean.BeanHolder;
 import org.apache.camel.component.bean.ConstantBeanHolder;
 import org.apache.camel.component.bean.ConstantTypeBeanHolder;
 import org.apache.camel.component.bean.RegistryBean;
-import org.apache.camel.language.simple.SimpleLanguage;
+import org.apache.camel.spi.Language;
 import org.apache.camel.support.ExchangeHelper;
+import org.apache.camel.support.LanguageSupport;
 import org.apache.camel.util.KeyValueHolder;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.OgnlHelper;
@@ -308,8 +309,9 @@ public class BeanExpression implements Expression, 
Predicate {
             // if there was a key then we need to lookup using the key
             if (key != null) {
                 // if key is a nested simple expression then re-evaluate that 
again
-                if (SimpleLanguage.hasSimpleFunction(key)) {
-                    key = SimpleLanguage.expression(key).evaluate(exchange, 
String.class);
+                if (LanguageSupport.hasSimpleFunction(key)) {
+                    Language lan = 
exchange.getContext().resolveLanguage("simple");
+                    key = lan.createExpression(key).evaluate(exchange, 
String.class);
                 }
                 if (key != null) {
                     result = lookupResult(resultExchange, key, result, 
nullSafe, ognlPath, holder.getBean());

Reply via email to