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

Replace single method call lambda with method reference

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • Trunk
    • None
    • ALL COMPONENTS
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: