Sonar常见问题及修改建议(201912):https://blog.csdn.net/libusi001/article/details/103717457
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
一、报错提示
'if' statement can be simplified
SonarLint: Replace this if-then-else statement by a single return statement
二、源代码
if (paperList != null && !paperList.isEmpty()) {
return true;
}
return false;
三、更改方式
return paperList != null && !paperList.isEmpty();
有用请点赞,养成良好习惯!
疑问、交流、鼓励请留言!