Chore: remove leftover Scala 2.12 immutable.Seq idioms - #1941
Merged
Merged
Conversation
Motivation: The codebase still qualified Seq as immutable.Seq throughout, a Scala 2.12-era habit. Since 2.13 (and on Scala 3) scala.Seq is an alias for scala.collection.immutable.Seq, so the qualifier and the supporting scala.collection.immutable imports are redundant. Mirrors apache/pekko#3539. Modification: - Replace immutable.Seq with Seq across 120 Scala files. - Drop the now-unused scala.collection.immutable and scala.collection.immutable.Seq imports; reduce scala.collection.{ immutable, mutable } to scala.collection.mutable where only mutable remains in use. - Keep scala.collection.immutable in files that still use immutable.Iterable, immutable.Map etc. immutable.Iterable is left unchanged because bare Iterable is scala.collection.Iterable. - csv.md prose updated from immutable.Seq[String] to Seq[String]. Result: No remaining immutable.Seq qualifiers in main, test or doc sources. Types are identical (same erasure), so no API or binary change. Tests: - native scalafmt --mode diff-ref=origin/main - sbt Test/compile (Scala 2.13.18) and sbt "++3.3.8" Test/compile - sbt mimaReportBinaryIssues (all modules) passes, no filters needed - sbt csv/test xml/test file/test text/test simple-codecs/test reference/test - sbt docs/paradox References: None - follows apache/pekko#3539
Philippus
approved these changes
Sep 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The codebase still qualified
Seqasimmutable.Seqthroughout, a Scala 2.12-era habit. Since 2.13 (and on Scala 3)scala.Seqis an alias forscala.collection.immutable.Seq, so the qualifier and the supportingscala.collection.immutableimports are redundant. This mirrors apache/pekko#3539 for the connectors repo.Of the other idioms that PR removed (
WrappedArray,filterKeys,Eitherprojections,.toIterator,Stream), none remain here, and the threemapValuescalls already go through.view, soimmutable.Seqis the whole change.Modification
immutable.SeqwithSeqacross 120 Scala files.scala.collection.immutable(76) andscala.collection.immutable.Seq(31) imports; reducescala.collection.{ immutable, mutable }toscala.collection.mutablein the 5 JMS/Jakarta specs where onlymutableremains in use.scala.collection.immutablein the 11 files that still useimmutable.Iterable,immutable.Map, etc.immutable.Iterableis deliberately left unchanged because bareIterableisscala.collection.Iterable, not the immutable one.csv.mdprose updated fromimmutable.Seq[String]toSeq[String]. Thecontributor-advice.mdScala/Java type table keeps the fully-qualified name on purpose.Result
No remaining
immutable.Seqqualifiers in main, test or doc sources. The types are identical (same erasure), so there is no API or binary change. Unlike the upstream PR, no MiMa filter was needed: there are no existentialimmutable.Seq[_]uses in this repo.Tests
scalafmt --mode diff-ref=origin/mainrun on all changed filessbt Test/compileon Scala 2.13.18 andsbt "++3.3.8" Test/compileboth pass with no unused-import warningssbt mimaReportBinaryIssues(all modules, Scala 2.13) passessbt csv/test xml/test file/test text/test simple-codecs/test reference/testpass (the Docker-backed modules are left to CI)sbt docs/paradoxbuildsReferences
None - follows apache/pekko#3539