2021-08-04 lambda踩的坑

reservationVoList.forEach(rsVo -> {
try {
reservationConfigCheck(rsVo, mainRsVo.getStartDate(), mainRsVo.getEndDate());
} catch (BaseException e) {
e.printStackTrace();
}
})
lambda 无法 throw 异常 只能 try/catch 异常
解决方案:将循环改为迭代器foreach循环
url:https://blog.csdn.net/weixin_45884459/article/details/114025406?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EsearchFromBaidu%7Edefault-1.pc_relevant_baidujshouduan&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EsearchFromBaidu%7Edefault-1.pc_relevant_baidujshouduan

你可能感兴趣的:(2021-08-04 lambda踩的坑)