【发布时间】:2017-05-04 20:53:47
【问题描述】:
我收到声纳违规:
“条件不应无条件地评估为“TRUE”或“FALSE””
下面的代码。
List<MediaContent> savedList = source.getChildMediaContents();
List<MediaContent> supplierList = target.getChildMediaContents();
// if existing and incoming both empty
if(savedList == null && supplierList == null){
return false;
}
// if one is null and other is not then update is required
if(savedList == null && supplierList != null){
return true;
}
if(savedList != null && supplierList == null){
return true;
}
在两个 if 块下面会报错
// if one is null and other is not then update is required
if(savedList == null && supplierList != null){
return true;
}
if(savedList != null && supplierList == null){
return true;
}
【问题讨论】:
标签: java collections sonarqube sonar-runner