From 3785cb2707b69ba9696e2eda82a5af8b0571b0b6 Mon Sep 17 00:00:00 2001
From: "Travis CI (pmd-bot)"
Signature<N>
from a
diff --git a/pmd_devdocs_roadmap.html b/pmd_devdocs_roadmap.html
index 1a81a41f97..39157a59f6 100644
--- a/pmd_devdocs_roadmap.html
+++ b/pmd_devdocs_roadmap.html
@@ -1565,7 +1565,7 @@ This should be configurable on per Rule basis similar to TR and SymbolTable.
diff --git a/pmd_devdocs_rule_deprecation_policy.html b/pmd_devdocs_rule_deprecation_policy.html
index 8f49f9f638..c4ba35d806 100644
--- a/pmd_devdocs_rule_deprecation_policy.html
+++ b/pmd_devdocs_rule_deprecation_policy.html
@@ -1534,7 +1534,7 @@ major release of PMD.
diff --git a/pmd_devdocs_writing_documentation.html b/pmd_devdocs_writing_documentation.html
index 0476ea15af..3b8e657b02 100644
--- a/pmd_devdocs_writing_documentation.html
+++ b/pmd_devdocs_writing_documentation.html
@@ -1681,7 +1681,7 @@ by specifying
-Dpmd.doc.checkExternalLinks=true<
diff --git a/pmd_java_metrics_index.html b/pmd_java_metrics_index.html
index 093698f066..927b14db4b 100644
--- a/pmd_java_metrics_index.html
+++ b/pmd_java_metrics_index.html
@@ -1775,7 +1775,7 @@ In Proceedings ACM Symposium on Software Reusability, 1995.
diff --git a/pmd_languages_jsp.html b/pmd_languages_jsp.html
index 50eb3a6c99..cd092db279 100644
--- a/pmd_languages_jsp.html
+++ b/pmd_languages_jsp.html
@@ -1475,7 +1475,7 @@ contains only “.java” files, JSP files obviously will not be checked.
diff --git a/pmd_next_major_development.html b/pmd_next_major_development.html
index 1e8eeb0681..b2f1466a50 100644
--- a/pmd_next_major_development.html
+++ b/pmd_next_major_development.html
@@ -2472,7 +2472,7 @@ will be removed with PMD 7.0.0. The rule is replaced by the more general
diff --git a/pmd_projectdocs_committers_main_landing_page.html b/pmd_projectdocs_committers_main_landing_page.html
index a5a255b495..1170f5e527 100644
--- a/pmd_projectdocs_committers_main_landing_page.html
+++ b/pmd_projectdocs_committers_main_landing_page.html
@@ -1514,7 +1514,7 @@ the new post is recognized and added to the news section and also on the news su
diff --git a/pmd_projectdocs_committers_merging_pull_requests.html b/pmd_projectdocs_committers_merging_pull_requests.html
index 80e6eb359b..bd8d49417b 100644
--- a/pmd_projectdocs_committers_merging_pull_requests.html
+++ b/pmd_projectdocs_committers_merging_pull_requests.html
@@ -1593,7 +1593,7 @@ integrated (e.g. gitk and github show the branches, from which the specific comm
diff --git a/pmd_projectdocs_committers_releasing.html b/pmd_projectdocs_committers_releasing.html
index d8105084c7..de1995fef7 100644
--- a/pmd_projectdocs_committers_releasing.html
+++ b/pmd_projectdocs_committers_releasing.html
@@ -1660,7 +1660,7 @@ and
mvn versions:set -DnewVersion=5.7.0-SNAPSHOT
diff --git a/pmd_projectdocs_credits.html b/pmd_projectdocs_credits.html
index ce11feb3d6..601ddb91dc 100644
--- a/pmd_projectdocs_credits.html
+++ b/pmd_projectdocs_credits.html
@@ -1936,7 +1936,7 @@ PMD scoreboard formulas, pmd-dcpd optimizations
diff --git a/pmd_projectdocs_faq.html b/pmd_projectdocs_faq.html
index df70976d84..0cbcbf5897 100644
--- a/pmd_projectdocs_faq.html
+++ b/pmd_projectdocs_faq.html
@@ -1469,7 +1469,7 @@ You must take this into account for certain rules.
diff --git a/pmd_projectdocs_trivia_meaning.html b/pmd_projectdocs_trivia_meaning.html
index 93602e990e..699ccbeef8 100644
--- a/pmd_projectdocs_trivia_meaning.html
+++ b/pmd_projectdocs_trivia_meaning.html
@@ -1438,7 +1438,7 @@ really know. We just think the letters sound good together.
diff --git a/pmd_projectdocs_trivia_news.html b/pmd_projectdocs_trivia_news.html
index 04a7364cdc..ad521ee8c6 100644
--- a/pmd_projectdocs_trivia_news.html
+++ b/pmd_projectdocs_trivia_news.html
@@ -1555,7 +1555,7 @@ interview with Ole-Martin and Tom
diff --git a/pmd_projectdocs_trivia_products.html b/pmd_projectdocs_trivia_products.html
index 5fd4006c69..912a3ee616 100644
--- a/pmd_projectdocs_trivia_products.html
+++ b/pmd_projectdocs_trivia_products.html
@@ -1486,7 +1486,7 @@ to catch web app security problems. Thanks to Joseph Hemler for the props!
diff --git a/pmd_projectdocs_trivia_similarprojects.html b/pmd_projectdocs_trivia_similarprojects.html
index 3eb45750ac..7bfc4e7151 100644
--- a/pmd_projectdocs_trivia_similarprojects.html
+++ b/pmd_projectdocs_trivia_similarprojects.html
@@ -1493,7 +1493,7 @@ only for maven project.
diff --git a/pmd_release_notes.html b/pmd_release_notes.html
index 0981d96e5c..bc38cf5abe 100644
--- a/pmd_release_notes.html
+++ b/pmd_release_notes.html
@@ -1416,6 +1416,23 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
Thanks to Fernando Cosso CPD can now find duplicates in XML files as well.
This is useful to find duplicated sections in XML files.
+New Rules
+
+
+ -
+
The new Java Rule LiteralsFirstInComparisons
(java-bestpractices
)
+find String literals, that are used in comparisons and are not positioned first. Using the String literal
+as the receiver of e.g. equals
helps to avoid NullPointerExceptions.
+
+ This rule is replacing the two old rules PositionLiteralsFirstInComparisons
+and PositionLiteralsFirstInCaseInsensitiveComparisons
and extends the check
+for the methods compareTo
, compareToIgnoreCase
and contentEquals
in addition to equals
and
+equalsIgnoreCase
.
+
+ Note: This rule also replaces the two mentioned rules in Java’s quickstart ruleset.
+
+
+
Fixed Issues
@@ -1429,11 +1446,26 @@ This is useful to find duplicated sections in XML files.
- #2484: [core] Update maven-enforcer-plugin to require Java 118
+ java
+
+ - #2472: [java] JavaCharStream throws an Error on invalid escape
+
+
java-bestpractices
- #2288: [java] JUnitTestsShouldIncludeAssert: Add support for Hamcrest MatcherAssert.assertThat
+ java-errorprone
+
+ - #2477: [java] JUnitSpelling false-positive for JUnit5/4 tests
+
+
+ swift
+
+ - #2473: [swift] Swift 5 (up to 5.2) support for CPD
+
+
API Changes
@@ -1442,6 +1474,9 @@ This is useful to find duplicated sections in XML files.
BaseLanguageModule#addVersion(String, LanguageVersionHandler, boolean)
+ - Some members of
TokenMgrError
, in particular, a new constructor is available
+that should be preferred to the old ones
+ ANTLRSyntaxError
Experimental APIs
@@ -1463,7 +1498,10 @@ definitive API.
#2452: [doc] Fix “Making Rulesets” doc sample code indentation - Artur Dryomov
#2457: [xml] Adding XML to CPD supported languages - Fernando Cosso
#2469: [apex] fix false positive unused variable if only a method is called - Gwilym Kuiper
+ #2475: [swift] Swift 4.2-5.2 support - kenji21
+ #2478: [java] New rule: LiteralsFirstInComparisons - John-Teng
#2479: [java] False positive with Hamcrest’s assertThat - andreoss
+ #2481: [java] Fix JUnitSpellingRule false positive - Artem Krosheninnikov
@@ -1482,7 +1520,7 @@ definitive API.
diff --git a/pmd_release_notes_old.html b/pmd_release_notes_old.html
index f71dd11b2e..faa143a49a 100644
--- a/pmd_release_notes_old.html
+++ b/pmd_release_notes_old.html
@@ -11973,7 +11973,7 @@ Added new HTML report format
diff --git a/pmd_rules_apex.html b/pmd_rules_apex.html
index 6c240e2c6f..397fd1c122 100644
--- a/pmd_rules_apex.html
+++ b/pmd_rules_apex.html
@@ -1634,7 +1634,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_apex_bestpractices.html b/pmd_rules_apex_bestpractices.html
index 8dce0d7c0d..00be4a4d94 100644
--- a/pmd_rules_apex_bestpractices.html
+++ b/pmd_rules_apex_bestpractices.html
@@ -1934,7 +1934,7 @@ Therefore delegate the triggers work to a regular class (often called Trigger ha
diff --git a/pmd_rules_apex_codestyle.html b/pmd_rules_apex_codestyle.html
index 5ac8350266..cf61f2d146 100644
--- a/pmd_rules_apex_codestyle.html
+++ b/pmd_rules_apex_codestyle.html
@@ -2507,7 +2507,7 @@ controlled from the rest.
diff --git a/pmd_rules_apex_design.html b/pmd_rules_apex_design.html
index a3980dee07..4b4990b960 100644
--- a/pmd_rules_apex_design.html
+++ b/pmd_rules_apex_design.html
@@ -2464,7 +2464,7 @@ city/state/zip fields could park them within a single Address field.
diff --git a/pmd_rules_apex_documentation.html b/pmd_rules_apex_documentation.html
index dcf13630f3..bdaaf8502e 100644
--- a/pmd_rules_apex_documentation.html
+++ b/pmd_rules_apex_documentation.html
@@ -1495,7 +1495,7 @@ order as the method signature.
diff --git a/pmd_rules_apex_errorprone.html b/pmd_rules_apex_errorprone.html
index ba93d3bf72..9e5a125eff 100644
--- a/pmd_rules_apex_errorprone.html
+++ b/pmd_rules_apex_errorprone.html
@@ -2148,7 +2148,7 @@ dealing with legacy code.
diff --git a/pmd_rules_apex_performance.html b/pmd_rules_apex_performance.html
index 97cc8bfa2c..2597eb449c 100644
--- a/pmd_rules_apex_performance.html
+++ b/pmd_rules_apex_performance.html
@@ -1598,7 +1598,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_apex_security.html b/pmd_rules_apex_security.html
index f9c164174a..ef9f139d3f 100644
--- a/pmd_rules_apex_security.html
+++ b/pmd_rules_apex_security.html
@@ -2105,7 +2105,7 @@ to avoid XSS attacks.
diff --git a/pmd_rules_ecmascript.html b/pmd_rules_ecmascript.html
index 849f334b08..9f2b4c1ea9 100644
--- a/pmd_rules_ecmascript.html
+++ b/pmd_rules_ecmascript.html
@@ -1511,7 +1511,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_ecmascript_bestpractices.html b/pmd_rules_ecmascript_bestpractices.html
index db46ab0b61..2de18d2a1a 100644
--- a/pmd_rules_ecmascript_bestpractices.html
+++ b/pmd_rules_ecmascript_bestpractices.html
@@ -1633,7 +1633,7 @@ It also improves readability, if the base is given.
diff --git a/pmd_rules_ecmascript_codestyle.html b/pmd_rules_ecmascript_codestyle.html
index e7cdb20669..28f5e0334c 100644
--- a/pmd_rules_ecmascript_codestyle.html
+++ b/pmd_rules_ecmascript_codestyle.html
@@ -1775,7 +1775,7 @@ will never execute. This is a bug, or extremely poor style.
diff --git a/pmd_rules_ecmascript_errorprone.html b/pmd_rules_ecmascript_errorprone.html
index ed1ba2b30a..983516b200 100644
--- a/pmd_rules_ecmascript_errorprone.html
+++ b/pmd_rules_ecmascript_errorprone.html
@@ -1556,7 +1556,7 @@ precision in a floating point number. This may result in numeric calculations b
diff --git a/pmd_rules_java.html b/pmd_rules_java.html
index 67156c3767..f34f2e6f22 100644
--- a/pmd_rules_java.html
+++ b/pmd_rules_java.html
@@ -1436,6 +1436,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
JUnitTestContainsTooManyAsserts: Unit tests should not contain too many asserts. Many asserts are indicative of a complex test, fo…
JUnitTestsShouldIncludeAssert: JUnit tests should include at least one assertion. This makes the tests more robust, and using a…
JUnitUseExpected: In JUnit4, use the @Test(expected) annotation to denote tests that should throw exceptions.
+ LiteralsFirstInComparisons: Position literals first in all String comparisons, if the second argument is null then NullPointe…
LooseCoupling: The use of implementation types (i.e., HashSet) as object references limits your ability to use a…
MethodReturnsInternalArray: Exposing internal arrays to the caller violates object encapsulation since elements can beremoved…
MissingOverride: Annotating overridden methods with @Override ensures at compile time that the method r…
@@ -1664,7 +1665,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
InstantiationToGetClass: Avoid instantiating an object just to call getClass() on it; use the .class public member instead.
InvalidLogMessageFormat: Check for messages in slf4j and log4j2 (since 6.19.0) loggers with non matching number of argumen…
JumbledIncrementer: Avoid jumbled loop incrementers - its usually a mistake, and is confusing even if intentional.
- JUnitSpelling: Some JUnit framework methods are easy to misspell.
+ JUnitSpelling: In JUnit 3, the setUp method is used to set up all data entities required in running tests. …
JUnitStaticSuite: The suite() method in a JUnit test needs to be both public and static.
LoggerIsNotStaticFinal: Deprecated In most cases, the Logger reference can be declared as static and final.This rule is deprecated a…
MethodWithSameNameAsEnclosingClass: Non-constructor methods should not have the same name as the enclosing class.
@@ -1983,7 +1984,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
It contains the following rules:
- AbstractClassWithoutAnyMethod, AssignmentInOperand, AssignmentToNonFinalStatic, AvoidAccessibilityAlteration, AvoidBranchingStatementAsLastInLoop, AvoidCatchingThrowable, AvoidDecimalLiteralsInBigDecimalConstructor, AvoidDollarSigns, AvoidInstanceofChecksInCatchClause, AvoidMessageDigestField, AvoidMultipleUnaryOperators, AvoidProtectedFieldInFinalClass, AvoidProtectedMethodInFinalClassNotExtending, AvoidStringBufferField, AvoidThreadGroup, AvoidUsingHardCodedIP, AvoidUsingOctalValues, AvoidUsingVolatile, BadComparison, BigIntegerInstantiation, BooleanInstantiation, BrokenNullCheck, CheckResultSet, CheckSkipResult, ClassCastExceptionWithToArray, ClassNamingConventions, ClassWithOnlyPrivateConstructorsShouldBeFinal, CloneMethodMustBePublic, CloneMethodMustImplementCloneable, CloneMethodReturnTypeMustMatchClassName, CloneThrowsCloneNotSupportedException, CloseResource, CompareObjectsWithEquals, ConstantsInInterface, ControlStatementBraces, DefaultLabelNotLastInSwitchStmt, DoNotCallGarbageCollectionExplicitly, DoNotExtendJavaLangError, DoNotExtendJavaLangThrowable, DontCallThreadRun, DontImportJavaLang, DontUseFloatTypeForLoopIndices, DoubleBraceInitialization, DoubleCheckedLocking, DuplicateImports, EmptyCatchBlock, EmptyFinalizer, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, EqualsNull, ExtendsObject, FinalFieldCouldBeStatic, ForLoopCanBeForeach, ForLoopShouldBeWhileLoop, FormalParameterNamingConventions, GenericsNaming, GuardLogStatement, IdempotentOperations, IdenticalCatchBranches, ImportFromSamePackage, InstantiationToGetClass, JumbledIncrementer, LocalVariableNamingConventions, LogicInversion, LooseCoupling, MethodNamingConventions, MisplacedNullCheck, MissingBreakInSwitch, MissingOverride, MissingStaticMethodInNonInstantiatableClass, NonCaseLabelInSwitchStatement, NonStaticInitializer, NonThreadSafeSingleton, NoPackage, OneDeclarationPerLine, OptimizableToArrayCall, OverrideBothEqualsAndHashcode, PackageCase, PositionLiteralsFirstInCaseInsensitiveComparisons, PositionLiteralsFirstInComparisons, PreserveStackTrace, ProperCloneImplementation, ProperLogger, ReturnEmptyArrayRatherThanNull, ReturnFromFinallyBlock, SimplifiedTernary, SimplifyBooleanReturns, SimplifyConditional, SingleMethodSingleton, SingletonClassReturningNewInstance, SingularField, SuspiciousEqualsMethodName, SuspiciousHashcodeMethodName, SuspiciousOctalEscape, SwitchStmtsShouldHaveDefault, UncommentedEmptyConstructor, UncommentedEmptyMethodBody, UnconditionalIfStatement, UnnecessaryAnnotationValueElement, UnnecessaryConstructor, UnnecessaryConversionTemporary, UnnecessaryFullyQualifiedName, UnnecessaryLocalBeforeReturn, UnnecessaryModifier, UnnecessaryReturn, UnsynchronizedStaticFormatter, UnusedFormalParameter, UnusedImports, UnusedLocalVariable, UnusedNullCheckInEquals, UnusedPrivateField, UnusedPrivateMethod, UseAssertEqualsInsteadOfAssertTrue, UseAssertNullInsteadOfAssertTrue, UseAssertSameInsteadOfAssertTrue, UseAssertTrueInsteadOfAssertEquals, UseCollectionIsEmpty, UseEqualsToCompareStrings, UselessOperationOnImmutable, UselessOverridingMethod, UselessParentheses, UselessQualifiedThis, UseLocaleWithCaseConversions, UseNotifyAllInsteadOfNotify, UseUtilityClass
+ AbstractClassWithoutAnyMethod, AssignmentInOperand, AssignmentToNonFinalStatic, AvoidAccessibilityAlteration, AvoidBranchingStatementAsLastInLoop, AvoidCatchingThrowable, AvoidDecimalLiteralsInBigDecimalConstructor, AvoidDollarSigns, AvoidInstanceofChecksInCatchClause, AvoidMessageDigestField, AvoidMultipleUnaryOperators, AvoidProtectedFieldInFinalClass, AvoidProtectedMethodInFinalClassNotExtending, AvoidStringBufferField, AvoidThreadGroup, AvoidUsingHardCodedIP, AvoidUsingOctalValues, AvoidUsingVolatile, BadComparison, BigIntegerInstantiation, BooleanInstantiation, BrokenNullCheck, CheckResultSet, CheckSkipResult, ClassCastExceptionWithToArray, ClassNamingConventions, ClassWithOnlyPrivateConstructorsShouldBeFinal, CloneMethodMustBePublic, CloneMethodMustImplementCloneable, CloneMethodReturnTypeMustMatchClassName, CloneThrowsCloneNotSupportedException, CloseResource, CompareObjectsWithEquals, ConstantsInInterface, ControlStatementBraces, DefaultLabelNotLastInSwitchStmt, DoNotCallGarbageCollectionExplicitly, DoNotExtendJavaLangError, DoNotExtendJavaLangThrowable, DontCallThreadRun, DontImportJavaLang, DontUseFloatTypeForLoopIndices, DoubleBraceInitialization, DoubleCheckedLocking, DuplicateImports, EmptyCatchBlock, EmptyFinalizer, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, EqualsNull, ExtendsObject, FinalFieldCouldBeStatic, ForLoopCanBeForeach, ForLoopShouldBeWhileLoop, FormalParameterNamingConventions, GenericsNaming, GuardLogStatement, IdempotentOperations, IdenticalCatchBranches, ImportFromSamePackage, InstantiationToGetClass, JumbledIncrementer, LiteralsFirstInComparisons, LocalVariableNamingConventions, LogicInversion, LooseCoupling, MethodNamingConventions, MisplacedNullCheck, MissingBreakInSwitch, MissingOverride, MissingStaticMethodInNonInstantiatableClass, NonCaseLabelInSwitchStatement, NonStaticInitializer, NonThreadSafeSingleton, NoPackage, OneDeclarationPerLine, OptimizableToArrayCall, OverrideBothEqualsAndHashcode, PackageCase, PreserveStackTrace, ProperCloneImplementation, ProperLogger, ReturnEmptyArrayRatherThanNull, ReturnFromFinallyBlock, SimplifiedTernary, SimplifyBooleanReturns, SimplifyConditional, SingleMethodSingleton, SingletonClassReturningNewInstance, SingularField, SuspiciousEqualsMethodName, SuspiciousHashcodeMethodName, SuspiciousOctalEscape, SwitchStmtsShouldHaveDefault, UncommentedEmptyConstructor, UncommentedEmptyMethodBody, UnconditionalIfStatement, UnnecessaryAnnotationValueElement, UnnecessaryConstructor, UnnecessaryConversionTemporary, UnnecessaryFullyQualifiedName, UnnecessaryLocalBeforeReturn, UnnecessaryModifier, UnnecessaryReturn, UnsynchronizedStaticFormatter, UnusedFormalParameter, UnusedImports, UnusedLocalVariable, UnusedNullCheckInEquals, UnusedPrivateField, UnusedPrivateMethod, UseAssertEqualsInsteadOfAssertTrue, UseAssertNullInsteadOfAssertTrue, UseAssertSameInsteadOfAssertTrue, UseAssertTrueInsteadOfAssertEquals, UseCollectionIsEmpty, UseEqualsToCompareStrings, UselessOperationOnImmutable, UselessOverridingMethod, UselessParentheses, UselessQualifiedThis, UseLocaleWithCaseConversions, UseNotifyAllInsteadOfNotify, UseUtilityClass
Security Code Guidelines (rulesets/java/sunsecure.xml
):
@@ -2067,7 +2068,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_java_bestpractices.html b/pmd_rules_java_bestpractices.html
index 269014f756..97e2db9911 100644
--- a/pmd_rules_java_bestpractices.html
+++ b/pmd_rules_java_bestpractices.html
@@ -5,7 +5,7 @@
-
+
Best Practices | PMD Source Code Analyzer
@@ -2451,6 +2451,43 @@ with messages provide the developer a clearer idea of what the test does.
<rule ref="category/java/bestpractices.xml/JUnitUseExpected" />
+LiteralsFirstInComparisons
+
+Since: PMD 6.24.0
+
+Priority: Medium (3)
+
+Position literals first in all String comparisons, if the second argument is null then NullPointerExceptions
+can be avoided, they will just return false. Note that switching literal positions for compareTo and
+compareToIgnoreCase may change the result, see examples.
+
+This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.bestpractices.LiteralsFirstInComparisonsRule
+
+Example(s):
+
+class Foo {
+ boolean bar(String x) {
+ return x.equals("2"); // should be "2".equals(x)
+ }
+ boolean bar(String x) {
+ return x.equalsIgnoreCase("2"); // should be "2".equalsIgnoreCase(x)
+ }
+ boolean bar(String x) {
+ return (x.compareTo("bar") > 0); // should be: "bar".compareTo(x) < 0
+ }
+ boolean bar(String x) {
+ return (x.compareToIgnoreCase("bar") > 0); // should be: "bar".compareToIgnoreCase(x) < 0
+ }
+ boolean bar(String x) {
+ return x.contentEquals("bar"); // should be "bar".contentEquals(x)
+ }
+}
+
+
+Use this rule by referencing it:
+<rule ref="category/java/bestpractices.xml/LiteralsFirstInComparisons" />
+
+
LooseCoupling
Since: PMD 0.7
@@ -3438,7 +3475,7 @@ a block {}
is sufficient.
diff --git a/pmd_rules_java_codestyle.html b/pmd_rules_java_codestyle.html
index d10497c0df..88bfa1c8eb 100644
--- a/pmd_rules_java_codestyle.html
+++ b/pmd_rules_java_codestyle.html
@@ -4556,7 +4556,7 @@ by the rule
diff --git a/pmd_rules_java_documentation.html b/pmd_rules_java_documentation.html
index d572c39935..eca44adf6e 100644
--- a/pmd_rules_java_documentation.html
+++ b/pmd_rules_java_documentation.html
@@ -1745,7 +1745,7 @@ empty methods.
diff --git a/pmd_rules_java_errorprone.html b/pmd_rules_java_errorprone.html
index 342dce5f54..e68dac0b72 100644
--- a/pmd_rules_java_errorprone.html
+++ b/pmd_rules_java_errorprone.html
@@ -3795,7 +3795,9 @@ other classes may invoke it at inappropriate times.
Priority: Medium (3)
-Some JUnit framework methods are easy to misspell.
+In JUnit 3, the setUp method is used to set up all data entities required in running tests.
+The tearDown method is used to clean up all data entities required in running tests.
+You should not misspell method name if you want your test to set up and clean up everything correctly.
This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.errorprone.JUnitSpellingRule
@@ -5168,7 +5170,7 @@ Thread.currentThread().getContextClassLoader() instead.
diff --git a/pmd_rules_java_multithreading.html b/pmd_rules_java_multithreading.html
index 0bfbd2c010..69ab07c07e 100644
--- a/pmd_rules_java_multithreading.html
+++ b/pmd_rules_java_multithreading.html
@@ -1911,7 +1911,7 @@ one is chosen. The thread chosen is arbitrary; thus its usually safer to call n
diff --git a/pmd_rules_java_performance.html b/pmd_rules_java_performance.html
index 1bc802de20..fc754be522 100644
--- a/pmd_rules_java_performance.html
+++ b/pmd_rules_java_performance.html
@@ -2437,7 +2437,7 @@ or StringBuffer.toString().length() == …
diff --git a/pmd_rules_java_security.html b/pmd_rules_java_security.html
index 16f0e4038d..a1b74b0b31 100644
--- a/pmd_rules_java_security.html
+++ b/pmd_rules_java_security.html
@@ -1482,7 +1482,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_jsp.html b/pmd_rules_jsp.html
index 00a67a1b3d..7cc6713b4b 100644
--- a/pmd_rules_jsp.html
+++ b/pmd_rules_jsp.html
@@ -1493,7 +1493,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_jsp_bestpractices.html b/pmd_rules_jsp_bestpractices.html
index b45eb19dae..c212ac79d0 100644
--- a/pmd_rules_jsp_bestpractices.html
+++ b/pmd_rules_jsp_bestpractices.html
@@ -1524,7 +1524,7 @@ little other purpose. Consider switching to JSP comments.
diff --git a/pmd_rules_jsp_codestyle.html b/pmd_rules_jsp_codestyle.html
index 1964d6cab3..b59989148a 100644
--- a/pmd_rules_jsp_codestyle.html
+++ b/pmd_rules_jsp_codestyle.html
@@ -1441,7 +1441,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_jsp_design.html b/pmd_rules_jsp_design.html
index eb18a2a62d..41aeb37991 100644
--- a/pmd_rules_jsp_design.html
+++ b/pmd_rules_jsp_design.html
@@ -1532,7 +1532,7 @@ onload=calcDays;
diff --git a/pmd_rules_jsp_errorprone.html b/pmd_rules_jsp_errorprone.html
index 08d76ba12d..0c94ed04be 100644
--- a/pmd_rules_jsp_errorprone.html
+++ b/pmd_rules_jsp_errorprone.html
@@ -1453,7 +1453,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_jsp_security.html b/pmd_rules_jsp_security.html
index 1ee708c0f7..08343707ee 100644
--- a/pmd_rules_jsp_security.html
+++ b/pmd_rules_jsp_security.html
@@ -1474,7 +1474,7 @@ ${fn:escapeXml(expression)}
<!-- instead, escape it --&g
diff --git a/pmd_rules_modelica.html b/pmd_rules_modelica.html
index 7e515dfe3c..6be78fcfa4 100644
--- a/pmd_rules_modelica.html
+++ b/pmd_rules_modelica.html
@@ -1442,7 +1442,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_modelica_bestpractices.html b/pmd_rules_modelica_bestpractices.html
index 6c0717afc1..493dd691d1 100644
--- a/pmd_rules_modelica_bestpractices.html
+++ b/pmd_rules_modelica_bestpractices.html
@@ -1516,7 +1516,7 @@ end Example;
diff --git a/pmd_rules_plsql.html b/pmd_rules_plsql.html
index 9cdbb88baa..8733ee31c0 100644
--- a/pmd_rules_plsql.html
+++ b/pmd_rules_plsql.html
@@ -1522,7 +1522,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_plsql_bestpractices.html b/pmd_rules_plsql_bestpractices.html
index f6c88e68a9..079f38742f 100644
--- a/pmd_rules_plsql_bestpractices.html
+++ b/pmd_rules_plsql_bestpractices.html
@@ -1482,7 +1482,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_plsql_codestyle.html b/pmd_rules_plsql_codestyle.html
index 96fdcffb72..05c1da32d2 100644
--- a/pmd_rules_plsql_codestyle.html
+++ b/pmd_rules_plsql_codestyle.html
@@ -1766,7 +1766,7 @@ https://docs.oracle.com/cd/B28359_01/appdev.111/b28370/static.htm#BABIIHBJ
diff --git a/pmd_rules_plsql_design.html b/pmd_rules_plsql_design.html
index eb2e267b2c..98ccf36be5 100644
--- a/pmd_rules_plsql_design.html
+++ b/pmd_rules_plsql_design.html
@@ -2406,7 +2406,7 @@ have more fine grained objects.
diff --git a/pmd_rules_plsql_errorprone.html b/pmd_rules_plsql_errorprone.html
index bcce1a40d2..311bd2badc 100644
--- a/pmd_rules_plsql_errorprone.html
+++ b/pmd_rules_plsql_errorprone.html
@@ -1551,7 +1551,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_pom.html b/pmd_rules_pom.html
index 4ba04721b7..527a42abd4 100644
--- a/pmd_rules_pom.html
+++ b/pmd_rules_pom.html
@@ -1455,7 +1455,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_pom_errorprone.html b/pmd_rules_pom_errorprone.html
index 64929d86e0..5a0151a14f 100644
--- a/pmd_rules_pom_errorprone.html
+++ b/pmd_rules_pom_errorprone.html
@@ -1522,7 +1522,7 @@ By far the most common problem is the use of ${project.version} in a BOM or pare
diff --git a/pmd_rules_scala.html b/pmd_rules_scala.html
index 730b4125ee..eaf60c983d 100644
--- a/pmd_rules_scala.html
+++ b/pmd_rules_scala.html
@@ -1435,7 +1435,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_vf.html b/pmd_rules_vf.html
index 1f9534f6ae..ffe82f061f 100644
--- a/pmd_rules_vf.html
+++ b/pmd_rules_vf.html
@@ -1455,7 +1455,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_vf_security.html b/pmd_rules_vf_security.html
index 31f3fd958d..86368bb858 100644
--- a/pmd_rules_vf_security.html
+++ b/pmd_rules_vf_security.html
@@ -1460,7 +1460,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_vm.html b/pmd_rules_vm.html
index fed917dac2..db7da867e3 100644
--- a/pmd_rules_vm.html
+++ b/pmd_rules_vm.html
@@ -1476,7 +1476,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_vm_bestpractices.html b/pmd_rules_vm_bestpractices.html
index 3b55c368da..906d02b106 100644
--- a/pmd_rules_vm_bestpractices.html
+++ b/pmd_rules_vm_bestpractices.html
@@ -1450,7 +1450,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_vm_design.html b/pmd_rules_vm_design.html
index 6c53d5e267..6600671557 100644
--- a/pmd_rules_vm_design.html
+++ b/pmd_rules_vm_design.html
@@ -1564,7 +1564,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_vm_errorprone.html b/pmd_rules_vm_errorprone.html
index 4e65c15fdc..f82c56ad98 100644
--- a/pmd_rules_vm_errorprone.html
+++ b/pmd_rules_vm_errorprone.html
@@ -1450,7 +1450,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_xml.html b/pmd_rules_xml.html
index 14191d9f47..3699adb421 100644
--- a/pmd_rules_xml.html
+++ b/pmd_rules_xml.html
@@ -1454,7 +1454,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_xml_errorprone.html b/pmd_rules_xml_errorprone.html
index 9533e69b0a..712fbdf967 100644
--- a/pmd_rules_xml_errorprone.html
+++ b/pmd_rules_xml_errorprone.html
@@ -1454,7 +1454,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_xsl.html b/pmd_rules_xsl.html
index 7588e65637..1c6756e240 100644
--- a/pmd_rules_xsl.html
+++ b/pmd_rules_xsl.html
@@ -1462,7 +1462,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_xsl_codestyle.html b/pmd_rules_xsl_codestyle.html
index 5fc13b71f6..c500c57448 100644
--- a/pmd_rules_xsl_codestyle.html
+++ b/pmd_rules_xsl_codestyle.html
@@ -1445,7 +1445,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_rules_xsl_performance.html b/pmd_rules_xsl_performance.html
index 4c4ce996ee..5671b8fc7c 100644
--- a/pmd_rules_xsl_performance.html
+++ b/pmd_rules_xsl_performance.html
@@ -1488,7 +1488,7 @@ cutting through 100% of the document.
diff --git a/pmd_userdocs_best_practices.html b/pmd_userdocs_best_practices.html
index 23cf095336..b8f71575dc 100644
--- a/pmd_userdocs_best_practices.html
+++ b/pmd_userdocs_best_practices.html
@@ -1457,7 +1457,7 @@ and soon you’ll be fixing problems much faster.
diff --git a/pmd_userdocs_cli_reference.html b/pmd_userdocs_cli_reference.html
index 190b30b006..e66f6f3303 100644
--- a/pmd_userdocs_cli_reference.html
+++ b/pmd_userdocs_cli_reference.html
@@ -2074,7 +2074,7 @@ All formats are described at
PMD Repo
diff --git a/pmd_userdocs_configuring_rules.html b/pmd_userdocs_configuring_rules.html
index 19d0c44800..420e7642b9 100644
--- a/pmd_userdocs_configuring_rules.html
+++ b/pmd_userdocs_configuring_rules.html
@@ -1483,7 +1483,7 @@ will cause the rule to be ignored.
diff --git a/pmd_userdocs_cpd.html b/pmd_userdocs_cpd.html
index 552db9843a..017e5f382e 100644
--- a/pmd_userdocs_cpd.html
+++ b/pmd_userdocs_cpd.html
@@ -2440,7 +2440,7 @@ the comment based approach will be extended to those of them that can support it
diff --git a/pmd_userdocs_cpd_report_formats.html b/pmd_userdocs_cpd_report_formats.html
index 9bf765cc98..aac56900ef 100644
--- a/pmd_userdocs_cpd_report_formats.html
+++ b/pmd_userdocs_cpd_report_formats.html
@@ -1634,7 +1634,7 @@ is shown in the console. You can then click on the filenames to jump to the sour
diff --git a/pmd_userdocs_extending_defining_properties.html b/pmd_userdocs_extending_defining_properties.html
index 4b63af4de4..063ec3c702 100644
--- a/pmd_userdocs_extending_defining_properties.html
+++ b/pmd_userdocs_extending_defining_properties.html
@@ -1633,7 +1633,7 @@ are supported.
diff --git a/pmd_userdocs_extending_designer_reference.html b/pmd_userdocs_extending_designer_reference.html
index 4d67f35396..796be7c832 100644
--- a/pmd_userdocs_extending_designer_reference.html
+++ b/pmd_userdocs_extending_designer_reference.html
@@ -1672,7 +1672,7 @@ The available language modules are those on the classpath of the app’s JVM. Th
diff --git a/pmd_userdocs_extending_metrics_howto.html b/pmd_userdocs_extending_metrics_howto.html
index 848a0b28f5..086df88237 100644
--- a/pmd_userdocs_extending_metrics_howto.html
+++ b/pmd_userdocs_extending_metrics_howto.html
@@ -1758,7 +1758,7 @@ classes. Here’s the default behaviour by language and type of metric:
diff --git a/pmd_userdocs_extending_rule_guidelines.html b/pmd_userdocs_extending_rule_guidelines.html
index bd66545fff..aff71db8d4 100644
--- a/pmd_userdocs_extending_rule_guidelines.html
+++ b/pmd_userdocs_extending_rule_guidelines.html
@@ -1462,7 +1462,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_userdocs_extending_testing.html b/pmd_userdocs_extending_testing.html
index ee3b9daa2e..dd91ad8bd8 100644
--- a/pmd_userdocs_extending_testing.html
+++ b/pmd_userdocs_extending_testing.html
@@ -1729,7 +1729,7 @@ will be executed twice.
diff --git a/pmd_userdocs_extending_writing_java_rules.html b/pmd_userdocs_extending_writing_java_rules.html
index 6577a2543e..128881642e 100644
--- a/pmd_userdocs_extending_writing_java_rules.html
+++ b/pmd_userdocs_extending_writing_java_rules.html
@@ -1590,7 +1590,7 @@ the file
diff --git a/pmd_rules_java_design.html b/pmd_rules_java_design.html
index f7b37cedd9..a8b2d980b1 100644
--- a/pmd_rules_java_design.html
+++ b/pmd_rules_java_design.html
@@ -3965,7 +3965,7 @@ remember to add a private constructor to prevent instantiation.
diff --git a/pmd_userdocs_extending_writing_pmd_rules.html b/pmd_userdocs_extending_writing_pmd_rules.html
index 174c81a2fc..107959aed9 100644
--- a/pmd_userdocs_extending_writing_pmd_rules.html
+++ b/pmd_userdocs_extending_writing_pmd_rules.html
@@ -1454,7 +1454,7 @@ your rule
diff --git a/pmd_userdocs_extending_writing_rules_intro.html b/pmd_userdocs_extending_writing_rules_intro.html
index ca1a3ded7f..42d9307b47 100644
--- a/pmd_userdocs_extending_writing_rules_intro.html
+++ b/pmd_userdocs_extending_writing_rules_intro.html
@@ -1566,7 +1566,7 @@ your rule
diff --git a/pmd_userdocs_extending_writing_xpath_rules.html b/pmd_userdocs_extending_writing_xpath_rules.html
index 1936af0b4b..478815f73b 100644
--- a/pmd_userdocs_extending_writing_xpath_rules.html
+++ b/pmd_userdocs_extending_writing_xpath_rules.html
@@ -1834,7 +1834,7 @@ deprecated and whose usages should be replaced with uses of
diff --git a/pmd_userdocs_incremental_analysis.html b/pmd_userdocs_incremental_analysis.html
index 8329f01190..0a686ba5af 100644
--- a/pmd_userdocs_incremental_analysis.html
+++ b/pmd_userdocs_incremental_analysis.html
@@ -1537,7 +1537,7 @@ same execution classpath).
diff --git a/pmd_userdocs_installation.html b/pmd_userdocs_installation.html
index f05c2a1687..bd2423be43 100644
--- a/pmd_userdocs_installation.html
+++ b/pmd_userdocs_installation.html
@@ -1590,7 +1590,7 @@ directory or a jar or zip file containing the sources.
diff --git a/pmd_userdocs_making_rulesets.html b/pmd_userdocs_making_rulesets.html
index 793e2a6bfd..69f15bf83a 100644
--- a/pmd_userdocs_making_rulesets.html
+++ b/pmd_userdocs_making_rulesets.html
@@ -1540,7 +1540,7 @@ a single rule reference.
diff --git a/pmd_userdocs_report_formats.html b/pmd_userdocs_report_formats.html
index b284907743..5a92120988 100644
--- a/pmd_userdocs_report_formats.html
+++ b/pmd_userdocs_report_formats.html
@@ -1791,7 +1791,7 @@ The output directory must exist. If not specified, the html files are created in
diff --git a/pmd_userdocs_suppressing_warnings.html b/pmd_userdocs_suppressing_warnings.html
index ac4d889efc..c6cfe39799 100644
--- a/pmd_userdocs_suppressing_warnings.html
+++ b/pmd_userdocs_suppressing_warnings.html
@@ -1641,7 +1641,7 @@ violations you wish to suppress. XPath queries are explained in
diff --git a/pmd_userdocs_tools.html b/pmd_userdocs_tools.html
index 55078ba225..8ab43c192c 100644
--- a/pmd_userdocs_tools.html
+++ b/pmd_userdocs_tools.html
@@ -1881,7 +1881,7 @@ the (blank Command Results) document, and then confirming that, “yes, I do rea
diff --git a/pmd_userdocs_tools_ant.html b/pmd_userdocs_tools_ant.html
index ef123339e8..49f33ee2e9 100644
--- a/pmd_userdocs_tools_ant.html
+++ b/pmd_userdocs_tools_ant.html
@@ -1860,7 +1860,7 @@ To prevent this from happening, increase the maximum memory usable by ant using
diff --git a/pmd_userdocs_tools_ci.html b/pmd_userdocs_tools_ci.html
index caa6272839..759e1d9090 100644
--- a/pmd_userdocs_tools_ci.html
+++ b/pmd_userdocs_tools_ci.html
@@ -1447,7 +1447,7 @@ result of the PMD maven plugin.
diff --git a/pmd_userdocs_tools_gradle.html b/pmd_userdocs_tools_gradle.html
index 660b8fcec0..5e8111eb07 100644
--- a/pmd_userdocs_tools_gradle.html
+++ b/pmd_userdocs_tools_gradle.html
@@ -1490,7 +1490,7 @@ with the property
toolVersion
:
diff --git a/pmd_userdocs_tools_java_api.html b/pmd_userdocs_tools_java_api.html
index 2ce01d4b7e..e95587b5c1 100644
--- a/pmd_userdocs_tools_java_api.html
+++ b/pmd_userdocs_tools_java_api.html
@@ -1706,7 +1706,7 @@ Then you can check the rendered output.
diff --git a/pmd_userdocs_tools_maven.html b/pmd_userdocs_tools_maven.html
index 9a1b3470fc..a5b45840b6 100644
--- a/pmd_userdocs_tools_maven.html
+++ b/pmd_userdocs_tools_maven.html
@@ -1705,7 +1705,7 @@ the previous paragraph. Add the following property to your project now:
diff --git a/search.json b/search.json
index 26016d12bb..e2b0091afe 100644
--- a/search.json
+++ b/search.json
@@ -528,6 +528,15 @@
}
,
+{
+"title": "LiteralsFirstInComparisons (Java, Best Practices)",
+"tags": "",
+"keywords": "LiteralsFirstInComparisons",
+"url": "pmd_rules_java_bestpractices.html#literalsfirstincomparisons",
+"summary": "Rules which enforce generally accepted best practices."
+}
+,
+
{
"title": "LooseCoupling (Java, Best Practices)",
"tags": "",
diff --git a/tag_devdocs.html b/tag_devdocs.html
index 7a7a2ad1c3..424017e86f 100644
--- a/tag_devdocs.html
+++ b/tag_devdocs.html
@@ -1931,7 +1931,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/tag_extending.html b/tag_extending.html
index dc0e459f1c..9193838a09 100644
--- a/tag_extending.html
+++ b/tag_extending.html
@@ -1955,7 +1955,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/tag_getting_started.html b/tag_getting_started.html
index a265383335..b7de61ece7 100644
--- a/tag_getting_started.html
+++ b/tag_getting_started.html
@@ -1889,7 +1889,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/tag_languages.html b/tag_languages.html
index ec120d3f14..b30c8078a6 100644
--- a/tag_languages.html
+++ b/tag_languages.html
@@ -1865,7 +1865,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/tag_metrics.html b/tag_metrics.html
index 5566a26956..3aae445bfc 100644
--- a/tag_metrics.html
+++ b/tag_metrics.html
@@ -1889,7 +1889,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/tag_release_notes.html b/tag_release_notes.html
index c8826b98ee..a2fdab9e85 100644
--- a/tag_release_notes.html
+++ b/tag_release_notes.html
@@ -1865,7 +1865,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/tag_rule_references.html b/tag_rule_references.html
index 9ef20ab435..c538b5bf48 100644
--- a/tag_rule_references.html
+++ b/tag_rule_references.html
@@ -1937,7 +1937,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/tag_tools.html b/tag_tools.html
index 10fec39334..c27a65db1d 100644
--- a/tag_tools.html
+++ b/tag_tools.html
@@ -1901,7 +1901,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/tag_troubleshooting.html b/tag_troubleshooting.html
index 5ebbe18fea..399853afd7 100644
--- a/tag_troubleshooting.html
+++ b/tag_troubleshooting.html
@@ -1865,7 +1865,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/tag_userdocs.html b/tag_userdocs.html
index 156d69baae..6c8907e882 100644
--- a/tag_userdocs.html
+++ b/tag_userdocs.html
@@ -2021,7 +2021,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
diff --git a/pmd_userdocs_extending_your_first_rule.html b/pmd_userdocs_extending_your_first_rule.html
index 8adccc6ace..d4d149ac7f 100644
--- a/pmd_userdocs_extending_your_first_rule.html
+++ b/pmd_userdocs_extending_your_first_rule.html
@@ -1561,7 +1561,7 @@ of a rule of type XPathRule, which is how XPath rules are implemented.
diff --git a/pmd_devdocs_pmdtester.html b/pmd_devdocs_pmdtester.html
index d09a15186c..a88acca6c8 100644
--- a/pmd_devdocs_pmdtester.html
+++ b/pmd_devdocs_pmdtester.html
@@ -1444,7 +1444,7 @@ Regression difference reports are commented back to the PR for the reviewer’s