While solving sonarQube issue i face the below warning,does any one tell me how to overcome this warning
Method:-
@Override
public boolean equals
Not completely sure of your intent for the if-statements that return false but it seems as if you could simply always return false unless "this == obj".
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
else
return false;
}
This same thing could be accomplished with one line
@Override
public boolean equals(Object obj) {
return this == obj;
}