Sonar Violations and Formatting

Wow, this is weird. Not your change just this bit of code. I hope this does what it's supposed to, because it seems like it might be incredibly unsafe.