CAMEL-21014: Fixed doFinally clause with route template#14913
CAMEL-21014: Fixed doFinally clause with route template#14913orpiske merged 2 commits intoapache:mainfrom
Conversation
…doFinally clause [ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0
…ct copying and the comparison finallyClause != output (always true due to the copying) [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🤖 CI automation will test this PR automatically. 🐫 Apache Camel Committers, please review the following items:
|
orpiske
left a comment
There was a problem hiding this comment.
Thanks for your contribution. Marking this as a request changes we need:
- Run a manual full test
- A ticket
- More reviews
First full test run fine. Nice one @carnevalegiacomo! Let's wait for more reviews (and, also, creating a ticket would be recommended - even though this is small, it is modifying the core code). |
Hi https://issues.apache.org/jira/projects/CAMEL/issues/CAMEL-21014?filter=allopenissues |
Description
In the TryDefinition class, the following condition is always true when copyDefinition is used:
if (finallyClause != null && output != finallyClause) {
throw new IllegalArgumentException(
"Multiple finally clauses added: " + finallyClause + " and " + output);
}
Added src/test/java/org/apache/camel/model/TryDefinitionTest.java:
tryDefinition with only one doFinally
copyDefinition
no exception is expected
tryDefinition with two doFinally
copyDefinition
exception is expected
c446202
TryDefinitionTest: reproduced IllegalArgumentException with only one doFinally clause
Fix: removed if (finallyClause != null && output != finallyClause) and added doFinally clause counter
a1144f1
Target
camel-3.x, whereas Camel 4 uses themainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally and I have committed all auto-generated changes