...
Although final
can be used to specify immutable constants, there is a caveat when dealing with composite objects. See guideline "OBJ01-J. Do not assume that declaring a final reference to be final causes makes the referenced object immutable" for more details.
Noncompliant Code Example
...