35 lines
684 B
Plaintext
35 lines
684 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
public long computeDurationInMilliseconds() {
|
|
long duration = (((hours * 60) + minutes) * 60 + seconds ) * 1000 ;
|
|
return duration;
|
|
}
|
|
|
|
public void doSomething() {
|
|
RuntimeException myException = new RuntimeException();
|
|
throw myException;
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
public long computeDurationInMilliseconds() {
|
|
return (((hours * 60) + minutes) * 60 + seconds ) * 1000 ;
|
|
}
|
|
|
|
public void doSomething() {
|
|
throw new RuntimeException();
|
|
}
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|