Java: apply a patch which solves the ticket #4313