Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8132097

Stream.generate should use a covariant Supplier as parameter

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:

      Description

      The signature of Stream.generate doesn't to use a wildcard (? extends) hence some programs are rejected even if they are valid.
      The signature should be public static<T> Stream<T> generate(Supplier<? extends T> s).

      see http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-July/034601.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                psandoz Paul Sandoz
                Reporter:
                forax RĂ©mi Forax
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: