java_gen: minor fixes

Reviewer: @vaterlaus

I'm holding back on the Hashing pull req for now to think about it a little more.