Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-1475

Javadoc of Slice.nextPageable() and ….previousPageable() incorrect about nullability

    XMLWordPrintable

    Details

      Description

      The return type description of method is null in case the current Slice is already the last one

      • org.springframework.data.domain.Slice#nextPageable()
      • org.springframework.data.domain.Slice#previousPageable()
      /**
      * Returns the {@link Pageable} to request the next {@link Slice}. Can be {@literal null} in case the current
      * {@link Slice} is already the last one. Clients should check {@link #hasNext()} before calling this method to make
      * sure they receive a non-{@literal null} value.
      *
      * @return
      */
      

      But the implementation code in org.springframework.data.domain.Chunk returns Unpaged.INSTANCE enum with Pageable.unpaged() method.

      /*
      * (non-Javadoc)
      * @see org.springframework.data.domain.Slice#nextPageable()
      */
      public Pageable nextPageable() {
          return hasNext() ? pageable.next() : Pageable.unpaged();
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              olivergierke Oliver Drotbohm
              Reporter:
              wddddw wddddw
              Last updater:
              Mark Paluch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: