Changes to the code so that pmd and checkstyle pass