chore: remove leftover Scala 2.12 idioms - #970
Merged
Merged
Conversation
Motivation:
The codebase still carried the Scala 2.12-era immutable.Seq qualifier
(and its scala.collection.immutable / immutable.Seq imports). On Scala
2.13 and 3, scala.Seq is already an alias for
scala.collection.immutable.Seq, so the qualifier is redundant.
Modification:
Replace immutable.Seq with Seq across 24 files and drop the now-unused
scala.collection.immutable, scala.collection.immutable.Seq and
scala.collection.{ immutable => im } imports. Files that still use other
immutable.* types (Set, Iterable, SortedSet) keep the import.
ClusterHttpManagementRoutesSpec swaps its scala.collection.immutable._
wildcard for an explicit SortedSet import. ConsulServiceDiscovery drops
a redundant scala.collection.immutable.Seq(targets: _*) copy since
targets is already an immutable Seq.
Result:
No remaining Scala 2.12 collection idioms in main or test sources.
Source- and binary-compatible: same erasure, MiMa passes unchanged.
Tests:
- native scalafmt --mode diff-ref=upstream/main
- sbt +Test/compile (Scala 2.13, 3.3, 3.next) passes
- sbt mimaReportBinaryIssues on all touched modules passes
- sbt test on all touched modules passes (ConsulDiscoverySpec not run:
requires Docker/testcontainers locally)
References:
None - equivalent of apache/pekko#3539
Philippus
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 (and itsscala.collection.immutable/scala.collection.immutable.Seqimports). On Scala 2.13 and 3,scala.Seqis already an alias forscala.collection.immutable.Seq, so the qualifier is redundant. This is the pekko-management equivalent of apache/pekko#3539.Unlike the core repo, there were no other 2.12 idioms to clean up here: no
WrappedArray,filterKeys/mapValues,.toIterator,Stream, orEitherprojections, and no paradox anchors referencingimmutable.Seq.Modification
immutable.SeqwithSeqacross 24 files and drop the now-unusedscala.collection.immutable,scala.collection.immutable.Seqandscala.collection.{ immutable => im }imports.immutable.*types (Set,Iterable,SortedSet) keep thescala.collection.immutableimport (ClusterHttpManagementProtocol,BootstrapCoordinator,PodDeletionCostAnnotator).ClusterHttpManagementRoutesSpec: swap thescala.collection.immutable._wildcard for an explicitSortedSetimport.ConsulServiceDiscovery: drop the redundantscala.collection.immutable.Seq(targets: _*)copy, sincetargetsis already an immutableSeq.Result
No remaining Scala 2.12 collection idioms in main or test sources. Source- and binary-compatible:
Seqhas the same erasure, so MiMa passes without new filters.Tests
scalafmt --mode diff-ref=upstream/mainsbt +Test/compilepasses on Scala 2.13, 3.3 and 3-nextsbt <module>/mimaReportBinaryIssuespasses for all touched modules (management, management-cluster-http, management-cluster-bootstrap, discovery-kubernetes-api, discovery-marathon-api, discovery-aws-api, discovery-aws-api-async, discovery-consul, lease-kubernetes, rolling-update-kubernetes)sbt <module>/testpasses for all touched modules;ConsulDiscoverySpecnot run locally as it requires Docker/testcontainers (relying on CI)References
None - equivalent of apache/pekko#3539