[Java] Fixed a compile error.