You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/04/22 17:10:55 UTC

svn commit: r1470571 - in /camel/branches/camel-2.11.x: ./ camel-core/src/main/java/org/apache/camel/model/ camel-core/src/test/java/org/apache/camel/processor/interceptor/

Author: davsclaus
Date: Mon Apr 22 15:10:54 2013
New Revision: 1470571

URL: http://svn.apache.org/r1470571
Log:
CAMEL-6300: Fixed advice with not working with doTry .. doCatch.

Added:
    camel/branches/camel-2.11.x/camel-core/src/test/java/org/apache/camel/processor/interceptor/AdviceWithTryCatchTest.java
      - copied unchanged from r1470508, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/interceptor/AdviceWithTryCatchTest.java
Modified:
    camel/branches/camel-2.11.x/   (props changed)
    camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
    camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java

Propchange: camel/branches/camel-2.11.x/
------------------------------------------------------------------------------
    svn:mergeinfo = /camel/trunk:1470508

Propchange: camel/branches/camel-2.11.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Apr 22 15:10:54 2013
@@ -1 +1 @@
-/camel/trunk:1-1468763
+/camel/trunk:1-1468763,1470508

Modified: camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java?rev=1470571&r1=1470570&r2=1470571&view=diff
==============================================================================
--- camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java (original)
+++ camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java Mon Apr 22 15:10:54 2013
@@ -213,6 +213,25 @@ public final class ProcessorDefinitionHe
                 }
             }
 
+            // special for try ... catch ... finally
+            if (out instanceof TryDefinition) {
+                TryDefinition doTry = (TryDefinition) out;
+                List<ProcessorDefinition<?>> doTryOut = doTry.getOutputsWithoutCatches();
+                doFindType(doTryOut, type, found);
+
+                List<CatchDefinition> doTryCatch = doTry.getCatchClauses();
+                for (CatchDefinition doCatch : doTryCatch) {
+                    doFindType(doCatch.getOutputs(), type, found);
+                }
+
+                if (doTry.getFinallyClause() != null) {
+                    doFindType(doTry.getFinallyClause().getOutputs(), type, found);
+                }
+
+                // do not check children as we already did that
+                continue;
+            }
+
             // try children as well
             List<ProcessorDefinition<?>> children = out.getOutputs();
             doFindType(children, type, found);

Modified: camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java?rev=1470571&r1=1470570&r2=1470571&view=diff
==============================================================================
--- camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java (original)
+++ camel/branches/camel-2.11.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java Mon Apr 22 15:10:54 2013
@@ -245,6 +245,13 @@ public class TryDefinition extends Outpu
         super.addOutput(output);
     }
 
+    @Override
+    protected void preCreateProcessor() {
+        // force re-creating initialization to ensure its up-to-date
+        initialized = false;
+        checkInitialized();
+    }
+
     /**
      * Checks whether or not this object has been initialized
      */