Skip to content

[java] ImmutableField - deprecate property ignoredAnnotations #4175

@adangel

Description

@adangel

The rule ImmutableField had a similar challenge like UnusedPrivateField had before #4100: It has a property ignoredAnnotations that we needed to update to consider all possible Java frameworks.

However with #4018 ImmutableField now

only considers fields, that are initialized once and never changed - either in the constructor or in the declaration.
If the field is not initialized at all (which is the typical case when a framework will set the value by reflection), the rule won't trigger now for such fields.

The property ignoredAnnotations is still there, but maybe it can be deprecated and eventually removed?

We can think for the next version about removing/deprecating the property ignoredAnnotations for this rule entirely. Not sure about the class-level lombok annotations though...

(#4018 (review))

Having less properties makes the rule easier to use and avoids confusion when this property is needed.

Metadata

Metadata

Assignees

Labels

an:enhancementAn improvement on existing features / rulesis:deprecationThe main focus is deprecating public APIs or rules, eg to make them internal, or removing them

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions