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 2011/09/24 11:46:27 UTC
svn commit: r1175140 - in /camel/branches/camel-2.8.x: ./
camel-core/src/main/java/org/apache/camel/processor/
camel-core/src/test/java/org/apache/camel/processor/
Author: davsclaus
Date: Sat Sep 24 09:46:27 2011
New Revision: 1175140
URL: http://svn.apache.org/viewvc?rev=1175140&view=rev
Log:
Merged revisions 1175139 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r1175139 | davsclaus | 2011-09-24 11:44:16 +0200 (Sat, 24 Sep 2011) | 1 line
CAMEL-4482: Fixed issue when exception thrown from using custom expression with Splitter EIP, not being triggered by onException.
........
Added:
camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/processor/SplitterThrowExceptionFromExpressionTest.java
- copied unchanged from r1175139, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterThrowExceptionFromExpressionTest.java
Modified:
camel/branches/camel-2.8.x/ (props changed)
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/Splitter.java
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Sep 24 09:46:27 2011
@@ -1 +1 @@
-/camel/trunk:1173732,1173958,1174047,1174129,1174245,1174565,1174626,1174745,1174817,1174837
+/camel/trunk:1173732,1173958,1174047,1174129,1174245,1174565,1174626,1174745,1174817,1174837,1175139
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java?rev=1175140&r1=1175139&r2=1175140&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java Sat Sep 24 09:46:27 2011
@@ -794,6 +794,12 @@ public class MulticastProcessor extends
result.add(createProcessorExchangePair(index++, processor, copy, routeContext));
}
+ if (exchange.getException() != null) {
+ // force any exceptions occurred during creation of exchange paris to be thrown
+ // before returning the answer;
+ throw exchange.getException();
+ }
+
return result;
}
Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/Splitter.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/Splitter.java?rev=1175140&r1=1175139&r2=1175140&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/Splitter.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/Splitter.java Sat Sep 24 09:46:27 2011
@@ -97,14 +97,26 @@ public class Splitter extends MulticastP
}
@Override
- protected Iterable<ProcessorExchangePair> createProcessorExchangePairs(Exchange exchange) {
+ protected Iterable<ProcessorExchangePair> createProcessorExchangePairs(Exchange exchange) throws Exception {
Object value = expression.evaluate(exchange, Object.class);
+ if (exchange.getException() != null) {
+ // force any exceptions occurred during evaluation to be thrown
+ throw exchange.getException();
+ }
+ Iterable<ProcessorExchangePair> answer;
if (isStreaming()) {
- return createProcessorExchangePairsIterable(exchange, value);
+ answer = createProcessorExchangePairsIterable(exchange, value);
} else {
- return createProcessorExchangePairsList(exchange, value);
+ answer = createProcessorExchangePairsList(exchange, value);
+ }
+ if (exchange.getException() != null) {
+ // force any exceptions occurred during creation of exchange paris to be thrown
+ // before returning the answer;
+ throw exchange.getException();
}
+
+ return answer;
}
@SuppressWarnings("unchecked")