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

Unsafe typecast in java.util.stream.Streams.RangeIntSpliterator.splitPoint()

XMLWordPrintable

    • b112
    • Not verified

      Unsafe typecast long to int:
      private int splitPoint(long size) {
              int d = (size < BALANCED_SPLIT_THRESHOLD) ? 2 : RIGHT_BALANCED_SPLIT_RATIO;
              // 2 <= size <= 2^32
              return (int) (size / d);
      }

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

              Created:
              Updated:
              Resolved: