Hi Margerita,
thanks for your detailed response. Well, actually I do disagree, well partly. 
I agree, that the rule should at least have a mode, where all potential contract breakers are reported and this mode should be default. But I have strong rejections against having no other option, but to either “fix” correct code by adding nonsense code or NOSONARs just to make the rule quiet or to disable the rule completely.
I would consider your example a bit artificial. Ok, it stands for other actual bugs, that could cause misbehavior like that. But a much more common example would be this:
class A {
private int id;
A(int id) {
this.id = id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof A)) return false;
A that = (A) o;
if (this.id != that.id) return false;
return true;
}
@Override
public int hashCode() {
return Integer.hashCode(id);
}
}
class B extends A {
private String label;
B(int a, String label) {
super(a);
this.label = label;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof B)) return false;
if (!super.equals(o)) return false;
B that = (B) o;
if (Objects.equals(this.label, that.label)) return false;
return true;
}
}
This code does in no way break the contract. B adds ‘label’ to the list of members. But ‘id’ is still sufficient to build a good hashcode. And this applies to many classes, where it is actually wrong to include more info in the hashcode. We had to realize this when implementing our object based locking.
So, to react on this rule we would have had to add this to all affected classes:
@Override
public int hashCode() {
return super.hashCode();
}
In the end I disabled the rule, which is a pity. I would love this rule do do it’s job and report actual bugs. But in our case we would need a mode to be configured, that classes don’t match, that have an ancestor class, that is not Object and that implements hashCode().
I think, this would be handy and imprtant to many code bases and the wording of the contract actually implies it.