Pit father Codes | How long have you written the longest line of code? ? ?

You wrote the longest single line of code how long it? Why do you write so long? Shuai watching it, or want to reduce the number of lines of code?

List<OperationPurchaseInfo> purchaseInfoList = sheet.getPurchaseInfoList().stream().filter(purchaseInfo ->
	purchaseInfo.getExteriorOperation().getExteriorPart().getExteriorOperationList().stream()
	.filter(exteriorOperation -> exteriorOperation.getProcessState().equals(ExteriorOperation.ProcessState.PROCESSING)).count() != 0
	//订单明细中工序对应的工件下的其他工序存在加工中,且已发给供应商且供应商不是当前订单供应商时,需要判断
	&& (purchaseInfo.getExteriorOperation().getExteriorPart().getTeamwork() == null ||	!purchaseInfo.getExteriorOperation().getExteriorPart().getTeamwork().equals(sheet.getTeamwork()))
).collect(Collectors.toList());

Although the above code is open on multiple lines, but in essence is a line, a very complex assignment!

This code is not to let other people do not understand to demonstrate their coding level?

Xiao Bian think Java Stream API and a variety of functional programming methods, as well as various syntactic sugar to some extent to make the code more and more of this bad!

Then take a look at this criticism of the code, or if you have any good solution?

The following link to the comment, to collect their prizes:

https://gitee.com/oschina/bullshit-codes/blob/master/java/ShortIsRight.java

6 anniversary of the code cloud, We are seeking a variety of pit father of code, a lot of prizes waiting for you to come and collect

See detailed participatory approach   https://gitee.com/oschina/bullshit-codes

Guess you like

Origin www.oschina.net/news/107081/gitee-bad-code-one-line-code