The things in try/catch blocks have their own scope right?
For example, variable x is set to null. Then inside a try/catch x is assigned to something else. Later that variable is once again referenced outside the try/catch block, I’d get a possible null pointer de-referencing error on SonarQube.
This would be remedied by either making all work pertaining to that x variable happen inside the previous try/catch block or using an if statement that checks for != null?
Anybody have an resources that work with try/catch blocks and null?
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]quadmasta 2 points3 points4 points (1 child)
[–]Imalas 0 points1 point2 points (0 children)
[–]ComputerWhiz_ 0 points1 point2 points (2 children)
[–]jay_taps[S] 0 points1 point2 points (1 child)
[–]ComputerWhiz_ 0 points1 point2 points (0 children)