Java 代码优化:使用 ArrayList 和 BooleanUtils.isTrue() 方法
优化后的代码如下:
final List
final Boolean existExaminer = activityExaminerService.existByEmpCode(empCode); if (BooleanUtils.isTrue(existExaminer)) { roles.add(UserTypeEnum.EXAMINER.getValue()); }
return roles;
原文地址: https://www.cveoy.top/t/topic/o4hC 著作权归作者所有。请勿转载和采集!