Dye357 created CAMEL-7785:
-----------------------------

             Summary: setUnitOfWork in DefaultExchange throws NPE when called 
from Splitter.java
                 Key: CAMEL-7785
                 URL: https://issues.apache.org/jira/browse/CAMEL-7785
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.12.2
            Reporter: Dye357
            Priority: Minor


setUnitOfWork in DefaultExchange throws NPE when called from Splitter.java, 

Line 226 of Splitter.java is: exchange.setUnitOfWork(null);

Line 372 of DefaultExchange.java checks if onCompletions !=null, in this case 
because Splitter.java initialized unitOfWork to null on line 376 
unitOfWork.addSynchronization(onCompletion) will throw and NPE since unitOfWork 
is still null.

Recommendation:

Line 372 of defaultExchange.java should include a check if unitOfWork is not 
null:

if(onCompletions !=null && unitOfWork != null)

Steps to reproduce:

1. Include a Split EIP in a Camel Route.
2. Specify an onPrepareRef=<class>
3. Add an onCompletion step to the exchange in <class>
4. NPE should be thrown when processing files.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to