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:57:00 UTC

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

Pawan Verma created OFBIZ-11835:
-----------------------------------

             Summary: 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


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)