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

            brian.chan Brian Chan
            alberto.chaparro Alberto Chaparro
            SE Support SE Support
            Kiyoshi Lee Kiyoshi Lee
            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.10 DXP FP17
                7.2.10.6 DXP SP6
                7.2.X
                7.3.6 CE GA7
                7.3.X
                7.4.13 DXP GA1
                Master