chore: replace immutable.Seq with Seq, drop Scala 2.12-era imports - #1298
Merged
Merged
Conversation
Motivation: The codebase still carried the Scala 2.12-era `immutable.Seq` qualifier across ~100 files. `scala.Seq` has been an alias for `scala.collection.immutable.Seq` since 2.13, so the qualifier and the `scala.collection.immutable` imports that only exist to support it are redundant. Mirrors apache/pekko#3539. Modification: - Replace `immutable.Seq`, `collection.immutable.Seq` and `scala.collection.immutable.Seq` with `Seq` in main, test, multi-jvm and docs-snippet Scala sources. - Drop `import scala.collection.immutable` / `immutable.Seq` where no other `immutable.*` member is used; keep it where TreeMap, VectorBuilder, ListMap, etc. are still referenced. - `Http2Blueprint`: `import scala.collection.{ immutable, mutable }` -> `import scala.collection.mutable`. - Paradox docs: prose and signature mentions updated from `immutable.Seq` to `Seq`; `alphabetically.md` table rows re-padded. - Java sources are unchanged: `scala.Seq` is a package-object alias that Java cannot name. Result: No remaining `immutable.Seq` idioms in Scala sources or docs. Source- and binary-compatible (same erasure); no MiMa filter needed. Tests: - native scalafmt 3.7.17 on all changed Scala files - sbt Test/compile multi-jvm:compile (Scala 2.13.18) - sbt http-core/mimaReportBinaryIssues http/mimaReportBinaryIssues http-cors/mimaReportBinaryIssues http-xml/mimaReportBinaryIssues - sbt http-cors/test; HeaderSpec, HttpHeaderSpec, FramingSpec, Http2FramingSpec, HttpMessageRenderingSpec, Http*DetailedStringExampleSpec References: None - follows apache/pekko#3539
Philippus
approved these changes
Sep 12, 2026
He-Pin
approved these changes
Sep 12, 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 carried the Scala 2.12-era
immutable.Seqqualifier across ~100 files.scala.Seqhas been a type alias forscala.collection.immutable.Seqsince 2.13, so the qualifier — and thescala.collection.immutableimports that exist only to support it — are redundant. This is the pekko-http counterpart of apache/pekko#3539.Modification
immutable.Seq,collection.immutable.Seqandscala.collection.immutable.SeqwithSeqacross main, test, multi-jvm and docs-snippet Scala sources (100 files).import scala.collection.immutable(70 files) andimport scala.collection.immutable.Seq(13 files) where no otherimmutable.*member is used; the import is kept in the 16 files that still referenceimmutable.TreeMap,VectorBuilder,ListMap,IndexedSeq, etc.Http2Blueprint:import scala.collection.{ immutable, mutable }->import scala.collection.mutable.immutable.SeqtoSeq; thealphabetically.mdtable rows are re-padded so the columns stay aligned.Util.java,MediaTypes.java,RegexConverters.java) are deliberately unchanged:scala.Seqis a package-object alias that Java cannot name, so they must keepscala.collection.immutable.Seq.The other idioms cleaned up in apache/pekko#3539 (
WrappedArray,filterKeys/mapValues,.toIterator,Stream,.left.get/.right.get) do not occur in this repo — the existingmapValues/filterKeyscalls already go through.view.Result
No remaining
immutable.Seqidioms in Scala sources or docs. The change is source- and binary-compatible (identical erasure); unlike the pekko PR, no MiMa filter was needed.Tests
scalafmt3.7.17 run on all changed Scala filessbt Test/compile multi-jvm:compilepasses on Scala 2.13.18 (Scala 3 left to CI)sbt http-core/mimaReportBinaryIssues http/mimaReportBinaryIssues http-cors/mimaReportBinaryIssues http-xml/mimaReportBinaryIssues— all pass against 1.0.0 withmimaReportSignatureProblems := true(testkit has MiMa disabled in the build)sbt http-cors/testplusHeaderSpec,HttpHeaderSpec,FramingSpec,Http2FramingSpec,HttpMessageRenderingSpecand the twoHttp*DetailedStringExampleSpecdoc specs — 201 tests, 0 failuresReferences
None - follows apache/pekko#3539