Conversation
Motivation: The codebase still carried `immutable.Seq` qualifiers, a Scala 2.12-era idiom that is redundant on Scala 2.13/3 where `scala.Seq` is already an alias for `scala.collection.immutable.Seq`. Modification: Replace `immutable.Seq` with `Seq` in `DynamoDBJournal.asyncWriteMessages`, `PartitionKeys` and `DynamoPartitionGroupedSpec`, dropping the now-unused `scala.collection.immutable` import in `DynamoDBJournal`. The import in `DynamoDBRecovery` stays since `immutable.Iterable`/`immutable.TreeMap` still use it. Result: No remaining Scala 2.12 collection idioms in main or test sources. Same erasure, so source- and binary-compatible. Tests: - scalafmt --list --mode diff-ref=upstream/main (clean) - sbt +Test/compile - sbt "testOnly org.apache.pekko.persistence.dynamodb.journal.DynamoPartitionGroupedSpec" - sbt mimaReportBinaryIssues: reports 2 pre-existing DynamoDBHelper.dynamoDB problems that also fail on upstream/main; nothing new from this change References: Refs apache/pekko#3539
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
Port of apache/pekko#3539 to this repo. The codebase still carried
immutable.Seqqualifiers, a Scala 2.12-era idiom that is redundant on Scala 2.13/3, wherescala.Seqis already a type alias forscala.collection.immutable.Seq.Of the other idioms cleaned up in the pekko PR (
WrappedArray,filterKeys/mapValues,Eitherleft/right projections,.toIterator,Stream), none are present in this repo.Modification
DynamoDBJournal.asyncWriteMessages:immutable.Seq[AtomicWrite]/Future[immutable.Seq[Try[Unit]]]->Seq[...], dropping the now-unusedscala.collection.immutableimport.PartitionKeys.partitionEventNums:immutable.Seq[Long]->Seq[Long]. Theimmutableimport inDynamoDBRecoverystays sinceimmutable.Iterable/immutable.TreeMapstill use it.DynamoPartitionGroupedSpec:scala.collection.immutable.Seq(300L)->Seq(300L).Same erasure, so this is source- and binary-compatible.
Result
No remaining Scala 2.12 collection idioms in main or test sources.
Tests
scalafmt --list --mode diff-ref=upstream/main(clean)sbt +Test/compile(Scala 2.13.18, 3.3.8, 3.9.0)sbt "testOnly org.apache.pekko.persistence.dynamodb.journal.DynamoPartitionGroupedSpec"- 5/5 passsbt mimaReportBinaryIssuesreports 2 problems onDynamoDBHelper.dynamoDB(result typeAmazonDynamoDBAsyncClient->AmazonDynamoDBAsyncvs 1.0.0). These are pre-existing and fail identically onmainwithout this change; nothing new is introduced here.References
Refs apache/pekko#3539