417 pmd errors

Dealt with most UnusedLocalVariable and UnusedFormalParameter warnings.