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-cassandra.git


The following commit(s) were added to refs/heads/main by this push:
     new 5934083  chore: use StandardCharsets.UTF_8 (#447)
5934083 is described below

commit 5934083b26c2e141e32bf8c95800ec0fd8a03a44
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Mon Jul 6 22:03:34 2026 +0800

    chore: use StandardCharsets.UTF_8 (#447)
    
    Motivation:\nAvoid stringly-typed UTF-8 charset usage in encoding and 
decoding code paths.\n\nModification:\nReplace UTF-8 charset string arguments 
with StandardCharsets.UTF_8 and normalize touched XML declarations where 
applicable.\n\nResult:\nCharset usage is type-safe and exact lowercase "utf-8" 
string literals are removed from the touched areas.
---
 core/src/test/resources/logback-test.xml                      |  2 +-
 .../cassandra/snapshot/CassandraSnapshotStoreSpec.scala       | 11 ++++++-----
 example/src/main/resources/logback.xml                        |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/core/src/test/resources/logback-test.xml 
b/core/src/test/resources/logback-test.xml
index 98f404e..77534ab 100644
--- a/core/src/test/resources/logback-test.xml
+++ b/core/src/test/resources/logback-test.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
   <!-- Silence initial setup logging from Logback -->
   <statusListener class="ch.qos.logback.core.status.NopStatusListener" />
diff --git 
a/core/src/test/scala/org/apache/pekko/persistence/cassandra/snapshot/CassandraSnapshotStoreSpec.scala
 
b/core/src/test/scala/org/apache/pekko/persistence/cassandra/snapshot/CassandraSnapshotStoreSpec.scala
index 52def47..7dfedde 100644
--- 
a/core/src/test/scala/org/apache/pekko/persistence/cassandra/snapshot/CassandraSnapshotStoreSpec.scala
+++ 
b/core/src/test/scala/org/apache/pekko/persistence/cassandra/snapshot/CassandraSnapshotStoreSpec.scala
@@ -16,6 +16,7 @@ package org.apache.pekko.persistence.cassandra.snapshot
 import java.lang.{ Long => JLong }
 import java.lang.{ Integer => JInteger }
 import java.nio.ByteBuffer
+import java.nio.charset.StandardCharsets
 
 import org.apache.pekko
 import pekko.persistence.SnapshotProtocol._
@@ -91,7 +92,7 @@ class CassandraSnapshotStoreSpec
           123L: JLong,
           serId,
           "",
-          ByteBuffer.wrap("fail-1".getBytes("UTF-8"))))
+          ByteBuffer.wrap("fail-1".getBytes(StandardCharsets.UTF_8))))
 
       cluster.execute(
         SimpleStatement.newInstance(
@@ -101,7 +102,7 @@ class CassandraSnapshotStoreSpec
           124L: JLong,
           serId,
           "",
-          ByteBuffer.wrap("fail-2".getBytes("UTF-8"))))
+          ByteBuffer.wrap("fail-2".getBytes(StandardCharsets.UTF_8))))
 
       // load most recent snapshot, first two attempts will fail ...
       snapshotStore.tell(LoadSnapshot(pid, SnapshotSelectionCriteria.Latest, 
Long.MaxValue), probe.ref)
@@ -127,7 +128,7 @@ class CassandraSnapshotStoreSpec
           123L: JLong,
           serId,
           "",
-          ByteBuffer.wrap("fail-1".getBytes("UTF-8"))))
+          ByteBuffer.wrap("fail-1".getBytes(StandardCharsets.UTF_8))))
       cluster.execute(
         SimpleStatement.newInstance(
           writeSnapshot(withMeta = false),
@@ -136,7 +137,7 @@ class CassandraSnapshotStoreSpec
           124L: JLong,
           serId,
           "",
-          ByteBuffer.wrap("fail-2".getBytes("UTF-8"))))
+          ByteBuffer.wrap("fail-2".getBytes(StandardCharsets.UTF_8))))
       cluster.execute(
         SimpleStatement.newInstance(
           writeSnapshot(withMeta = false),
@@ -145,7 +146,7 @@ class CassandraSnapshotStoreSpec
           125L: JLong,
           serId,
           "",
-          ByteBuffer.wrap("fail-3".getBytes("UTF-8"))))
+          ByteBuffer.wrap("fail-3".getBytes(StandardCharsets.UTF_8))))
 
       // load most recent snapshot, first three attempts will fail ...
       snapshotStore.tell(LoadSnapshot(pid, SnapshotSelectionCriteria.Latest, 
Long.MaxValue), probe.ref)
diff --git a/example/src/main/resources/logback.xml 
b/example/src/main/resources/logback.xml
index 692f9de..8e1550e 100644
--- a/example/src/main/resources/logback.xml
+++ b/example/src/main/resources/logback.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
   <appender name="CONSOLE"
   class="ch.qos.logback.core.ConsoleAppender">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to