fix oscillating code

See: http://stackoverflow.com/a/24417812

Also, add final to parameters automatically. Easier
for checkstyle.