代码规范
(1) 如果提交的话,加上commons 别不加
(1)如果有try catch finally;
如果有返回值的话,不要放在finally中;
private boolean checkDriverCanDel(Long driverId) { boolean canDel = true; try { List<TransportPowerDTO> transportPowerDTOS = transportPowerClient.getAvailableTransportPowerByDriverId(driverId); if (!CollectionUtils.isEmpty(transportPowerDTOS)) { for (TransportPowerDTO e : transportPowerDTOS) { if (TransportPowerStatusEnum.ENABLE.equals(e.getStatus())) { log.info("checkDriverCanDel driverId={} 找到有效运力 ", driverId); canDel = false; break; } } } } catch (BusinessException e) { log.error("checkDriverCanDel={} ", e.getShowMessage(), e); } catch (TException e) { log.error("checkDriverCanDel error ", e); } log.info("checkDriverCanDel={}", canDel); return canDel; }
本文来自博客园,作者:aspirant,转载请注明原文链接:https://www.cnblogs.com/aspirant/p/11812396.html