
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
38 lines
801 B
Plaintext
38 lines
801 B
Plaintext
== Why is this an issue?
|
|
|
|
include::description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,text]
|
|
----
|
|
public class FruitException { // Noncompliant; this has nothing to do with Exception
|
|
private Fruit expected;
|
|
private String unusualCharacteristics;
|
|
private boolean appropriateForCommercialExploitation;
|
|
// ...
|
|
}
|
|
|
|
public class CarException { // Noncompliant; the extends clause was forgotten?
|
|
public CarException(String message, Throwable cause) {
|
|
// ...
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,text]
|
|
----
|
|
public class FruitSport {
|
|
private Fruit expected;
|
|
private String unusualCharacteristics;
|
|
private boolean appropriateForCommercialExploitation;
|
|
// ...
|
|
}
|
|
|
|
public class CarException extends Exception {
|
|
public CarException(String message, Throwable cause) {
|
|
// ...
|
|
----
|
|
|