A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/2108 below:

Description should clarify shallow immutability · Issue #2108 · pmd/pmd · GitHub

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:

<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. </description>

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