I am trying to create a custom rule for sonarqube.
I want to search for times when a method is called for example:
ExClass classInstance = new ExClass();
classInstance.methodCall(a, b);
where methodCall is defined as:
public void methodCall(Object a, Object b){}
What I want is to verify that any class passed as an argument into methodCall() has overridden the methods equals() and hashCode().
I have already found the source code for the EqualsOverridenWithHashCodeCheck, so I can verify that classes have in fact overriden both equals and hashCode, however, I don’t know how to qualify that this should /only/ be done when the class if found as an argument to methodCall.