This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-persistence-r2dbc.git
The following commit(s) were added to refs/heads/main by this push:
new 451fe7b fix: fix compilation warnings across all Scala versions (#439)
451fe7b is described below
commit 451fe7b56edb9c014dc4bbdfec835a516a8bd5cb
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Mon Jul 6 10:15:28 2026 +0800
fix: fix compilation warnings across all Scala versions (#439)
Motivation:
Compilation produced 5 deprecation warnings across all Scala versions
(2.13.18, 3.3.8, 3.8.4):
- 4 warnings for deprecated Int + String concatenation (since 2.13.0)
- 1 warning for deprecated deleteObject without revision parameter (since
1.0.0)
Modification:
- Replace deprecated `n + "-snap"` with string interpolation `s"$n-snap"`
in EventSourcedCleanupSpec.scala (4 occurrences)
- Replace deprecated `deleteObject(persistenceId)` with
`deleteObject(persistenceId, 2L)` in DurableStateStoreSpec.scala,
using proper optimistic locking revision (1 + 1 = 2)
Result:
Clean compilation with zero warnings across all Scala versions.
Tests:
sbt +test:compile - all versions pass with no warnings
References:
None - code quality improvement
---
.../r2dbc/cleanup/scaladsl/EventSourcedCleanupSpec.scala | 8 ++++----
.../pekko/persistence/r2dbc/state/DurableStateStoreSpec.scala | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git
a/core/src/test/scala/org/apache/pekko/persistence/r2dbc/cleanup/scaladsl/EventSourcedCleanupSpec.scala
b/core/src/test/scala/org/apache/pekko/persistence/r2dbc/cleanup/scaladsl/EventSourcedCleanupSpec.scala
index 1829a54..02f4fd2 100644
---
a/core/src/test/scala/org/apache/pekko/persistence/r2dbc/cleanup/scaladsl/EventSourcedCleanupSpec.scala
+++
b/core/src/test/scala/org/apache/pekko/persistence/r2dbc/cleanup/scaladsl/EventSourcedCleanupSpec.scala
@@ -220,7 +220,7 @@ class EventSourcedCleanupSpec
})
(1 to 10).foreach { n =>
- p ! Persister.PersistWithAck(s"${if (n == 3) n + "-snap" else n}",
ackProbe.ref)
+ p ! Persister.PersistWithAck(s"${if (n == 3) s"$n-snap" else n}",
ackProbe.ref)
ackProbe.expectMessage(Done)
}
@@ -252,7 +252,7 @@ class EventSourcedCleanupSpec
})
(1 to 10).foreach { n =>
- p ! Persister.PersistWithAck(s"${if (n == 3) n + "-snap" else n}",
ackProbe.ref)
+ p ! Persister.PersistWithAck(s"${if (n == 3) s"$n-snap" else n}",
ackProbe.ref)
ackProbe.expectMessage(Done)
}
@@ -290,7 +290,7 @@ class EventSourcedCleanupSpec
(1 to 10).foreach { n =>
persisters.foreach { p =>
- p ! Persister.PersistWithAck(s"${if (n == 3) n + "-snap" else n}",
ackProbe.ref)
+ p ! Persister.PersistWithAck(s"${if (n == 3) s"$n-snap" else n}",
ackProbe.ref)
ackProbe.expectMessage(Done)
}
}
@@ -324,7 +324,7 @@ class EventSourcedCleanupSpec
(1 to 10).foreach { n =>
persisters.foreach { p =>
- p ! Persister.PersistWithAck(s"${if (n == 3) n + "-snap" else n}",
ackProbe.ref)
+ p ! Persister.PersistWithAck(s"${if (n == 3) s"$n-snap" else n}",
ackProbe.ref)
ackProbe.expectMessage(Done)
}
}
diff --git
a/core/src/test/scala/org/apache/pekko/persistence/r2dbc/state/DurableStateStoreSpec.scala
b/core/src/test/scala/org/apache/pekko/persistence/r2dbc/state/DurableStateStoreSpec.scala
index 72cfae6..73f9977 100644
---
a/core/src/test/scala/org/apache/pekko/persistence/r2dbc/state/DurableStateStoreSpec.scala
+++
b/core/src/test/scala/org/apache/pekko/persistence/r2dbc/state/DurableStateStoreSpec.scala
@@ -120,8 +120,8 @@ class DurableStateStoreSpec
val value = "Genuinely Collaborative"
store.upsertObject(persistenceId, 1L, value, unusedTag).futureValue
store.getObject(persistenceId).futureValue should
be(GetObjectResult(Some(value), 1L))
- store.deleteObject(persistenceId).futureValue
- store.getObject(persistenceId).futureValue should
be(GetObjectResult(None, 0L))
+ store.deleteObject(persistenceId, 2L).futureValue
+ store.getObject(persistenceId).futureValue should
be(GetObjectResult(None, 2L))
}
"hard delete when revision=0" in {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]