[
https://issues.apache.org/jira/browse/OFBIZ-10537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16592926#comment-16592926 ]
Jacques Le Roux commented on OFBIZ-10537:
-----------------------------------------
Hi Gil,
I very like it for filterByAnd, clearly easier to read once you get used to stream syntax. The harder is to learn and remember all the stream methods variations (aka aggregate operations). Same for filterByOr. Also consistent for the first variants of filterByAnd when fields is empty and better for filterByCondition/filterOutByCondition when condition is empty. And findDatedInclusionEntity is so much easier to read, once again when you get used to stream syntax and know methods variations.
It's maybe not the case here, lines are short, but in general I think we should advice to split the stream call at dots. The same we do to format EntityQuery calls, much easier to read a 1st glance.
+1 (Also a big +1 for the tests!)
> Refactor EntityUtil findBy methods using Stream API
> ---------------------------------------------------
>
> Key: OFBIZ-10537
> URL:
https://issues.apache.org/jira/browse/OFBIZ-10537> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: Trunk
> Reporter: Gil Portenseigne
> Assignee: Gil Portenseigne
> Priority: Major
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10537-1_integration_tests.patch, OFBIZ-10537-2_refactor_streams.patch
>
>
> Refactoring EntityUtil methods that were using lots of for loops using Stream API. Increasing readability and simplicity.
> Adding integration test around this improvement.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)