Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.12.2
-
Novice
Description
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 an 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.