I have the following class Properties:
class Properties {
private Boolean enabled;
public Boolean getEnabled() {
return enabled;
}
}
If I write the following code, SonarLint gives me a warning on the if condition saying "Use the primitive boolean expression here.".
if (!properties.getEnabled()) {
return true;
}
// more code
Changing the if condition to the following shuts up the warning. But that less readable, that can't be what SonarLint wants or?
if (properties.getEnabled().equals(Boolean.FALSE)) {
return true;
}
// more code
What exactly does SonarLint want me to do here? What is the problem?