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


The following commit(s) were added to refs/heads/main by this push:
     new ee6965cd58 fix: Scala 3.8 syntax compat fixes and import cleanup 
(#3074)
ee6965cd58 is described below

commit ee6965cd58098584dbc17a61d37e038faa5e8f99
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Tue Jun 16 03:29:35 2026 +0800

    fix: Scala 3.8 syntax compat fixes and import cleanup (#3074)
    
    Motivation:
    Scala 3.8 introduces stricter syntax requirements and new warnings for
    patterns that will be removed in future versions. Several code patterns
    need updates for forward compatibility.
    
    Modification:
    - Replace _ wildcard type with ? in scala-3 source directories
      (Platform.scala, ClusterReceptionistProtocol.scala)
    - Add explicit using keyword for implicit argument forwarding in
      ByteIterator.scala (scala-3): getShort(using byteOrder)
    - Add @unchecked annotations for type-test patterns that cannot be
      checked at runtime in AskPattern.scala and ByteString.scala
    - Replace eta expansion syntax apply _ with explicit lambda
      ref => apply(ref) in Patterns.scala (4 occurrences)
    - Fix SortedSet.empty implicit ordering in SimpleDnsCache.scala by
      binding ordering as implicit val before calling .empty
    - Replace infix type syntax AnyRef JPair AnyRef with JPair[AnyRef, AnyRef]
      in ConstantFun.scala
    - Add LogSource implicit val bindings for Logging calls in Ops.scala
    - Add implicit def selfSender in SourceRefImpl.scala
    - Fix Logging factory call in MultiNodeSpec.scala
    - Fix discard result pattern in FixedBufferSpec.scala
    - Import reordering and formatting across ~35 files for scalafmt
      compliance
    - Fix Scaladoc apostrophe in CallingThreadDispatcher.scala
    - Fix doc reference "Java 8" to "Java" in operators/index.md
    - Remove unused import in SnapshotStorage.scala
    
    Result:
    Code compiles cleanly with Scala 3.8 syntax requirements. No behavioral
    changes to the runtime.
    
    Tests:
    Not run - syntax compat fixes, verified by cross-compilation
    
    References:
    None - proactive Scala 3.8 forward compatibility
---
 .../apache/pekko/io/dns/DockerBindDnsService.scala |  4 ++-
 .../scala/org/apache/pekko/util/SWARUtilSpec.scala |  2 +-
 .../typed/internal/receptionist/Platform.scala     |  4 +--
 .../org/apache/pekko/util/ByteIterator.scala       | 36 +++++++++++-----------
 .../dispatch/ForkJoinExecutorConfigurator.scala    |  4 +--
 .../scala/org/apache/pekko/io/SimpleDnsCache.scala |  4 ++-
 .../scala/org/apache/pekko/pattern/Patterns.scala  | 13 +++++---
 .../scala/org/apache/pekko/util/LineNumbers.scala  |  2 +-
 .../stream/GraphStageConstructionBenchmark.scala   | 15 ++++-----
 .../org/apache/pekko/stream/io/TlsBenchmark.scala  |  3 +-
 .../util/ByteStringParser_readNum_Benchmark.scala  |  4 +--
 .../typed/javadsl/ShardedDaemonProcess.scala       |  2 +-
 .../internal/ShardedDaemonProcessIdSpec.scala      |  1 +
 .../pekko/cluster/sharding/ShardRegion.scala       |  8 +++--
 .../ClusterShardingCoordinatorRoleSpec.scala       |  6 ++--
 .../RememberEntitiesAndStartEntitySpec.scala       |  3 +-
 .../singleton/ClusterSingletonManager.scala        |  8 +++--
 .../cluster/singleton/ClusterSingletonProxy.scala  |  8 +++--
 .../receptionist/ClusterReceptionistProtocol.scala |  2 +-
 .../pekko/cluster/CrossDcClusterHeartbeat.scala    |  8 +++--
 .../org/apache/pekko/cluster/MembershipState.scala |  3 +-
 .../org/apache/pekko/cluster/Reachability.scala    |  4 +--
 .../apache/pekko/cluster/sbr/DowningStrategy.scala |  5 ++-
 .../apache/pekko/discovery/ServiceDiscovery.scala  |  3 +-
 .../apache/pekko/cluster/ddata/Replicator.scala    | 10 ++++--
 .../cluster/ddata/WildcardSubscribeSpec.scala      |  6 ++--
 docs/src/main/paradox/stream/operators/index.md    |  2 +-
 .../pekko/remote/testkit/MultiNodeSpec.scala       |  2 +-
 .../persistence/query/typed/EventEnvelope.scala    |  2 +-
 .../persistence/testkit/SnapshotStorage.scala      |  3 --
 .../testkit/javadsl/PersistenceProbeBehavior.scala |  3 +-
 .../scaladsl/PersistenceTestKitReadJournal.scala   |  1 +
 ...urcedBehaviorRetentionOnlyOneSnapshotSpec.scala |  7 +++--
 .../typed/javadsl/EventSourcedBehavior.scala       |  3 +-
 .../typed/state/javadsl/DurableStateBehavior.scala |  3 +-
 .../AsyncWriteJournalResponseOrderSpec.scala       |  4 +--
 .../ssl/RotatingKeysSSLEngineProviderSpec.scala    |  3 +-
 .../stream/impl/FanoutPublisherBehaviorSpec.scala  |  6 ++--
 .../apache/pekko/stream/impl/FixedBufferSpec.scala |  4 +--
 .../pekko/stream/impl/TraversalBuilderSpec.scala   |  4 +--
 .../org/apache/pekko/stream/io/FileSinkSpec.scala  |  2 +-
 .../apache/pekko/stream/io/FileSourceSpec.scala    |  2 +-
 .../stream/io/TlsGraphStageEdgeCasesSpec.scala     |  7 ++---
 .../io/compression/DeflateAutoFlushSpec.scala      |  4 +--
 .../stream/io/compression/GzipAutoFlushSpec.scala  |  4 +--
 .../apache/pekko/stream/scaladsl/SinkSpec.scala    |  3 +-
 .../stream/impl/FanoutPublisherBridgeStage.scala   |  2 +-
 .../pekko/stream/impl/fusing/IteratorSource.scala  |  2 +-
 .../org/apache/pekko/stream/javadsl/Flow.scala     |  3 +-
 .../org/apache/pekko/stream/javadsl/Sink.scala     |  3 +-
 .../org/apache/pekko/stream/javadsl/SubFlow.scala  |  4 +--
 .../apache/pekko/stream/javadsl/SubSource.scala    |  4 +--
 .../org/apache/pekko/stream/javadsl/Tcp.scala      |  2 +-
 .../org/apache/pekko/stream/scaladsl/TLS.scala     |  4 +--
 .../pekko/testkit/CallingThreadDispatcher.scala    |  2 +-
 55 files changed, 152 insertions(+), 111 deletions(-)

diff --git 
a/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala 
b/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala
index ab27bb2514..501aa8a9e7 100644
--- 
a/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala
+++ 
b/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala
@@ -19,6 +19,7 @@ import scala.concurrent.duration._
 import scala.jdk.CollectionConverters._
 import scala.util.Try
 import scala.util.control.NonFatal
+
 import com.github.dockerjava.api.DockerClient
 import com.github.dockerjava.api.async.ResultCallback
 import com.github.dockerjava.api.command.CreateContainerCmd
@@ -29,10 +30,11 @@ import 
com.github.dockerjava.httpclient5.ApacheDockerHttpClient
 import org.apache.pekko
 import pekko.actor.Props
 import pekko.io.dns.internal.DnsClient
+import pekko.testkit.PekkoSpec
 import pekko.util.Timeout
 
-import pekko.testkit.PekkoSpec
 import org.scalatest.concurrent.Eventually
+
 import com.typesafe.config.Config
 
 abstract class DockerBindDnsService(config: Config) extends PekkoSpec(config) 
with Eventually {
diff --git 
a/actor-tests/src/test/scala/org/apache/pekko/util/SWARUtilSpec.scala 
b/actor-tests/src/test/scala/org/apache/pekko/util/SWARUtilSpec.scala
index a88d6b5e8f..6ce6762137 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/util/SWARUtilSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/util/SWARUtilSpec.scala
@@ -19,8 +19,8 @@ package org.apache.pekko.util
 
 import java.nio.ByteOrder
 
-import org.scalatest.wordspec.AnyWordSpec
 import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
 
 class SWARUtilSpec extends AnyWordSpec with Matchers {
 
diff --git 
a/actor-typed/src/main/scala-3/org/apache/pekko/actor/typed/internal/receptionist/Platform.scala
 
b/actor-typed/src/main/scala-3/org/apache/pekko/actor/typed/internal/receptionist/Platform.scala
index 1ae72d6921..6ee2282ddf 100644
--- 
a/actor-typed/src/main/scala-3/org/apache/pekko/actor/typed/internal/receptionist/Platform.scala
+++ 
b/actor-typed/src/main/scala-3/org/apache/pekko/actor/typed/internal/receptionist/Platform.scala
@@ -23,11 +23,11 @@ import pekko.annotation.InternalApi
 @InternalApi private[receptionist] object Platform {
   type Aux[P] = AbstractServiceKey { type Protocol = P }
 
-  type Service[K <: Aux[_]] = K match {
+  type Service[K <: Aux[?]] = K match {
     case Aux[t] => ActorRef[t]
   }
 
-  type Subscriber[K <: Aux[_]] = K match {
+  type Subscriber[K <: Aux[?]] = K match {
     case Aux[t] => ActorRef[ReceptionistMessages.Listing[t]]
   }
 }
diff --git a/actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala 
b/actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala
index dd727215ee..3e2d80f3cf 100644
--- a/actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala
+++ b/actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala
@@ -256,28 +256,28 @@ object ByteIterator {
     override def getShort(implicit byteOrder: ByteOrder): Short = {
       val cur = current
       if cur.len >= java.lang.Short.BYTES then {
-        val r = cur.getShort(byteOrder)
+        val r = cur.getShort(using byteOrder)
         normalize()
         r
-      } else super.getShort(byteOrder)
+      } else super.getShort(using byteOrder)
     }
 
     override def getInt(implicit byteOrder: ByteOrder): Int = {
       val cur = current
       if cur.len >= java.lang.Integer.BYTES then {
-        val r = cur.getInt(byteOrder)
+        val r = cur.getInt(using byteOrder)
         normalize()
         r
-      } else super.getInt(byteOrder)
+      } else super.getInt(using byteOrder)
     }
 
     override def getLong(implicit byteOrder: ByteOrder): Long = {
       val cur = current
       if cur.len >= java.lang.Long.BYTES then {
-        val r = cur.getLong(byteOrder)
+        val r = cur.getLong(using byteOrder)
         normalize()
         r
-      } else super.getLong(byteOrder)
+      } else super.getLong(using byteOrder)
     }
 
     final override def len: Int = iterators.foldLeft(0) { _ + _.len }
@@ -417,19 +417,19 @@ object ByteIterator {
       getToArray(xs, offset, n, 1) { getByte } { current.getBytes(_, _, _) }
 
     def getShorts(xs: Array[Short], offset: Int, n: Int)(implicit byteOrder: 
ByteOrder): this.type =
-      getToArray(xs, offset, n, 2) { getShort(byteOrder) } { 
current.getShorts(_, _, _)(byteOrder) }
+      getToArray(xs, offset, n, 2) { getShort(using byteOrder) } { 
current.getShorts(_, _, _)(using byteOrder) }
 
     def getInts(xs: Array[Int], offset: Int, n: Int)(implicit byteOrder: 
ByteOrder): this.type =
-      getToArray(xs, offset, n, 4) { getInt(byteOrder) } { current.getInts(_, 
_, _)(byteOrder) }
+      getToArray(xs, offset, n, 4) { getInt(using byteOrder) } { 
current.getInts(_, _, _)(using byteOrder) }
 
     def getLongs(xs: Array[Long], offset: Int, n: Int)(implicit byteOrder: 
ByteOrder): this.type =
-      getToArray(xs, offset, n, 8) { getLong(byteOrder) } { 
current.getLongs(_, _, _)(byteOrder) }
+      getToArray(xs, offset, n, 8) { getLong(using byteOrder) } { 
current.getLongs(_, _, _)(using byteOrder) }
 
     def getFloats(xs: Array[Float], offset: Int, n: Int)(implicit byteOrder: 
ByteOrder): this.type =
-      getToArray(xs, offset, n, 8) { getFloat(byteOrder) } { 
current.getFloats(_, _, _)(byteOrder) }
+      getToArray(xs, offset, n, 8) { getFloat(using byteOrder) } { 
current.getFloats(_, _, _)(using byteOrder) }
 
     def getDoubles(xs: Array[Double], offset: Int, n: Int)(implicit byteOrder: 
ByteOrder): this.type =
-      getToArray(xs, offset, n, 8) { getDouble(byteOrder) } { 
current.getDoubles(_, _, _)(byteOrder) }
+      getToArray(xs, offset, n, 8) { getDouble(using byteOrder) } { 
current.getDoubles(_, _, _)(using byteOrder) }
 
     /** For performance sensitive code, call copyToBuffer() directly on 
ByteString (it's optimised there) */
     override def copyToBuffer(buffer: ByteBuffer): Int = {
@@ -649,10 +649,10 @@ abstract class ByteIterator extends 
BufferedIterator[Byte] {
   }
 
   def getFloat(implicit byteOrder: ByteOrder): Float =
-    java.lang.Float.intBitsToFloat(getInt(byteOrder))
+    java.lang.Float.intBitsToFloat(getInt(using byteOrder))
 
   def getDouble(implicit byteOrder: ByteOrder): Double =
-    java.lang.Double.longBitsToDouble(getLong(byteOrder))
+    java.lang.Double.longBitsToDouble(getLong(using byteOrder))
 
   /**
    * Get a specific number of Bytes from this iterator. In contrast to
@@ -690,7 +690,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
    * Get a number of Shorts from this iterator.
    */
   def getShorts(xs: Array[Short])(implicit byteOrder: ByteOrder): this.type =
-    getShorts(xs, 0, xs.length)(byteOrder)
+    getShorts(xs, 0, xs.length)(using byteOrder)
 
   /**
    * Get a number of Shorts from this iterator.
@@ -701,7 +701,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
    * Get a number of Ints from this iterator.
    */
   def getInts(xs: Array[Int])(implicit byteOrder: ByteOrder): this.type =
-    getInts(xs, 0, xs.length)(byteOrder)
+    getInts(xs, 0, xs.length)(using byteOrder)
 
   /**
    * Get a number of Ints from this iterator.
@@ -712,7 +712,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
    * Get a number of Longs from this iterator.
    */
   def getLongs(xs: Array[Long])(implicit byteOrder: ByteOrder): this.type =
-    getLongs(xs, 0, xs.length)(byteOrder)
+    getLongs(xs, 0, xs.length)(using byteOrder)
 
   /**
    * Get a number of Longs from this iterator.
@@ -723,7 +723,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
    * Get a number of Floats from this iterator.
    */
   def getFloats(xs: Array[Float])(implicit byteOrder: ByteOrder): this.type =
-    getFloats(xs, 0, xs.length)(byteOrder)
+    getFloats(xs, 0, xs.length)(using byteOrder)
 
   /**
    * Get a number of Floats from this iterator.
@@ -734,7 +734,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
    * Get a number of Doubles from this iterator.
    */
   def getDoubles(xs: Array[Double])(implicit byteOrder: ByteOrder): this.type =
-    getDoubles(xs, 0, xs.length)(byteOrder)
+    getDoubles(xs, 0, xs.length)(using byteOrder)
 
   /**
    * Get a number of Doubles from this iterator.
diff --git 
a/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala
 
b/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala
index ff500c16ac..3a88f3136b 100644
--- 
a/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala
+++ 
b/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala
@@ -15,11 +15,11 @@ package org.apache.pekko.dispatch
 
 import java.util.concurrent.{ ExecutorService, ForkJoinPool, ForkJoinTask, 
ThreadFactory, TimeUnit }
 
-import com.typesafe.config.Config
-
 import org.apache.pekko.annotation.InternalApi
 import org.apache.pekko.util.JavaVersion
 
+import com.typesafe.config.Config
+
 object ForkJoinExecutorConfigurator {
 
   /**
diff --git a/actor/src/main/scala/org/apache/pekko/io/SimpleDnsCache.scala 
b/actor/src/main/scala/org/apache/pekko/io/SimpleDnsCache.scala
index c175aee614..27e735ff2f 100644
--- a/actor/src/main/scala/org/apache/pekko/io/SimpleDnsCache.scala
+++ b/actor/src/main/scala/org/apache/pekko/io/SimpleDnsCache.scala
@@ -34,9 +34,11 @@ private[io] trait PeriodicCacheCleanup {
 
 class SimpleDnsCache extends Dns with PeriodicCacheCleanup with 
NoSerializationVerificationNeeded {
   import SimpleDnsCache._
+  private implicit val expiryOrdering: Ordering[ExpiryEntry[(String, 
RequestType)]] =
+    expiryEntryOrdering[(String, RequestType)]()
   private val cacheRef = new AtomicReference(
     new Cache[(String, RequestType), Resolved](
-      immutable.SortedSet()(expiryEntryOrdering()),
+      immutable.SortedSet.empty[ExpiryEntry[(String, RequestType)]],
       immutable.Map(),
       () => clock()))
 
diff --git a/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala 
b/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala
index f56faed968..1920d29efd 100644
--- a/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala
+++ b/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala
@@ -129,7 +129,7 @@ object Patterns {
    */
   def askWithReplyTo(actor: ActorRef, messageFactory: 
japi.function.Function[ActorRef, Any], timeout: Timeout)
       : Future[AnyRef] =
-    extended.ask(actor, messageFactory.apply 
_)(timeout).asInstanceOf[Future[AnyRef]]
+    extended.ask(actor, ref => 
messageFactory.apply(ref))(timeout).asInstanceOf[Future[AnyRef]]
 
   /**
    * A variation of ask which allows to implement "replyTo" pattern by 
including
@@ -150,7 +150,8 @@ object Patterns {
       actor: ActorRef,
       messageFactory: japi.function.Function[ActorRef, Any],
       timeout: java.time.Duration): CompletionStage[AnyRef] =
-    extended.ask(actor, messageFactory.apply 
_)(Timeout.create(timeout)).asJava.asInstanceOf[CompletionStage[AnyRef]]
+    extended.ask(actor, ref => 
messageFactory.apply(ref))(Timeout.create(timeout)).asJava.asInstanceOf[CompletionStage[
+      AnyRef]]
 
   /**
    * <i>Java API for `org.apache.pekko.pattern.ask`:</i>
@@ -201,7 +202,7 @@ object Patterns {
       actor: ActorRef,
       messageFactory: japi.function.Function[ActorRef, Any],
       timeoutMillis: Long): Future[AnyRef] =
-    extended.ask(actor, messageFactory.apply 
_)(Timeout(timeoutMillis.millis)).asInstanceOf[Future[AnyRef]]
+    extended.ask(actor, ref => 
messageFactory.apply(ref))(Timeout(timeoutMillis.millis)).asInstanceOf[Future[AnyRef]]
 
   /**
    * <i>Java API for `org.apache.pekko.pattern.ask`:</i>
@@ -316,7 +317,8 @@ object Patterns {
       selection: ActorSelection,
       messageFactory: japi.function.Function[ActorRef, Any],
       timeoutMillis: Long): Future[AnyRef] =
-    extended.ask(selection, messageFactory.apply 
_)(Timeout(timeoutMillis.millis)).asInstanceOf[Future[AnyRef]]
+    extended.ask(selection, ref => 
messageFactory.apply(ref))(Timeout(timeoutMillis.millis)).asInstanceOf[Future[
+      AnyRef]]
 
   /**
    * A variation of ask which allows to implement "replyTo" pattern by 
including
@@ -333,7 +335,8 @@ object Patterns {
       selection: ActorSelection,
       messageFactory: japi.function.Function[ActorRef, Any],
       timeout: java.time.Duration): CompletionStage[AnyRef] =
-    extended.ask(selection, messageFactory.apply 
_)(timeout.toScala).asJava.asInstanceOf[CompletionStage[AnyRef]]
+    extended.ask(selection, ref => 
messageFactory.apply(ref))(timeout.toScala).asJava.asInstanceOf[CompletionStage[
+      AnyRef]]
 
   /**
    * Register an onComplete callback on this [[scala.concurrent.Future]] to 
send
diff --git a/actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala 
b/actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala
index 53b7668873..424941490c 100644
--- a/actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala
@@ -358,7 +358,7 @@ object LineNumbers {
   private def readAttributes(d: DataInputStream)(implicit c: Constants): 
Option[String] = {
     val count = d.readUnsignedShort()
     if (debug) println(s"LNB: reading $count attributes")
-    if (c contains "SourceFile") {
+    if (c.contains("SourceFile")) {
       val s = c("SourceFile")
       val attributes =
         for (_ <- 1 to count) yield {
diff --git 
a/bench-jmh/src/main/scala/org/apache/pekko/stream/GraphStageConstructionBenchmark.scala
 
b/bench-jmh/src/main/scala/org/apache/pekko/stream/GraphStageConstructionBenchmark.scala
index fb2aa9a963..efa220f296 100644
--- 
a/bench-jmh/src/main/scala/org/apache/pekko/stream/GraphStageConstructionBenchmark.scala
+++ 
b/bench-jmh/src/main/scala/org/apache/pekko/stream/GraphStageConstructionBenchmark.scala
@@ -22,6 +22,14 @@ import java.util.concurrent.TimeUnit
 import scala.collection.immutable
 import scala.concurrent.Promise
 
+import org.openjdk.jmh.annotations.Benchmark
+import org.openjdk.jmh.annotations.BenchmarkMode
+import org.openjdk.jmh.annotations.Mode
+import org.openjdk.jmh.annotations.OutputTimeUnit
+import org.openjdk.jmh.annotations.Scope
+import org.openjdk.jmh.annotations.State
+import org.openjdk.jmh.infra.Blackhole
+
 import org.apache.pekko.NotUsed
 import org.apache.pekko.stream.impl.LinearTraversalBuilder
 import org.apache.pekko.stream.impl.Stages.DefaultAttributes
@@ -32,13 +40,6 @@ import org.apache.pekko.stream.scaladsl.Keep
 import org.apache.pekko.stream.scaladsl.Sink
 import org.apache.pekko.stream.scaladsl.Source
 import org.apache.pekko.stream.stage.GraphStageWithMaterializedValue
-import org.openjdk.jmh.annotations.Benchmark
-import org.openjdk.jmh.annotations.BenchmarkMode
-import org.openjdk.jmh.annotations.Mode
-import org.openjdk.jmh.annotations.OutputTimeUnit
-import org.openjdk.jmh.annotations.Scope
-import org.openjdk.jmh.annotations.State
-import org.openjdk.jmh.infra.Blackhole
 
 @State(Scope.Benchmark)
 @BenchmarkMode(Array(Mode.Throughput))
diff --git 
a/bench-jmh/src/main/scala/org/apache/pekko/stream/io/TlsBenchmark.scala 
b/bench-jmh/src/main/scala/org/apache/pekko/stream/io/TlsBenchmark.scala
index e02ee3ada9..64968581df 100644
--- a/bench-jmh/src/main/scala/org/apache/pekko/stream/io/TlsBenchmark.scala
+++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/io/TlsBenchmark.scala
@@ -25,7 +25,6 @@ import scala.concurrent.Await
 import scala.concurrent.duration._
 import scala.util.{ Success, Try }
 
-import com.typesafe.config.{ Config, ConfigFactory }
 import org.openjdk.jmh.annotations._
 
 import org.apache.pekko
@@ -37,6 +36,8 @@ import pekko.stream.impl.io.{ TlsGraphStage, TlsModule }
 import pekko.stream.scaladsl._
 import pekko.util.ByteString
 
+import com.typesafe.config.{ Config, ConfigFactory }
+
 /**
  * JMH benchmark comparing the legacy actor-based TLS path (`TlsModule`) to the
  * GraphStage path (`TlsGraphStage`).
diff --git 
a/bench-jmh/src/main/scala/org/apache/pekko/util/ByteStringParser_readNum_Benchmark.scala
 
b/bench-jmh/src/main/scala/org/apache/pekko/util/ByteStringParser_readNum_Benchmark.scala
index a018c10980..6df3f7a1e8 100644
--- 
a/bench-jmh/src/main/scala/org/apache/pekko/util/ByteStringParser_readNum_Benchmark.scala
+++ 
b/bench-jmh/src/main/scala/org/apache/pekko/util/ByteStringParser_readNum_Benchmark.scala
@@ -19,11 +19,11 @@ package org.apache.pekko.util
 
 import java.util.concurrent.TimeUnit
 
+import org.openjdk.jmh.annotations._
+
 import org.apache.pekko
 import pekko.stream.impl.io.ByteStringParser
 
-import org.openjdk.jmh.annotations._
-
 @State(Scope.Benchmark)
 @Measurement(timeUnit = TimeUnit.MILLISECONDS)
 class ByteStringParser_readNum_Benchmark {
diff --git 
a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala
 
b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala
index e7e48ed9ce..32f63beb80 100644
--- 
a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala
+++ 
b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala
@@ -14,8 +14,8 @@
 package org.apache.pekko.cluster.sharding.typed.javadsl
 
 import java.util.Optional
-import java.util.function.IntFunction
 import java.util.function.{ Function => JFunction }
+import java.util.function.IntFunction
 
 import org.apache.pekko
 import pekko.actor.typed.ActorRef
diff --git 
a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessIdSpec.scala
 
b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessIdSpec.scala
index f7f4d1fdd6..bedfc26840 100644
--- 
a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessIdSpec.scala
+++ 
b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessIdSpec.scala
@@ -14,6 +14,7 @@
 package org.apache.pekko.cluster.sharding.typed.internal
 
 import 
org.apache.pekko.cluster.sharding.typed.internal.ShardedDaemonProcessId.DecodedId
+
 import org.scalatest.matchers.should.Matchers
 import org.scalatest.wordspec.AnyWordSpecLike
 
diff --git 
a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala
 
b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala
index 05e04e5799..86dd77d8c5 100644
--- 
a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala
+++ 
b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala
@@ -638,7 +638,10 @@ private[pekko] class ShardRegion(
   // sort by age, oldest first
   val ageOrdering = Member.ageOrdering
   // membersByAge is only used for tracking where coordinator is running
-  var membersByAge: immutable.SortedSet[Member] = 
immutable.SortedSet.empty(ageOrdering)
+  var membersByAge: immutable.SortedSet[Member] = {
+    implicit val ord: Ordering[Member] = ageOrdering
+    immutable.SortedSet.empty[Member]
+  }
   // membersByAge contains members with these status
   private val memberStatusOfInterest: Set[MemberStatus] =
     Set(MemberStatus.Up, MemberStatus.Leaving, MemberStatus.Exiting)
@@ -772,9 +775,10 @@ private[pekko] class ShardRegion(
   }
 
   def receiveClusterState(state: CurrentClusterState): Unit = {
+    implicit val ord: Ordering[Member] = ageOrdering
     changeMembers(
       immutable.SortedSet
-        .empty(ageOrdering)
+        .empty[Member]
         .union(state.members.filter(m => memberStatusOfInterest(m.status) && 
matchingCoordinatorRole(m))))
   }
 
diff --git 
a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingCoordinatorRoleSpec.scala
 
b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingCoordinatorRoleSpec.scala
index d1bb7c545b..e4fd8737ac 100644
--- 
a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingCoordinatorRoleSpec.scala
+++ 
b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingCoordinatorRoleSpec.scala
@@ -15,9 +15,6 @@ package org.apache.pekko.cluster.sharding
 
 import scala.concurrent.duration._
 
-import com.typesafe.config.Config
-import com.typesafe.config.ConfigFactory
-
 import org.apache.pekko
 import pekko.actor.ActorRef
 import pekko.actor.PoisonPill
@@ -25,6 +22,9 @@ import pekko.actor.Props
 import pekko.cluster.sharding.MultiNodeClusterShardingSpec.EntityActor
 import pekko.testkit._
 
+import com.typesafe.config.Config
+import com.typesafe.config.ConfigFactory
+
 class ClusterShardingCoordinatorRoleSpecConfig(
     mode: String,
     rememberEntities: Boolean,
diff --git 
a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesAndStartEntitySpec.scala
 
b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesAndStartEntitySpec.scala
index 330961469d..431537c964 100644
--- 
a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesAndStartEntitySpec.scala
+++ 
b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesAndStartEntitySpec.scala
@@ -13,6 +13,8 @@
 
 package org.apache.pekko.cluster.sharding
 
+import scala.concurrent.duration._
+
 import org.apache.pekko
 import pekko.actor.Actor
 import pekko.actor.ActorRef
@@ -30,7 +32,6 @@ import pekko.testkit.WithLogCapturing
 
 import org.scalatest.wordspec.AnyWordSpecLike
 
-import scala.concurrent.duration._
 import com.typesafe.config.ConfigFactory
 
 object RememberEntitiesAndStartEntitySpec {
diff --git 
a/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala
 
b/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala
index 0fca6107e3..6727f883aa 100644
--- 
a/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala
+++ 
b/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala
@@ -297,7 +297,10 @@ object ClusterSingletonManager {
       val cluster = Cluster(context.system)
       // sort by age, oldest first
       val ageOrdering = Member.ageOrdering
-      var membersByAge: immutable.SortedSet[Member] = 
immutable.SortedSet.empty(ageOrdering)
+      var membersByAge: immutable.SortedSet[Member] = {
+        implicit val ord: Ordering[Member] = ageOrdering
+        immutable.SortedSet.empty[Member]
+      }
 
       var changes = Vector.empty[AnyRef]
 
@@ -337,8 +340,9 @@ object ClusterSingletonManager {
 
       def handleInitial(state: CurrentClusterState): Unit = {
         // all members except Joining and WeaklyUp
+        implicit val ord: Ordering[Member] = ageOrdering
         membersByAge = immutable.SortedSet
-          .empty(ageOrdering)
+          .empty[Member]
           .union(state.members.filter(m => m.upNumber != Int.MaxValue && 
matchingRole(m)))
 
         // If there is some removal in progress of an older node it's not safe 
to immediately become oldest,
diff --git 
a/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala
 
b/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala
index d1d2607395..ba001c38a4 100644
--- 
a/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala
+++ 
b/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala
@@ -182,7 +182,10 @@ final class ClusterSingletonProxy(singletonManagerPath: 
String, settings: Cluste
   var singleton: Option[ActorRef] = None
   // sort by age, oldest first
   val ageOrdering = Member.ageOrdering
-  var membersByAge: immutable.SortedSet[Member] = 
immutable.SortedSet.empty(ageOrdering)
+  var membersByAge: immutable.SortedSet[Member] = {
+    implicit val ord: Ordering[Member] = ageOrdering
+    immutable.SortedSet.empty[Member]
+  }
 
   var buffer: MessageBuffer = MessageBuffer.empty
 
@@ -212,8 +215,9 @@ final class ClusterSingletonProxy(singletonManagerPath: 
String, settings: Cluste
 
   def handleInitial(state: CurrentClusterState): Unit = {
     trackChange { () =>
+      implicit val ord: Ordering[Member] = ageOrdering
       membersByAge = immutable.SortedSet
-        .empty(ageOrdering)
+        .empty[Member]
         .union(state.members.collect {
           case m if m.status == MemberStatus.Up && matchingRole(m) => m
         })
diff --git 
a/cluster-typed/src/main/scala-3/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistProtocol.scala
 
b/cluster-typed/src/main/scala-3/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistProtocol.scala
index de934f487e..5fda7dbf49 100644
--- 
a/cluster-typed/src/main/scala-3/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistProtocol.scala
+++ 
b/cluster-typed/src/main/scala-3/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistProtocol.scala
@@ -25,7 +25,7 @@ import pekko.annotation.InternalApi
 private[receptionist] object ClusterReceptionistProtocol {
   type Aux[P] = AbstractServiceKey { type Protocol = P }
 
-  type SubscriptionsKV[K <: Aux[_]] = K match {
+  type SubscriptionsKV[K <: Aux[?]] = K match {
     case Aux[t] => ActorRef[ReceptionistMessages.Listing[t]]
   }
 }
diff --git 
a/cluster/src/main/scala/org/apache/pekko/cluster/CrossDcClusterHeartbeat.scala 
b/cluster/src/main/scala/org/apache/pekko/cluster/CrossDcClusterHeartbeat.scala
index 2d6ba5a23a..fde60828f0 100644
--- 
a/cluster/src/main/scala/org/apache/pekko/cluster/CrossDcClusterHeartbeat.scala
+++ 
b/cluster/src/main/scala/org/apache/pekko/cluster/CrossDcClusterHeartbeat.scala
@@ -333,7 +333,10 @@ private[cluster] final case class CrossDcHeartbeatingState(
 private[cluster] object CrossDcHeartbeatingState {
 
   /** Sorted by age */
-  private def emptyMembersSortedSet: immutable.SortedSet[Member] = 
immutable.SortedSet.empty[Member](Member.ageOrdering)
+  private def emptyMembersSortedSet: immutable.SortedSet[Member] = {
+    implicit val ord: Ordering[Member] = Member.ageOrdering
+    immutable.SortedSet.empty[Member]
+  }
 
   // Since we need ordering of oldests guaranteed, we must only look at Up (or 
Leaving, Exiting...) nodes
   def atLeastInUpState(m: Member): Boolean =
@@ -356,7 +359,8 @@ private[cluster] object CrossDcHeartbeatingState {
           // we need to enforce the ageOrdering for the SortedSet in each DC
           groupedByDc.map {
             case (dc, ms) =>
-              dc -> 
immutable.SortedSet.empty[Member](Member.ageOrdering).union(ms)
+              implicit val ord: Ordering[Member] = Member.ageOrdering
+              dc -> immutable.SortedSet.empty[Member].union(ms)
           }
         }
       })
diff --git 
a/cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala 
b/cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala
index 2a56bbeb3d..02662adf0d 100644
--- a/cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala
+++ b/cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala
@@ -128,6 +128,7 @@ import pekko.cluster.MemberStatus._
    * @return Up to `crossDcConnections` oldest members for each DC
    */
   lazy val ageSortedTopOldestMembersPerDc: Map[DataCenter, 
immutable.SortedSet[Member]] = {
+    implicit val ord: Ordering[Member] = Member.ageOrdering
     latestGossip.members.foldLeft(Map.empty[DataCenter, 
immutable.SortedSet[Member]]) { (acc, member) =>
       acc.get(member.dataCenter) match {
         case Some(set) =>
@@ -141,7 +142,7 @@ import pekko.cluster.MemberStatus._
             }
           }
         case None =>
-          acc + (member.dataCenter -> 
(immutable.SortedSet.empty(Member.ageOrdering) + member))
+          acc + (member.dataCenter -> (immutable.SortedSet.empty[Member] + 
member))
       }
     }
   }
diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/Reachability.scala 
b/cluster/src/main/scala/org/apache/pekko/cluster/Reachability.scala
index 3df1f913f9..c2816da4f9 100644
--- a/cluster/src/main/scala/org/apache/pekko/cluster/Reachability.scala
+++ b/cluster/src/main/scala/org/apache/pekko/cluster/Reachability.scala
@@ -28,8 +28,8 @@ private[cluster] object Reachability {
     new Reachability(records, versions)
 
   def create(records: immutable.Seq[Record], versions: Map[UniqueAddress, 
Long]): Reachability = records match {
-    case r: immutable.IndexedSeq[Record] => apply(r, versions)
-    case _                               => apply(records.toVector, versions)
+    case r: (immutable.IndexedSeq[Record] @unchecked) => apply(r, versions)
+    case _                                            => 
apply(records.toVector, versions)
   }
 
   @SerialVersionUID(1L)
diff --git 
a/cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.scala 
b/cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.scala
index ccc209d5e2..8f781cb27e 100644
--- a/cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.scala
+++ b/cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.scala
@@ -85,7 +85,10 @@ import pekko.coordination.lease.scaladsl.Lease
   protected def ordering: Ordering[Member] = Member.ordering
 
   // all members in self DC, both joining and up.
-  private var _allMembers: immutable.SortedSet[Member] = 
immutable.SortedSet.empty(ordering)
+  private var _allMembers: immutable.SortedSet[Member] = {
+    implicit val ord: Ordering[Member] = ordering
+    immutable.SortedSet.empty[Member]
+  }
 
   def role: Option[String]
 
diff --git 
a/discovery/src/main/scala/org/apache/pekko/discovery/ServiceDiscovery.scala 
b/discovery/src/main/scala/org/apache/pekko/discovery/ServiceDiscovery.scala
index 9f372b67c4..a6eeda8830 100644
--- a/discovery/src/main/scala/org/apache/pekko/discovery/ServiceDiscovery.scala
+++ b/discovery/src/main/scala/org/apache/pekko/discovery/ServiceDiscovery.scala
@@ -21,9 +21,10 @@ import java.util.concurrent.TimeUnit
 import scala.collection.immutable
 import scala.concurrent.Future
 import scala.concurrent.duration.FiniteDuration
-import scala.jdk.OptionConverters._
 import scala.jdk.DurationConverters._
 import scala.jdk.FutureConverters._
+import scala.jdk.OptionConverters._
+
 import org.apache.pekko
 import pekko.actor.{ DeadLetterSuppression, NoSerializationVerificationNeeded }
 import pekko.util.HashCode
diff --git 
a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala
 
b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala
index 37f622c2ce..35393c4cb7 100644
--- 
a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala
+++ 
b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala
@@ -1374,7 +1374,10 @@ final class Replicator(settings: ReplicatorSettings) 
extends Actor with ActorLog
 
   // cluster members sorted by age, oldest first,, doesn't contain 
selfAddress, doesn't contain joining and weaklyUp
   // only used when prefer-oldest is enabled
-  var membersByAge: immutable.SortedSet[Member] = 
immutable.SortedSet.empty(Member.ageOrdering)
+  var membersByAge: immutable.SortedSet[Member] = {
+    implicit val ord: Ordering[Member] = Member.ageOrdering
+    immutable.SortedSet.empty[Member]
+  }
 
   // cluster weaklyUp nodes, doesn't contain selfAddress
   var weaklyUpNodes: immutable.SortedSet[UniqueAddress] = 
immutable.SortedSet.empty
@@ -1393,7 +1396,10 @@ final class Replicator(settings: ReplicatorSettings) 
extends Actor with ActorLog
 
   var removedNodes: Map[UniqueAddress, Long] = Map.empty
   // all nodes sorted with the leader first
-  var leader: TreeSet[Member] = TreeSet.empty(Member.leaderStatusOrdering)
+  var leader: TreeSet[Member] = {
+    implicit val ord: Ordering[Member] = Member.leaderStatusOrdering
+    TreeSet.empty[Member]
+  }
   def isLeader: Boolean =
     leader.nonEmpty && leader.head.address == selfAddress && 
leader.head.status == MemberStatus.Up
 
diff --git 
a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/WildcardSubscribeSpec.scala
 
b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/WildcardSubscribeSpec.scala
index 82caf3c216..a5c115f52f 100644
--- 
a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/WildcardSubscribeSpec.scala
+++ 
b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/WildcardSubscribeSpec.scala
@@ -15,14 +15,14 @@ package org.apache.pekko.cluster.ddata
 
 import scala.concurrent.duration._
 
-import com.typesafe.config.ConfigFactory
-
 import org.apache.pekko.cluster.Cluster
 import org.apache.pekko.remote.testconductor.RoleName
 import org.apache.pekko.remote.testkit.MultiNodeConfig
 import org.apache.pekko.remote.testkit.MultiNodeSpec
 import org.apache.pekko.testkit._
 
+import com.typesafe.config.ConfigFactory
+
 object WildcardSubscribeSpec extends MultiNodeConfig {
   val first = role("first")
   val second = role("second")
@@ -45,8 +45,8 @@ class WildcardSubscribeSpecMultiJvmNode1 extends 
WildcardSubscribeSpec
 class WildcardSubscribeSpecMultiJvmNode2 extends WildcardSubscribeSpec
 
 class WildcardSubscribeSpec extends MultiNodeSpec(WildcardSubscribeSpec) with 
STMultiNodeSpec with ImplicitSender {
-  import WildcardSubscribeSpec._
   import Replicator._
+  import WildcardSubscribeSpec._
 
   override def initialParticipants: Int = roles.size
 
diff --git a/docs/src/main/paradox/stream/operators/index.md 
b/docs/src/main/paradox/stream/operators/index.md
index f39c251bb8..011a1e1cf7 100644
--- a/docs/src/main/paradox/stream/operators/index.md
+++ b/docs/src/main/paradox/stream/operators/index.md
@@ -121,7 +121,7 @@ For example, following snippet will fall with timeout 
exception:
 |StreamConverters|<a 
name="frominputstream"></a>@ref[fromInputStream](StreamConverters/fromInputStream.md)|Create
 a source that wraps an `InputStream`.|
 |StreamConverters|<a 
name="fromjavastream"></a>@ref[fromJavaStream](StreamConverters/fromJavaStream.md)|Create
 a source that wraps a Java 8 `java.util.stream.Stream`.|
 |StreamConverters|<a 
name="fromoutputstream"></a>@ref[fromOutputStream](StreamConverters/fromOutputStream.md)|Create
 a sink that wraps an `OutputStream`.|
-|StreamConverters|<a 
name="javacollector"></a>@ref[javaCollector](StreamConverters/javaCollector.md)|Create
 a sink which materializes into a @scala[`Future`] @java[`CompletionStage`] 
which will be completed with a result of the Java 8 `Collector` transformation 
and reduction operations.|
+|StreamConverters|<a 
name="javacollector"></a>@ref[javaCollector](StreamConverters/javaCollector.md)|Create
 a sink which materializes into a @scala[`Future`] @java[`CompletionStage`] 
which will be completed with a result of the Java `Collector` transformation 
and reduction operations.|
 |StreamConverters|<a 
name="javacollectorparallelunordered"></a>@ref[javaCollectorParallelUnordered](StreamConverters/javaCollectorParallelUnordered.md)|Create
 a sink which materializes into a @scala[`Future`] @java[`CompletionStage`] 
which will be completed with a result of the Java 8 `Collector` transformation 
and reduction operations.|
 
 ## File IO Sinks and Sources
diff --git 
a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testkit/MultiNodeSpec.scala
 
b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testkit/MultiNodeSpec.scala
index a9dd7f0e6d..cb14584c5e 100644
--- 
a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testkit/MultiNodeSpec.scala
+++ 
b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testkit/MultiNodeSpec.scala
@@ -342,7 +342,7 @@ abstract class MultiNodeSpec(
           }
       })
 
-  val log: LoggingAdapter = Logging(system, this)(_.getClass.getName)
+  val log: LoggingAdapter = Logging(system, classOf[MultiNodeSpec])
 
   /**
    * Enrich `.await()` onto all Awaitables, using remaining duration from the 
innermost
diff --git 
a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/EventEnvelope.scala
 
b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/EventEnvelope.scala
index db828201de..6cbb7e5335 100644
--- 
a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/EventEnvelope.scala
+++ 
b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/EventEnvelope.scala
@@ -13,8 +13,8 @@
 
 package org.apache.pekko.persistence.query.typed
 
-import java.util.Optional
 import java.util.{ Set => JSet }
+import java.util.Optional
 
 import org.apache.pekko
 import pekko.annotation.ApiMayChange
diff --git 
a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/SnapshotStorage.scala
 
b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/SnapshotStorage.scala
index 438a9df687..6258688da5 100644
--- 
a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/SnapshotStorage.scala
+++ 
b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/SnapshotStorage.scala
@@ -13,8 +13,6 @@
 
 package org.apache.pekko.persistence.testkit
 
-import scala.util.Success
-
 import org.apache.pekko
 import pekko.actor.Extension
 import pekko.annotation.InternalApi
@@ -42,7 +40,6 @@ private[testkit] trait SnapshotStorage
       WriteSnapshot(SnapshotMeta(meta.sequenceNr, meta.timestamp), payload)) 
match {
       case ProcessingSuccess =>
         add(meta.persistenceId, (meta, payload))
-        Success(())
       case f: ProcessingFailure => throw f.error
 
     }
diff --git 
a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceProbeBehavior.scala
 
b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceProbeBehavior.scala
index 1d5898d8ee..b459142cb9 100644
--- 
a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceProbeBehavior.scala
+++ 
b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceProbeBehavior.scala
@@ -17,12 +17,13 @@ import java.util.{ List, Set }
 
 import scala.collection.immutable.{ Set => ScalaSet }
 
+import org.jspecify.annotations.Nullable
+
 import org.apache.pekko
 import pekko.actor.testkit.typed.javadsl.BehaviorTestKit
 import pekko.actor.typed.Behavior
 import pekko.annotation.DoNotInherit
 import pekko.persistence.testkit.internal.PersistenceProbeImpl
-import org.jspecify.annotations.Nullable
 
 /**
  * Factory methods to create PersistenceProbeBehavior instances for testing.
diff --git 
a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala
 
b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala
index 4d7d6e8e70..cfd08ebf98 100644
--- 
a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala
+++ 
b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala
@@ -14,6 +14,7 @@
 package org.apache.pekko.persistence.testkit.query.scaladsl
 import java.time.Instant
 import java.time.temporal.ChronoUnit
+
 import scala.annotation.nowarn
 import scala.collection.immutable
 
diff --git 
a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRetentionOnlyOneSnapshotSpec.scala
 
b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRetentionOnlyOneSnapshotSpec.scala
index 7d3bd63743..c814e48383 100644
--- 
a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRetentionOnlyOneSnapshotSpec.scala
+++ 
b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRetentionOnlyOneSnapshotSpec.scala
@@ -18,9 +18,6 @@ import java.util.concurrent.atomic.AtomicInteger
 import scala.util.Success
 import scala.util.Try
 
-import com.typesafe.config.ConfigFactory
-import org.scalatest.wordspec.AnyWordSpecLike
-
 import org.apache.pekko
 import pekko.actor.testkit.typed.scaladsl._
 import pekko.actor.typed.scaladsl.Behaviors
@@ -30,6 +27,10 @@ import pekko.persistence.typed.DeleteEventsCompleted
 import pekko.persistence.typed.EventSourcedSignal
 import pekko.persistence.typed.PersistenceId
 
+import org.scalatest.wordspec.AnyWordSpecLike
+
+import com.typesafe.config.ConfigFactory
+
 object EventSourcedBehaviorRetentionOnlyOneSnapshotSpec {
   private val config = ConfigFactory.parseString(s"""
     ${PersistenceTestKitSnapshotPlugin.PluginId} {
diff --git 
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala
 
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala
index a653d24278..3e4d61b9b3 100644
--- 
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala
+++ 
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala
@@ -19,6 +19,8 @@ import java.util.Optional
 import scala.annotation.nowarn
 import scala.jdk.OptionConverters._
 
+import org.jspecify.annotations.Nullable
+
 import org.apache.pekko
 import pekko.actor.typed
 import pekko.actor.typed.BackoffSupervisorStrategy
@@ -31,7 +33,6 @@ import pekko.persistence.typed.EventAdapter
 import pekko.persistence.typed.internal._
 
 import com.typesafe.config.Config
-import org.jspecify.annotations.Nullable
 
 abstract class EventSourcedBehavior[Command, Event, State] private[pekko] (
     val persistenceId: PersistenceId,
diff --git 
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/DurableStateBehavior.scala
 
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/DurableStateBehavior.scala
index 4af86d9582..b94ae19259 100644
--- 
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/DurableStateBehavior.scala
+++ 
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/DurableStateBehavior.scala
@@ -15,6 +15,8 @@ package org.apache.pekko.persistence.typed.state.javadsl
 
 import java.util.Optional
 
+import org.jspecify.annotations.Nullable
+
 import org.apache.pekko
 import pekko.actor.typed
 import pekko.actor.typed.BackoffSupervisorStrategy
@@ -32,7 +34,6 @@ import pekko.persistence.typed.state.scaladsl
 import scala.jdk.OptionConverters._
 
 import com.typesafe.config.Config
-import org.jspecify.annotations.Nullable
 
 /**
  * A `Behavior` for a persistent actor with durable storage of its state.
diff --git 
a/persistence/src/test/scala/org/apache/pekko/persistence/journal/AsyncWriteJournalResponseOrderSpec.scala
 
b/persistence/src/test/scala/org/apache/pekko/persistence/journal/AsyncWriteJournalResponseOrderSpec.scala
index 3f3537c0ee..1b8097e003 100644
--- 
a/persistence/src/test/scala/org/apache/pekko/persistence/journal/AsyncWriteJournalResponseOrderSpec.scala
+++ 
b/persistence/src/test/scala/org/apache/pekko/persistence/journal/AsyncWriteJournalResponseOrderSpec.scala
@@ -17,12 +17,12 @@
 
 package org.apache.pekko.persistence.journal
 
-import 
org.apache.pekko.persistence.journal.AsyncWriteJournalResponseOrderSpec._
-
 import scala.collection.{ immutable, mutable }
 import scala.concurrent.{ ExecutionContext, Future, Promise }
 import scala.util.Try
+
 import org.apache.pekko.persistence.{ AtomicWrite, JournalProtocol, 
PersistenceSpec, PersistentRepr }
+import 
org.apache.pekko.persistence.journal.AsyncWriteJournalResponseOrderSpec._
 import org.apache.pekko.testkit.ImplicitSender
 
 /**
diff --git 
a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProviderSpec.scala
 
b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProviderSpec.scala
index 2cda6257f6..670e0a3391 100644
--- 
a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProviderSpec.scala
+++ 
b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProviderSpec.scala
@@ -45,9 +45,10 @@ import pekko.testkit.TestActors
 import pekko.testkit.TestProbe
 import pekko.util.JavaVersion
 
-import com.typesafe.config.ConfigFactory
 import org.scalatest.Outcome
 
+import com.typesafe.config.ConfigFactory
+
 // This is a simplification Spec. It doesn't rely on changing files.
 class RotatingProviderWithStaticKeysSpec
     extends 
RotatingKeysSSLEngineProviderSpec(RotatingKeysSSLEngineProviderSpec.resourcesConfig)
 {
diff --git 
a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/FanoutPublisherBehaviorSpec.scala
 
b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/FanoutPublisherBehaviorSpec.scala
index 884db05a05..94357b9cf0 100644
--- 
a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/FanoutPublisherBehaviorSpec.scala
+++ 
b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/FanoutPublisherBehaviorSpec.scala
@@ -21,7 +21,6 @@ import scala.concurrent.Await
 import scala.concurrent.duration._
 
 import org.apache.pekko
-import pekko.testkit.EventFilter
 import pekko.stream.{
   AbruptStageTerminationException,
   ActorAttributes,
@@ -32,11 +31,12 @@ import pekko.stream.{
 import pekko.stream.scaladsl.Keep
 import pekko.stream.scaladsl.Sink
 import pekko.stream.scaladsl.Source
-import pekko.stream.testkit.TestPublisher
 import pekko.stream.testkit.StreamSpec
+import pekko.stream.testkit.TestPublisher
 import pekko.stream.testkit.TestSubscriber
-import pekko.stream.testkit.scaladsl.TestSink
 import pekko.stream.testkit.Utils.TE
+import pekko.stream.testkit.scaladsl.TestSink
+import pekko.testkit.EventFilter
 
 class FanoutPublisherBehaviorSpec extends StreamSpec {
 
diff --git 
a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/FixedBufferSpec.scala
 
b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/FixedBufferSpec.scala
index 25f5437fdb..a3d27efaf6 100644
--- 
a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/FixedBufferSpec.scala
+++ 
b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/FixedBufferSpec.scala
@@ -113,8 +113,8 @@ class FixedBufferSpec extends StreamSpec {
 
         try {
           val cheat = buf.asInstanceOf[{ def readIdx_=(l: Long): Unit; def 
writeIdx_=(l: Long): Unit }]
-          cheat.readIdx_=(Int.MaxValue)
-          cheat.writeIdx_=(Int.MaxValue)
+          val _: Unit = cheat.readIdx_=(Int.MaxValue)
+          val _: Unit = cheat.writeIdx_=(Int.MaxValue)
 
           for (_ <- 1 to 10) {
             buf.isEmpty should be(true)
diff --git 
a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala
 
b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala
index 3557352d94..9bff87c4ac 100644
--- 
a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala
+++ 
b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala
@@ -18,10 +18,10 @@ import scala.concurrent.Promise
 import org.apache.pekko
 import pekko.NotUsed
 import pekko.stream._
-import pekko.stream.impl.TraversalTestUtils._
 import pekko.stream.impl.Stages.DefaultAttributes
-import pekko.stream.impl.fusing.GraphStages.{ FutureSource, RepeatSource, 
SingleSource }
+import pekko.stream.impl.TraversalTestUtils._
 import pekko.stream.impl.fusing.{ IterableSource, IteratorSource, RangeSource }
+import pekko.stream.impl.fusing.GraphStages.{ FutureSource, RepeatSource, 
SingleSource }
 import pekko.stream.scaladsl.{ Keep, Source }
 import pekko.testkit.PekkoSpec
 import pekko.util.OptionVal
diff --git 
a/stream-tests/src/test/scala/org/apache/pekko/stream/io/FileSinkSpec.scala 
b/stream-tests/src/test/scala/org/apache/pekko/stream/io/FileSinkSpec.scala
index 30e208af68..e3cfc92524 100644
--- a/stream-tests/src/test/scala/org/apache/pekko/stream/io/FileSinkSpec.scala
+++ b/stream-tests/src/test/scala/org/apache/pekko/stream/io/FileSinkSpec.scala
@@ -26,13 +26,13 @@ import com.google.common.jimfs.{ Configuration, Jimfs }
 
 import org.apache.pekko
 import pekko.stream._
+import pekko.stream.SystemMaterializer
 import pekko.stream.impl.{ PhasedFusingActorMaterializer, StreamSupervisor }
 import pekko.stream.impl.StreamSupervisor.Children
 import pekko.stream.scaladsl.{ FileIO, Keep, Source }
 import pekko.stream.testkit._
 import pekko.stream.testkit.Utils._
 import pekko.util.ByteString
-import pekko.stream.SystemMaterializer
 
 import org.scalatest.concurrent.ScalaFutures
 
diff --git 
a/stream-tests/src/test/scala/org/apache/pekko/stream/io/FileSourceSpec.scala 
b/stream-tests/src/test/scala/org/apache/pekko/stream/io/FileSourceSpec.scala
index 8f6a417568..e5d94c37ca 100644
--- 
a/stream-tests/src/test/scala/org/apache/pekko/stream/io/FileSourceSpec.scala
+++ 
b/stream-tests/src/test/scala/org/apache/pekko/stream/io/FileSourceSpec.scala
@@ -26,6 +26,7 @@ import com.google.common.jimfs.{ Configuration, Jimfs }
 import org.apache.pekko
 import pekko.stream._
 import pekko.stream.IOResult._
+import pekko.stream.SystemMaterializer
 import pekko.stream.impl.{ PhasedFusingActorMaterializer, StreamSupervisor }
 import pekko.stream.impl.StreamSupervisor.Children
 import pekko.stream.io.FileSourceSpec.Settings
@@ -34,7 +35,6 @@ import pekko.stream.testkit._
 import pekko.stream.testkit.Utils._
 import pekko.stream.testkit.scaladsl.TestSink
 import pekko.util.ByteString
-import pekko.stream.SystemMaterializer
 
 object FileSourceSpec {
   final case class Settings(chunkSize: Int, readAhead: Int)
diff --git 
a/stream-tests/src/test/scala/org/apache/pekko/stream/io/TlsGraphStageEdgeCasesSpec.scala
 
b/stream-tests/src/test/scala/org/apache/pekko/stream/io/TlsGraphStageEdgeCasesSpec.scala
index 718867a9b8..5f6f471179 100644
--- 
a/stream-tests/src/test/scala/org/apache/pekko/stream/io/TlsGraphStageEdgeCasesSpec.scala
+++ 
b/stream-tests/src/test/scala/org/apache/pekko/stream/io/TlsGraphStageEdgeCasesSpec.scala
@@ -17,16 +17,13 @@
 
 package org.apache.pekko.stream.io
 
-import javax.net.ssl.{ SSLContext, SSLEngine, SSLSession }
-
 import java.util.concurrent.atomic.AtomicInteger
+import javax.net.ssl.{ SSLContext, SSLEngine, SSLSession }
 
 import scala.concurrent.Await
 import scala.concurrent.duration._
 import scala.util.{ Success, Try }
 
-import com.typesafe.config.ConfigFactory
-
 import org.apache.pekko
 import pekko.NotUsed
 import pekko.stream._
@@ -37,6 +34,8 @@ import pekko.stream.testkit.StreamSpec
 import pekko.testkit.TestDuration
 import pekko.util.ByteString
 
+import com.typesafe.config.ConfigFactory
+
 /**
  * Edge cases for the [[TlsGraphStage]] path that are awkward to express in the
  * shared [[TlsGraphStageSpec]] matrix: fragmented TLS records, user-side
diff --git 
a/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/DeflateAutoFlushSpec.scala
 
b/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/DeflateAutoFlushSpec.scala
index 284aaa3ae1..e7f2c0c8c0 100644
--- 
a/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/DeflateAutoFlushSpec.scala
+++ 
b/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/DeflateAutoFlushSpec.scala
@@ -17,11 +17,11 @@
 
 package org.apache.pekko.stream.io.compression
 
+import java.util.zip.Deflater
+
 import org.apache.pekko.stream.scaladsl.{ Compression, Flow }
 import org.apache.pekko.util.ByteString
 
-import java.util.zip.Deflater
-
 class DeflateAutoFlushSpec extends DeflateSpec {
   override protected val encoderFlow: Flow[ByteString, ByteString, Any] =
     Compression.deflate(Deflater.BEST_COMPRESSION, nowrap = false, autoFlush = 
false)
diff --git 
a/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/GzipAutoFlushSpec.scala
 
b/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/GzipAutoFlushSpec.scala
index 031c19428b..d0e83e1fc5 100644
--- 
a/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/GzipAutoFlushSpec.scala
+++ 
b/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/GzipAutoFlushSpec.scala
@@ -17,11 +17,11 @@
 
 package org.apache.pekko.stream.io.compression
 
+import java.util.zip.Deflater
+
 import org.apache.pekko.stream.scaladsl.{ Compression, Flow }
 import org.apache.pekko.util.ByteString
 
-import java.util.zip.Deflater
-
 class GzipAutoFlushSpec extends GzipSpec {
   override protected val encoderFlow: Flow[ByteString, ByteString, Any] =
     Compression.gzip(Deflater.BEST_COMPRESSION, autoFlush = false)
diff --git 
a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SinkSpec.scala 
b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SinkSpec.scala
index 87ea68ce86..11689a3ac7 100644
--- 
a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SinkSpec.scala
+++ 
b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SinkSpec.scala
@@ -14,6 +14,7 @@
 package org.apache.pekko.stream.scaladsl
 
 import scala.annotation.nowarn
+import scala.collection.immutable
 import scala.concurrent.{ Await, Future }
 import scala.concurrent.duration._
 
@@ -25,8 +26,6 @@ import pekko.stream.testkit._
 import pekko.stream.testkit.scaladsl.{ TestSink, TestSource }
 import pekko.testkit.DefaultTimeout
 
-import scala.collection.immutable
-
 import org.reactivestreams.Publisher
 
 import org.scalatest.concurrent.ScalaFutures
diff --git 
a/stream/src/main/scala/org/apache/pekko/stream/impl/FanoutPublisherBridgeStage.scala
 
b/stream/src/main/scala/org/apache/pekko/stream/impl/FanoutPublisherBridgeStage.scala
index e0391d9008..cce6a22e8f 100644
--- 
a/stream/src/main/scala/org/apache/pekko/stream/impl/FanoutPublisherBridgeStage.scala
+++ 
b/stream/src/main/scala/org/apache/pekko/stream/impl/FanoutPublisherBridgeStage.scala
@@ -25,10 +25,10 @@ import scala.util.control.NoStackTrace
 
 import org.apache.pekko
 import pekko.annotation.InternalApi
+import pekko.stream._
 import pekko.stream.ActorAttributes.StreamSubscriptionTimeout
 import pekko.stream.Attributes.InputBuffer
 import pekko.stream.StreamSubscriptionTimeoutTerminationMode
-import pekko.stream._
 import pekko.stream.impl.Stages.DefaultAttributes
 import pekko.stream.stage.{
   AsyncCallback,
diff --git 
a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/IteratorSource.scala
 
b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/IteratorSource.scala
index 7c6baa5114..8877586c8c 100644
--- 
a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/IteratorSource.scala
+++ 
b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/IteratorSource.scala
@@ -21,8 +21,8 @@ import scala.util.control.NonFatal
 
 import org.apache.pekko
 import pekko.annotation.InternalApi
-import pekko.stream.ActorAttributes.SupervisionStrategy
 import pekko.stream.{ Attributes, Outlet, SourceShape, Supervision }
+import pekko.stream.ActorAttributes.SupervisionStrategy
 import pekko.stream.impl.fusing.GraphStages.ValuePresentedSource
 import pekko.stream.stage.{ GraphStage, GraphStageLogic, OutHandler }
 
diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala 
b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala
index 183168136c..5a889b6189 100755
--- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala
@@ -28,6 +28,8 @@ import scala.jdk.OptionConverters._
 import scala.reflect.ClassTag
 import scala.util.control.NonFatal
 
+import org.jspecify.annotations.Nullable
+
 import org.apache.pekko
 import pekko.Done
 import pekko.NotUsed
@@ -43,7 +45,6 @@ import pekko.stream.impl.fusing.{ StatefulMapConcat, 
ZipWithIndexJava }
 import pekko.util.ConstantFun
 import pekko.util.Timeout
 
-import org.jspecify.annotations.Nullable
 import org.reactivestreams.Processor
 
 object Flow {
diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Sink.scala 
b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Sink.scala
index 588518cd61..f9baca42ec 100644
--- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Sink.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Sink.scala
@@ -24,6 +24,8 @@ import scala.jdk.FutureConverters._
 import scala.jdk.OptionConverters._
 import scala.util.Try
 
+import org.jspecify.annotations.Nullable
+
 import org.apache.pekko
 import pekko._
 import pekko.actor.{ ActorRef, ClassicActorSystemProvider, Status }
@@ -34,7 +36,6 @@ import pekko.stream.impl.LinearTraversalBuilder
 import pekko.stream.scaladsl.SinkToCompletionStage
 import pekko.util.ConstantFun.scalaAnyToUnit
 
-import org.jspecify.annotations.Nullable
 import org.reactivestreams.{ Publisher, Subscriber }
 
 /** Java API */
diff --git 
a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala 
b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala
index e9f12da74b..0082bf73d5 100755
--- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala
@@ -26,6 +26,8 @@ import scala.jdk.OptionConverters._
 import scala.reflect.ClassTag
 import scala.util.control.NonFatal
 
+import org.jspecify.annotations.Nullable
+
 import org.apache.pekko
 import pekko.NotUsed
 import pekko.event.{ LogMarker, LoggingAdapter, MarkerLoggingAdapter }
@@ -35,8 +37,6 @@ import pekko.stream.impl.Stages.DefaultAttributes
 import pekko.stream.impl.fusing.{ StatefulMapConcat, ZipWithIndexJava }
 import pekko.util.ConstantFun
 
-import org.jspecify.annotations.Nullable
-
 object SubFlow {
 
   /**
diff --git 
a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala 
b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala
index cc8d6b5bb8..18ad5712bc 100755
--- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala
@@ -26,6 +26,8 @@ import scala.jdk.OptionConverters._
 import scala.reflect.ClassTag
 import scala.util.control.NonFatal
 
+import org.jspecify.annotations.Nullable
+
 import org.apache.pekko
 import pekko.NotUsed
 import pekko.event.{ LogMarker, LoggingAdapter, MarkerLoggingAdapter }
@@ -35,8 +37,6 @@ import pekko.stream.impl.Stages.DefaultAttributes
 import pekko.stream.impl.fusing.{ StatefulMapConcat, ZipWithIndexJava }
 import pekko.util.ConstantFun
 
-import org.jspecify.annotations.Nullable
-
 /**
  * * Upcast a stream of elements to a stream of supertypes of that element. 
Useful in combination with
  * fan-in operators where you do not want to pay the cost of casting each 
element in a `map`.
diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Tcp.scala 
b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Tcp.scala
index 2fe12dd0d8..70c47793bb 100644
--- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Tcp.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Tcp.scala
@@ -36,13 +36,13 @@ import pekko.actor.ExtensionId
 import pekko.actor.ExtensionIdProvider
 import pekko.annotation.InternalApi
 import pekko.io.Inet.SocketOption
+import pekko.japi.Util.immutableSeq
 import pekko.japi.function
 import pekko.stream.Materializer
 import pekko.stream.SystemMaterializer
 import pekko.stream.TLSClosing
 import pekko.stream.scaladsl
 import pekko.util.ByteString
-import pekko.japi.Util.immutableSeq
 
 object Tcp extends ExtensionId[Tcp] with ExtensionIdProvider {
 
diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/TLS.scala 
b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/TLS.scala
index 57e74f1f26..f69d8ef577 100644
--- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/TLS.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/TLS.scala
@@ -17,8 +17,6 @@ import javax.net.ssl.{ SSLContext, SSLEngine, SSLSession }
 
 import scala.util.{ Success, Try }
 
-import com.typesafe.config.{ ConfigException, ConfigFactory }
-
 import org.apache.pekko
 import pekko.NotUsed
 import pekko.stream._
@@ -26,6 +24,8 @@ import pekko.stream.TLSProtocol._
 import pekko.stream.impl.io.{ TlsGraphStage, TlsModule }
 import pekko.util.ByteString
 
+import com.typesafe.config.{ ConfigException, ConfigFactory }
+
 /**
  * Stream cipher support based upon JSSE.
  *
diff --git 
a/testkit/src/main/scala/org/apache/pekko/testkit/CallingThreadDispatcher.scala 
b/testkit/src/main/scala/org/apache/pekko/testkit/CallingThreadDispatcher.scala
index 8a34ecb0d4..49be17a601 100644
--- 
a/testkit/src/main/scala/org/apache/pekko/testkit/CallingThreadDispatcher.scala
+++ 
b/testkit/src/main/scala/org/apache/pekko/testkit/CallingThreadDispatcher.scala
@@ -362,7 +362,7 @@ class CallingThreadMailbox(_receiver: pekko.actor.Cell, val 
mailboxType: Mailbox
   }
 
   /**
-   * This is only a marker to be put in the messageQueue’s stead to make error
+   * This is only a marker to be put in the messageQueue's stead to make error
    * messages pertaining to violated mailbox type requirements less cryptic.
    */
   override val messageQueue: MessageQueue = q.get


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

Reply via email to