fixed up use of == to test for string equality rather than .equals().

Signed-off-by: John May <john.wilkinsonmay@gmail.com>
Removed some unused local variables (PMD reports).

Signed-off-by: John May <john.wilkinsonmay@gmail.com>