[jira] [Commented] (OFBIZ-11835) Replace single method call lambda with method reference

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-11835) Replace single method call lambda with method reference

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-11835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17142185#comment-17142185 ]

ASF subversion and git services commented on OFBIZ-11835:
---------------------------------------------------------

Commit 18f5dadd930f3198d9519180b37466101c221178 in ofbiz-framework's branch refs/heads/trunk from Pawan Verma
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=18f5dad ]

Improved: Replace single method call lambda with method reference(OFBIZ-11835)

Thanks: Jacques for the review.


> Replace single method call lambda with method reference
> -------------------------------------------------------
>
>                 Key: OFBIZ-11835
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11835
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL COMPONENTS
>    Affects Versions: Trunk
>            Reporter: Pawan Verma
>            Assignee: Pawan Verma
>            Priority: Minor
>         Attachments: OFBIZ-11835.patch
>
>
> We know that we can use lambda expressions instead of using an anonymous class. But sometimes, the lambda expression is really just a call to some method, for example:
> {code:java}
> .forEach(componentDir -> retrieveComponentConfig(componentDir));{code}
> To make the code clearer, you can turn that lambda expression into a method reference:
> {code:java}
> .forEach(ComponentContainer::retrieveComponentConfig);{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)