camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1470509 - in /camel/branches/camel-2.10.x: ./ camel-core/src/main/java/org/apache/camel/model/ camel-core/src/test/java/org/apache/camel/processor/interceptor/
Date Mon, 22 Apr 2013 13:47:27 GMT
Author: davsclaus
Date: Mon Apr 22 13:47:26 2013
New Revision: 1470509

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

Added:
    camel/branches/camel-2.10.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.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java

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

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/ProcessorDefinitionHelper.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java?rev=1470509&r1=1470508&r2=1470509&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
Mon Apr 22 13:47:26 2013
@@ -169,6 +169,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.10.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java?rev=1470509&r1=1470508&r2=1470509&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java
Mon Apr 22 13:47:26 2013
@@ -241,6 +241,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
      */



Mime
View raw message