camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/3] git commit: CAMEL-7513: Fixed POJO aggregating when the parameter type was referring to a type that was class annotated.
Date Mon, 16 Jun 2014 18:39:19 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x a52183e5f -> 3c4f98a04
  refs/heads/camel-2.13.x e72ea3579 -> 6dcb9459f
  refs/heads/master 9f90b0274 -> 85ced0668


CAMEL-7513: Fixed POJO aggregating when the parameter type was referring to a type that was
class annotated.


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

Branch: refs/heads/master
Commit: 85ced0668804152d08598b5686946acfe54d4a8f
Parents: 9f90b02
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Jun 16 20:36:27 2014 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Jun 16 20:36:27 2014 +0200

----------------------------------------------------------------------
 .../processor/aggregate/AggregationStrategyBeanInfo.java  | 10 ++++++----
 .../AggregationStrategyBeanAdapterAllowNullTest.java      |  5 +++++
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/85ced066/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategyBeanInfo.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategyBeanInfo.java
b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategyBeanInfo.java
index f898be7..ed93a96e 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategyBeanInfo.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationStrategyBeanInfo.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.processor.aggregate;
 
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
@@ -62,10 +63,11 @@ public class AggregationStrategyBeanInfo {
         }
 
         // must not have annotations as they are not supported (yet)
-        for (int i = 0; i < size; i++) {
-            Class<?> type = parameterTypes[i];
-            if (type.getAnnotations().length > 0) {
-                throw new IllegalArgumentException("Parameter annotations at index " + i
+ " is not supported on method: " + method);
+        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
+        for (int i = 0; i < parameterAnnotations.length; i++) {
+            Annotation[] annotations = parameterAnnotations[i];
+            if (annotations.length > 0) {
+                throw new IllegalArgumentException("Method parameter annotation: " + annotations[0]
+ " at index: " + i + " is not supported on method: " + method);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/85ced066/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregationStrategyBeanAdapterAllowNullTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregationStrategyBeanAdapterAllowNullTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregationStrategyBeanAdapterAllowNullTest.java
index 525c04d..d164d2e 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregationStrategyBeanAdapterAllowNullTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregationStrategyBeanAdapterAllowNullTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.processor.aggregator;
 
 import java.util.ArrayList;
 import java.util.List;
+import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
@@ -66,6 +67,10 @@ public class AggregationStrategyBeanAdapterAllowNullTest extends ContextTestSupp
         }
     }
 
+    /**
+     * We support annotations on the types.
+     */
+    @XmlRootElement(name = "user")
     public static final class User {
         private String name;
 


Mime
View raw message