Affects PMD Version:
All.
Rule:
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."
Immutability, by definition, implies that the state of the object never changes. The above rule only enforces a constant reference. The referred object is never truly immutable.
What to do?
The description of the rule should be updated, clarify, that we only talks about shallow immutability and not deep immutability.
The description can be found in the code here:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4