
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.
49 lines
585 B
Plaintext
49 lines
585 B
Plaintext
== Why is this an issue?
|
|
|
|
include::description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,text]
|
|
----
|
|
public class Fruit {
|
|
String plantingSeason;
|
|
//...
|
|
}
|
|
|
|
public class Raspberry {
|
|
String plantingseason; // Noncompliant
|
|
// ...
|
|
}
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,text]
|
|
----
|
|
public class Fruit {
|
|
String plantingSeason;
|
|
//...
|
|
}
|
|
|
|
public class Raspberry {
|
|
String whenToPlant;
|
|
// ...
|
|
}
|
|
----
|
|
Or
|
|
|
|
[source,text]
|
|
----
|
|
public class Fruit {
|
|
String plantingSeason;
|
|
//...
|
|
}
|
|
|
|
public class Raspberry { // field removed; parent field will be used instead
|
|
// ...
|
|
}
|
|
----
|
|
|