camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [4/4] git commit: Applying: CAMEL-7478 Fixed the simple language OGNL expression issue of length
Date Fri, 06 Jun 2014 01:07:22 GMT
Applying: CAMEL-7478 Fixed the simple language OGNL expression issue of length


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/69b00a31
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/69b00a31
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/69b00a31

Branch: refs/heads/master
Commit: 69b00a31f7bff003fb530b9ce9fd8d368d61190e
Parents: a6d8468
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Fri Jun 6 09:06:43 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Fri Jun 6 09:06:43 2014 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/component/bean/BeanInfo.java  | 2 ++
 .../main/java/org/apache/camel/language/bean/BeanExpression.java | 2 --
 .../test/java/org/apache/camel/language/simple/SimpleTest.java   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/69b00a31/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
index 53c1254..5b8804d 100644
--- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
+++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
@@ -228,6 +228,8 @@ public class BeanInfo {
                     List<ParameterInfo> lpi = new ArrayList<ParameterInfo>(1);
                     lpi.add(pi);
                     methodInfo = new MethodInfo(exchange.getContext(), pojo.getClass(), method,
lpi, lpi, false, false);
+                    // Need to update the message body to be pojo for the invocation
+                    exchange.getIn().setBody(pojo);
                 } catch (NoSuchMethodException e) {
                     throw new MethodNotFoundException(exchange, pojo, "getClass");
                 }

http://git-wip-us.apache.org/repos/asf/camel/blob/69b00a31/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java b/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
index 1092f6e..3cbc2fa 100644
--- a/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
+++ b/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
@@ -300,8 +300,6 @@ public class BeanExpression implements Expression, Predicate {
 
                 // prepare for next bean to invoke
                 beanToCall = result;
-                // we need to set the result to the exchange for further processing
-                resultExchange.getIn().setBody(result);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/69b00a31/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java b/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
index d12efed..85d99cd 100644
--- a/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
+++ b/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
@@ -146,12 +146,12 @@ public class SimpleTest extends LanguageTestSupport {
     
     public void testBodyExpressionWithArray() throws Exception {
         exchange.getIn().setBody(new MyClass());
-        Expression exp = SimpleLanguage.simple("body.getMyArray");
+        Expression exp = SimpleLanguage.simple("body.myArray");
         assertNotNull(exp);
         Object val = exp.evaluate(exchange, Object.class);
         assertIsInstanceOf(Object[].class, val);
         
-        exp = SimpleLanguage.simple("body.getMyArray.length");
+        exp = SimpleLanguage.simple("body.myArray.length");
         assertNotNull(exp);
         val = exp.evaluate(exchange, Object.class);
         assertIsInstanceOf(Integer.class, val);


Mime
View raw message