This rule is Obsolete | |
Synopsis: | A method should have only one exit point, and that should be the last statement in the method |
Language: | Java |
Severity Level: | 6 |
Category: | Controversial |
Description: |
A method should have only one exit point, and that should be the last statement in the method.public class OneReturnOnly1 { public void foo(int x) { if (x > 0) { return "hey"; // oops, multiple exit points! } return "hi"; } } |