Steffen Ryll created CAMEL-8213:
-----------------------------------
Summary: UseOriginalAggregationStrategy is suspicious to
NullPointerException
Key: CAMEL-8213
URL: https://issues.apache.org/jira/browse/CAMEL-8213
Project: Camel
Issue Type: Bug
Components: camel-core
Affects Versions: 2.14.1
Reporter: Steffen Ryll
Priority: Trivial
The default constructor of UseOriginalAggregationStrategy sets the final field
{{original}} to null.
In one corner case, the {{aggregate}} will dereference this null pointer, as no
null-pointer check is made.
{code}
public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
if (propagateException) {
Exception exception = checkException(oldExchange, newExchange);
if (exception != null) {
original.setException(exception);
}
}
return original != null ? original : oldExchange;
}
{code}
This potential NPE should be fixed, maybe a unit test be added.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)