LPS-49294 Part 1: Use local variables in order to ensure that final vari...

...ables are explicitly initialized and modified only once