A RetroSearch Logo

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

Search Query:

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

[java] Private field is detected as public inside nested classes in interfaces · Issue #1578 · pmd/pmd · GitHub

Affects PMD Version: 6.10.0

Rule: No rule explicitly, but rules that evaluate the Private attribute of FieldDeclarations

Description:
The XPath 2.0 Expression //FieldDeclaration[@Private=true()] should find the second field named serialVersionUID, but it doesn't.

Code Sample demonstrating the issue:

public interface MyInterface {
    public static final Map<String, String> MAPPING = Collections.unmodifiableMap(new HashMap<String, String>() {
        private static final long serialVersionUID = 3855526803226948630L;
        {
            put("X", "10");
            put("L", "50");
            put("C", "100");
            put("M", "1000");
        }
    });
}

Running PMD through: Designer


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