SonarQube reports as "block of duplicated code" to different simple POJO class like below. In this case, A and B are different role. So, I think that I should not create abstract class.
public class A{
private String xxx;
// omitted other fields.
public A() {}
public String getXxx() {
return xxx;
}
public void setXxx(String xxx) {
this.xxx= xxx;
}
// omitted other fields' setter and getter
}
public class B{
private String xxx;
// omitted other fields.
public B() {}
public String getXxx() {
return xxx;
}
public void setXxx(String xxx) {
this.xxx= xxx;
}
// omitted other fields' setter and getter
}
The severity is major. So, I would like to ignore it. Then, I added @SuppressWarning("common-java:DuplicatedBlocks")
and @SuppressWarning("all")
to both classes. But it could not be ignored.
Though similar question was raised in JIRA, but it have been not solved. My SonarQube's version is 6.5.