Domanda

we are using sonar 3.6.1 and we are trying to use the rule "UndocumentedAPI". Normally, this rule excludes all the getter. But, it seems that classes whose getter use the prefix 'this' are always included in the analysis.

I made a testcase :

public class TestDocumentedAPIDTO {

    private Long id;
    private String name;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }


}

After analysing this class, I can see that the method getName() throws the UndocumentedAPI violation.

enter image description here

How can I fix that ? is it a bug ?

Thanks for your help

Regards

È stato utile?
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top