Code analisys improvements (Intellij Idea) part of JAMES-1220

* redundant code removal
* for-each transforamations
* 'final' attribute added
* fixed some Thread locking issues - avoid locking on non-final objects and also on method objects
* added a lot of @Override's