2020
12-04
12-04
Java陷阱之慎用入参做返回值详解
正常情况下,在Java中入参是不建议用做返回值的。除了造成代码不易理解、语义不清等问题外,可能还埋下了陷阱等你入坑。问题背景比如有这么一段代码:@NamedpublicclassAService{privateSupplyAssignmentlocalSupply=newSupplyAssignment();@InjectprivateBServicebervice;publicList<Supply>calcSupplyAssignment()List<Supply>supplyList=bService.getLocalSupplyList(this.localSupply);…returnsupp...
继续阅读 >