Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-38337

Replace `toIterator` with `iterator` for `IterableLike`/`IterableOnce` to cleanup deprecated api usage

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.3.0
    • 3.3.0
    • DStreams, MLlib, Spark Core, SQL
    • None

    Description

      In Scala 2.12, IterableLike.toIterator identified as @deprecatedOverriding:

       

      @deprecatedOverriding("toIterator should stay consistent with iterator for all Iterables: override iterator instead.", "2.11.0") 
      override def toIterator: Iterator[A] = iterator 

      In Scala 2.13, IterableOnce.toIterator identified as @deprecated:

      @deprecated("Use .iterator instead of .toIterator", "2.13.0") @`inline` final def toIterator: Iterator[A] = iterator 

      Attachments

        1. Screenshot_20220227-050659.png
          879 kB
          betternow88

        Activity

          People

            LuciferYang Yang Jie
            LuciferYang Yang Jie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: