Fix java regression introduced by previous commit