While solving sonarQube issue i face the below warning,does any one tell me how to overcome this warning
Method:-
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Division other = (Division) obj;
if (divisionId != other.divisionId)
//getting warning for above if condition
return false;
return true;
}
Warning :
Replace this if-then-else statement by a single return statement.
Description:-
Return of boolean literal statements wrapped into if-then-else ones should be simplified.