[doc] [java] ImmutableField: extend description, fixes #2108

This commit is contained in:
Mateusz Stefanski
2020-08-22 23:28:34 +02:00
parent 400c02affa
commit 0889b94aa5

View File

@ -784,7 +784,10 @@ of Object-Oriented Systems. Springer, Berlin, 1 edition, October 2006. Page 80.
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_design.html#immutablefield">
<description>
Identifies private fields whose values never change once object initialization ends either in the declaration
of the field or by a constructor. This helps in converting existing classes to becoming immutable ones.
of the field or by a constructor. This helps in converting existing classes to becoming immutable ones.
Note that this rule does not enforce referenced object to be immutable itself. A class can still be mutable, even
if all its member fields are declared final. This is referred to as shallow immutability. For more information on
mutability, see Effective Java, 3rd Edition, Item 17: Minimize mutability.
</description>
<priority>3</priority>
<example>