[#1809] Add patch for javaflow
* some code cleanup