[Java]: Fix warnings and style.