compiler: java: fix validation