Java API: Revert “make prototype callback chain simpler”