Removing a Sonar critical warning