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

Replace single method call lambda with method reference

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment