camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1442047 - in /camel/branches/camel-2.10.x: ./ camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java camel-core/src/test/java/org/apache/camel/processor/CBRWhenUnmarshalEndChoiceTest.java
Date Mon, 04 Feb 2013 08:13:11 GMT
Author: davsclaus
Date: Mon Feb  4 08:13:10 2013
New Revision: 1442047

URL: http://svn.apache.org/viewvc?rev=1442047&view=rev
Log:
CAMEL-5953: Fixed Java DSL endChoice to avoid class cast exception when using unmarshal.

Added:
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/CBRWhenUnmarshalEndChoiceTest.java
      - copied unchanged from r1442046, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/CBRWhenUnmarshalEndChoiceTest.java
Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1442046

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java?rev=1442047&r1=1442046&r2=1442047&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
Mon Feb  4 08:13:10 2013
@@ -1250,7 +1250,14 @@ public abstract class ProcessorDefinitio
      * @return the builder
      */
     public ChoiceDefinition endChoice() {
-        ProcessorDefinition<?> def = end();
+        // are we already a choice?
+        ProcessorDefinition<?> def = this;
+        if (def instanceof ChoiceDefinition) {
+            return (ChoiceDefinition) def;
+        }
+
+        // okay end this and get back to the choice
+        def = end();
         if (def instanceof WhenDefinition) {
             return (ChoiceDefinition) def.getParent();
         } else if (def instanceof OtherwiseDefinition) {



Mime
View raw message