Hi everybody,

I'm currently upgrading from Camel 2.14.1 to 2.15.2, after the upgrade some
of my test are failing.

My route is:


My test contains :


The weaveAddLast is failing with the following stackTrace:

java.lang.UnsupportedOperationException
        at java.util.AbstractList.add(AbstractList.java:148)
        at
org.apache.camel.builder.AdviceWithTasks$4.task(AdviceWithTasks.java:298)
        at
org.apache.camel.model.RouteDefinition.adviceWith(RouteDefinition.java:270)

After some debug I found that when my route and with a Choice I cannot
weaveAddLast the route.
When the AdviceWithTasks task method try to add the outputs ( here
<https://github.com/apache/camel/blob/camel-2.15.2/camel-core/src/main/java/org/apache/camel/builder/AdviceWithTasks.java#L298>
 
) the implementation of the list return by the ChoiceDefinition class does
not implements the method add(int,Object) then we have the
UnsupportedOperation

The difference between 2.14.1 and 2.15.2 is that in the AdviceWithTasks the
outputs list where the weaveAddLast try to find the last Processor to add
the outputs is not a list returned by ChoiceDefinition but it's a list with
the Logs processor.

This difference is there because now in 2.15.2 the method that is going
through the route to retrieve the outputs nodes have a maximum depth which
is computed  here
<https://github.com/apache/camel/blob/camel-2.15.2/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java#L221>
   

When my route have finish with a ChoiceDefinition the maximum depth computed
is only 1 then I cannot have my logs in outputs an the weaveAddLast have in
his list only the ChoiceDefinition.

Can you confirm if it's an expected behavior that is now not allowed in
2.15.2 because i didn't see anything about this in the release note, or is
it a misunderstanding of the use of weaveAddLast on my side.

Or if it's actually an issue, if yes do you want me to create an issue in
the Camel Jira ?

PS: I've tested it in 2.14.2 and the issue is also present in this version.

Thanks in advance,

Guillaume




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-15-2-weaveAddLast-throwing-UnsupportedOperation-when-route-have-a-ChoiceDefinition-tp5767464.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to