2020-06-30 10:16:44 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
if (x == 0) {
|
|
|
|
doSomething();
|
|
|
|
} else if (x == 1) {
|
|
|
|
doSomethingElse();
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
if (x == 0) {
|
|
|
|
doSomething();
|
|
|
|
} else if (x == 1) {
|
|
|
|
doSomethingElse();
|
|
|
|
} else {
|
|
|
|
throw new IllegalStateException();
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
2021-09-17 13:44:41 +02:00
|
|
|
== See
|
|
|
|
|
|
|
|
* https://wiki.sei.cmu.edu/confluence/x/RtYxBQ[CERT, MSC01-C.] - Strive for logical completeness
|
|
|
|
* https://wiki.sei.cmu.edu/confluence/x/jzZGBQ[CERT, MSC57-J.] - Strive for logical completeness
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-06-08 15:52:13 +02:00
|
|
|
'''
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|