fixed a bug where java hooks are incorrectly generated