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

Unsafe typecast in java.util.stream.Node.OfPrimitive.asArray()

XMLWordPrintable

    • b112
    • Not verified

      Unsafe typecast long to int:
      @Override
      default T[] asArray(IntFunction<T[]> generator) {
          T[] boxed = generator.apply((int) count());
          copyInto(boxed, 0);
          return boxed;
      }

      long count();

      It looks like default implementation is not used (class Node is package private).

            psandoz Paul Sandoz
            ogb Oleg Barbashov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: