rspec/rules/S128/exceptions.adoc
Arseniy Zaostrovnykh 7ca29f686f Force linebreaks
2021-02-02 15:02:10 +01:00

22 lines
498 B
Plaintext

== Exceptions
This rule is relaxed in the following cases:
----
switch (myVariable) {
case 0: // Empty case used to specify the same behavior for a group of cases.
case 1:
doSomething();
break;
case 2: // Use of return statement
return;
case 3: // Use of throw statement
throw new IllegalStateException();
case 4: // Use of continue statement
continue;
default: // For the last case, use of break statement is optional
doSomethingElse();
}
----