Don’t iterate over keys and look up the values, iterate over entries

Discovered by FindBugs.
Don’t use String concatenation in loops, use a StringBuilder

Discovered by FindBugs.
Declare constants as static

Discovered by FindBugs.
Remove completely unused fields

Discovered by FindBugs.
Remove unused parameter

Discovered by FindBugs.