Domanda

I have the following code :

private Integer idadr;

@Id()
@SequenceGenerator(name = "idadrGenerator", sequenceName = "SEQ_ADR", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idadrGenerator")
@Column(name = "IDADR", unique = true, nullable = false, precision = 8)
public Integer getIdadr() {
  return this.idadr;
}

public void setIdadr(Integer idadr) {
  this.idadr = idadr;
}

When I run an analyse : a new violation with the UndocumentApi rule is raised. I think this violation must not appear because it is a basic getter on a field.

Is it a bug ?

Regards,

Stef

È stato utile?

Soluzione

As your comment says, this is a bug/deficiency in how SonarQube decides if a method is a getter.

http://jira.codehaus.org/browse/SONARJAVA-7

Unfortunately it's not currently going to be fixed because of a related ticket (http://jira.codehaus.org/browse/SONARJAVA-398)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top