A RetroSearch Logo

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

Search Query:

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

[java] ImmutableField - false positive with Lombok @Setter · Issue #4254 · pmd/pmd · GitHub

Rule: ImmutableField

Given a simple class like:

import lombok.Setter;

public class Junk {
    @Setter
    private String value = "abc";

    public String something() {
        return "blah" + value;
    }
}

PMD 6.52.0 will report "Private field 'value' could be made final; it is only initialized in the declaration or constructor." This is a false positive because there is a generated setValue(String) method that can modify value.


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