He-Pin opened a new pull request, #3147: URL: https://github.com/apache/pekko/pull/3147
### Motivation Multiple files pass charset as a `String` (`"utf-8"`) or via `ByteString.UTF_8` (which is `StandardCharsets.UTF_8.name()`) to `URLEncoder.encode` and `URLDecoder.decode`. JDK 10 added overloads that accept a `Charset` object directly, avoiding the checked `UnsupportedEncodingException` declaration. ### Modification Replace `"utf-8"` and `ByteString.UTF_8` string arguments with `StandardCharsets.UTF_8` Charset object in 17 call sites across 8 files: - `cluster-sharding`: `Shard.scala`, `ShardRegion.scala`, `ClusterSharding.scala` - `cluster-sharding-typed`: `ClusterShardingImpl.scala` - `cluster-tools`: `ClusterClient.scala`, `DistributedPubSubMediator.scala` - `persistence-query`: `LeveldbReadJournal.scala` - `stream`: `Attributes.scala` Remove 4 unused `ByteString` imports. ### Result Type-safe charset specification, no `UnsupportedEncodingException` declaration needed, removes `ByteString` dependency where it was only used for charset name constants. ### Tests - `sbt "cluster-sharding/compile" "cluster-sharding-typed/compile" "cluster-tools/compile" "persistence-query/compile" "stream/compile"` — all passed ### References Refs #3136 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
