Skip to content

Commit

Permalink
continue use if Util.immutableSeq in Scala 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Sep 21, 2024
1 parent f5b0476 commit f60e23c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ package javadsl
import scala.collection.immutable

import org.apache.pekko
import pekko.util.ccompat.JavaConverters._
import pekko.util.japi.Util

/**
* INTERNAL API
*
* Utility methods for converting Java collections to Scala collections.
*/
private[javadsl] object CollectionUtil {
@inline def toSeq[T](jlist: java.util.List[T]): immutable.Seq[T] =
jlist.asScala.toList
Util.immutableSeq(jlist)

@inline def toSeq[T](jiterable: java.lang.Iterable[T]): immutable.Seq[T] =
jiterable.asScala.toList
Util.immutableSeq(jiterable)
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import pekko.util.ccompat.JavaConverters._

/**
* INTERNAL API
*
* Utility methods for converting Java collections to Scala collections.
*/
private[javadsl] object CollectionUtil {
@inline def toSeq[T](jlist: java.util.List[T]): immutable.Seq[T] =
Expand Down

0 comments on commit f60e23c

Please sign in to comment.