JavaAPI: performance tuning, fixing typo, remove unused parameter