You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Pawan Verma (Jira)" <ji...@apache.org> on 2020/06/18 11:58:00 UTC
[jira] [Updated] (OFBIZ-11835) Replace single method call lambda
with method reference
[ https://issues.apache.org/jira/browse/OFBIZ-11835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pawan Verma updated OFBIZ-11835:
--------------------------------
Attachment: OFBIZ-11835.patch
> 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)