[doc] Rule doc: add maximum language version

Fixes #4140
This commit is contained in:
Andreas Dangel
2022-10-20 17:25:09 +02:00
parent f54ca8b364
commit ebf3837199
3 changed files with 10 additions and 1 deletions

View File

@ -392,6 +392,12 @@ public class RuleDocGenerator {
lines.add("");
}
if (rule.getMaximumLanguageVersion() != null) {
lines.add("**Maximum Language Version:** "
+ rule.getLanguage().getName() + " " + rule.getMaximumLanguageVersion().getVersion());
lines.add("");
}
lines.addAll(EscapeUtils.escapeLines(toLines(stripIndentation(rule.getDescription()))));
lines.add("");

View File

@ -155,6 +155,8 @@ Avoid jumbled loop incrementers - its usually a mistake, and is confusing even i
**Minimum Language Version:** Java 1.5
**Maximum Language Version:** Java 11
Override both `public boolean Object.equals(Object other)`, and `public int Object.hashCode()`, or override neither.
Even if you are inheriting a `hashCode()` from a parent class, consider implementing hashCode and explicitly
delegating to your superclass.

View File

@ -89,7 +89,8 @@ public class Bar {
message="Ensure you override both equals() and hashCode()"
class="net.sourceforge.pmd.lang.java.rule.errorprone.OverrideBothEqualsAndHashcodeRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_sample.html#overridebothequalsandhashcode"
minimumLanguageVersion="1.5">
minimumLanguageVersion="1.5"
maximumLanguageVersion="11">
<description>
Override both `public boolean Object.equals(Object other)`, and `public int Object.hashCode()`, or override neither.
Even if you are inheriting a `hashCode()` from a parent class, consider implementing hashCode and explicitly