You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/09/12 12:18:05 UTC
[PR] Remove redundant Scala 2.12-era immutable.Seq imports [pekko-persistence-jdbc]
pjfanning opened a new pull request, #617:
URL: https://github.com/apache/pekko-persistence-jdbc/pull/617
### Motivation
Since Scala 2.13, `scala.Seq` is a type alias for `scala.collection.immutable.Seq`, and `Set`, `Vector`, `Nil` and friends in the `scala` package already refer to the immutable collections. The `scala.collection.immutable` imports and `immutable.Seq` qualifiers carried over from the Scala 2.12 days are therefore redundant now that this project only builds on 2.13 and 3.
This is the pekko-persistence-jdbc counterpart of apache/pekko#3539. Of the idioms cleaned up there, only the `immutable.Seq` one exists in this repo — there are no `WrappedArray`, `filterKeys`/`mapValues`, `Either` projection, `Stream` or `.toIterator` uses to touch.
### Modification
- Drop the now-unused `scala.collection.immutable` imports (`immutable._`, `immutable.Seq`, `immutable.Set`, `immutable.{ Nil, Seq }`, `immutable.{ Seq, Vector }`) across 23 files.
- Replace `immutable.Seq` / `scala.collection.immutable.Seq` with plain `Seq`.
- `MissingElements` keeps its `immutable.NumericRange` import since `NumericRange` is not aliased in `scala._`.
`scala.Seq` erases to the same class, so the binary shape is unchanged. The one place where dropping `immutable._` changes a resolved type is a local `def next(id: String): Iterable[String]` inside `JdbcReadJournal.persistenceIds` (now `collection.Iterable` instead of `immutable.Iterable`), which is a closure-local helper passed to `statefulMapConcat` and not part of any API.
### Result
No remaining Scala 2.12 collection idioms in main or test sources.
### Tests
- native `scalafmt --mode diff-ref=upstream/main`
- `sbt "+core/Test/compile"` on Scala 2.13.18, 3.3.8 and 3.9.0
- `sbt core/mimaReportBinaryIssues` passes (with `mimaReportSignatureProblems := true`)
- `sbt "core/Test/testOnly ...TrySeqTest ...BaseDaoSpec ...H2LimitWindowingStreamTest ...JdbcAsyncWriteJournalShutdownTest ...H2ScalaCurrentPersistenceIdsTest ...ByteArrayJournalSerializerTest"`: 16 tests, all passed against H2
- `git diff --check` clean
- No new directional test: this is a pure import/alias cleanup with no behavior change; the existing specs covering the touched code were run above.
### References
Refs apache/pekko#3539
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Remove redundant Scala 2.12-era immutable.Seq imports [pekko-persistence-jdbc]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #617:
URL: https://github.com/apache/pekko-persistence-jdbc/pull/617
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org