49 lines
631 B
Plaintext
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[]
|