Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-11835

Replace single method call lambda with method reference

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Implemented
    • Affects Version/s: Trunk
    • Fix Version/s: Upcoming Branch
    • Component/s: ALL COMPONENTS
    • Labels:
      None

      Description

      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:

      .forEach(componentDir -> retrieveComponentConfig(componentDir));

      To make the code clearer, you can turn that lambda expression into a method reference:

      .forEach(ComponentContainer::retrieveComponentConfig);

        Attachments

        1. OFBIZ-11835.patch
          6 kB
          Pawan Verma

          Activity

            People

            • Assignee:
              pawan Pawan Verma
              Reporter:
              pawan Pawan Verma
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: