fixed some pmd and checkstyle warnings.