这是我的代码
@Override
protected void setValue(Object value) {
if (Boolean.TRUE.equals(value)) {
// do something for true
} else if (Boolean.FALSE.equals(value)) {
// do something for false
} else if (null == value) { // got SonarLint warning here
// do something for null
} else {
// for any other non-null and not Boolean object call the super method
super.setValue(value);
}
}
在标有“//此处有 SonarLint 警告”的行处,我收到警告:Change this condition so that it does not always evaluate to "true。我应该如何改变我的方法来避免这个警告?
猛跑小猪
相关分类