diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml index 8aa8961a6f..2d7cacb281 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -3127,13 +3127,14 @@ public boolean test(String s) { -An operation on an Immutable object (`String`, `BigDecimal`, `BigInteger` or any type from `java.time.*`) -won't change the object itself since the result of the operation is a new object. -Therefore, ignoring the operation result is an error. +An operation on an immutable object will not change the object itself since the result of the operation is a new object. +Therefore, ignoring the result of such an operation is likely a mistake. The operation can probably be removed. + +This rule recognizes the types `String`, `BigDecimal`, `BigInteger` or any type from `java.time.*` as immutable. 3