We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DepotHeadService中的方法
public DepotHead getDepotHead(String number)throws Exception { DepotHead depotHead = new DepotHead(); try{ DepotHeadExample example = new DepotHeadExample(); example.createCriteria().andNumberEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); List<DepotHead> list = depotHeadMapper.selectByExample(example); if(null!=list && list.size()>0) { depotHead = list.get(0); } }catch(Exception e){ JshException.readFail(logger, e); } return depotHead; }
DepotHead depotHead = new DepotHead();意味着这个方法永远不会返回空,我观察到有几处调用应该都产生了潜在的BUG:在没有查询到数据时,也走了正常的处理流程。
DepotHead depotHead = new DepotHead();
The text was updated successfully, but these errors were encountered:
我提交了一个PR,在没有查询到数据时返回null,如果这是一个确实存在的BUG,可以进行修复:通过NPE暴露异常,或调用方可以进行判空做逻辑处理。
null
如果这个逻辑是刻意为之则可以适当进行其它优化。
Sorry, something went wrong.
我提交了一个PR,在没有查询到数据时返回null,如果这是一个确实存在的BUG,可以进行修复:通过NPE暴露异常,或调用方可以进行判空做逻辑处理。 如果这个逻辑是刻意为之则可以适当进行其它优化。
#83
No branches or pull requests
DepotHeadService中的方法
DepotHead depotHead = new DepotHead();
意味着这个方法永远不会返回空,我观察到有几处调用应该都产生了潜在的BUG:在没有查询到数据时,也走了正常的处理流程。The text was updated successfully, but these errors were encountered: