You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by fa...@apache.org on 2026/10/19 18:59:27 UTC

(pekko-persistence-dynamodb) branch main updated: chore: remove leftover Scala 2.12 idioms (#366)

This is an automated email from the ASF dual-hosted git repository.

pjfanning pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-persistence-dynamodb.git


The following commit(s) were added to refs/heads/main by this push:
     new 5d03587  chore: remove leftover Scala 2.12 idioms (#366)
5d03587 is described below

commit 5d035873d6555683c3c13012fba59ff393da897c
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Mon Oct 19 19:59:22 2026 +0100

    chore: remove leftover Scala 2.12 idioms (#366)
    
    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
---
 .../apache/pekko/persistence/dynamodb/journal/DynamoDBJournal.scala    | 3 +--
 .../apache/pekko/persistence/dynamodb/journal/DynamoDBRecovery.scala   | 2 +-
 .../persistence/dynamodb/journal/DynamoPartitionGroupedSpec.scala      | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/main/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoDBJournal.scala b/src/main/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoDBJournal.scala
index 51f000d..eec5ada 100644
--- a/src/main/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoDBJournal.scala
+++ b/src/main/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoDBJournal.scala
@@ -25,7 +25,6 @@ import org.apache.pekko.stream.{ Materializer, SystemMaterializer }
 import com.amazonaws.services.dynamodbv2.model._
 import com.typesafe.config.Config
 
-import scala.collection.immutable
 import scala.concurrent.{ ExecutionContext, Future, Promise }
 import scala.util.{ Success, Try }
 
@@ -107,7 +106,7 @@ class DynamoDBJournal(config: Config)
   private case class OpFinished(pid: String, f: Future[Done])
   private val opQueue: JMap[String, Future[Done]] = new JHMap
 
-  override def asyncWriteMessages(messages: immutable.Seq[AtomicWrite]): Future[immutable.Seq[Try[Unit]]] = {
+  override def asyncWriteMessages(messages: Seq[AtomicWrite]): Future[Seq[Try[Unit]]] = {
     val p = Promise[Done]()
     val pid = messages.head.persistenceId
     opQueue.put(pid, p.future)
diff --git a/src/main/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoDBRecovery.scala b/src/main/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoDBRecovery.scala
index 36bf176..5da84ad 100644
--- a/src/main/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoDBRecovery.scala
+++ b/src/main/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoDBRecovery.scala
@@ -60,7 +60,7 @@ object DynamoDBRecovery {
  * @param partitionSeqNum - the partition sequence number for the given persistence id.
  * @param partitionEventNums - will be 0-99, representing the event ordering within the given partition sequence.
  */
-case class PartitionKeys(partitionSeqNum: Long, partitionEventNums: immutable.Seq[Long])
+case class PartitionKeys(partitionSeqNum: Long, partitionEventNums: Seq[Long])
 
 /**
  * Groups Longs from a stream into a [PartitionKeys] whereas each sequence shall contain the values that would be within the
diff --git a/src/test/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoPartitionGroupedSpec.scala b/src/test/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoPartitionGroupedSpec.scala
index 64c9076..b507c22 100644
--- a/src/test/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoPartitionGroupedSpec.scala
+++ b/src/test/scala/org/apache/pekko/persistence/dynamodb/journal/DynamoPartitionGroupedSpec.scala
@@ -50,7 +50,7 @@ class DynamoPartitionGroupedSpec extends TestKit(ActorSystem("DynamoPartitionGro
         .request(1)
         .expectNext(PartitionKeys(2L, 200L to 299))
         .request(1)
-        .expectNext(PartitionKeys(3L, scala.collection.immutable.Seq(300L)))
+        .expectNext(PartitionKeys(3L, Seq(300L)))
         .expectComplete()
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org