Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-128098

Add support for generic methods in Service Builder

    Details

      Description

      Generic methods have a type parameter (the diamond operator enclosing the type) before the return type of the method declaration.

      If we define a generic method in the implementation like this one in com.liferay.portal.service.impl.CompanyLocalServiceImpl:

      @Override
      public <T, E extends Exception> Stream<T> applyForEachCompanyId(
         UnsafeFunction<Long, T, E> unsafeFunction,
         BiConsumer<Long, E> biConsumer, Stream<Long> companyIdsStream) {
      ...
      } 

      And we execute the service builder, the type parameters before the return are lost in the interface:

      public Stream<T> applyForEachCompanyId(
         UnsafeFunction<Long, T, E> unsafeFunction,
         BiConsumer<Long, E> biConsumer, Stream<Long> companyIdsStream);

        Attachments

          Activity

            People

            Assignee:
            brian.chan Brian Chan
            Reporter:
            alberto.chaparro Alberto Chaparro
            Engineering Assignee:
            SE Support
            Recent user:
            Enterprise Release HU
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                7.0.X
                7.1.X
                7.2.X
                7.3.6 CE GA7
                7.3.X
                Master