rspec/rules/S2486/java/rule.adoc
2021-02-02 16:54:43 +01:00

49 lines
631 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
----
public void doTheThing() {
try {
// ...
catch (IOException e) { // Noncompliant
}
}
----
== Compliant Solution
----
public void doTheThing() throws IOException {
// ...
}
----
or
----
public void doTheThing() {
try {
// ...
catch (IOException e) {
LOGGER.info(e);
}
}
----
or
----
public void doTheThing() {
try {
// ...
catch (IOException e) {
// comment explaining why taking no action is appropriate
}
}
----
== Exceptions
When a block contains a comment, it is not considered to be empty.
include::../see.adoc[]