This is an automated email from the ASF dual-hosted git repository.
hepin 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 7fa5559394 chore: sortImports (#2425)
7fa5559394 is described below
commit 7fa55593943d754aee83fdc994c756942c04300d
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Mon Nov 3 05:22:12 2025 +0800
chore: sortImports (#2425)
---
.../src/main/scala/org/apache/pekko/util/ByteString.scala | 4 ++--
.../org/apache/pekko/stream/BroadcastHubBenchmark.scala | 13 ++++++++-----
.../pekko/util/ByteString_asInputStream_Benchmark.scala | 3 ++-
.../pekko/util/ByteString_indexOfSlice_Benchmark.scala | 2 +-
.../PersistenceTestKitDurableStateStoreSpec.scala | 1 +
.../pekko/persistence/typed/javadsl/CommandHandler.scala | 4 ++--
.../typed/javadsl/CommandHandlerWithReply.scala | 4 ++--
.../pekko/persistence/typed/javadsl/EventHandler.scala | 3 ++-
.../persistence/typed/state/javadsl/CommandHandler.scala | 4 ++--
.../typed/state/javadsl/CommandHandlerWithReply.scala | 4 ++--
.../pekko/serialization/jackson3/JacksonModule.scala | 2 +-
.../jackson3/JacksonObjectMapperProvider.scala | 5 ++++-
.../pekko/serialization/jackson3/JacksonSerializer.scala | 2 +-
.../serialization/jackson3/JacksonSerializerSpec.scala | 15 ++++++++++-----
.../org/apache/pekko/stream/impl/fusing/DoOnCancel.scala | 2 +-
.../org/apache/pekko/stream/impl/fusing/DoOnFirst.scala | 2 +-
16 files changed, 42 insertions(+), 28 deletions(-)
diff --git a/actor/src/main/scala/org/apache/pekko/util/ByteString.scala
b/actor/src/main/scala/org/apache/pekko/util/ByteString.scala
index 952e3fe060..ed647d33b4 100644
--- a/actor/src/main/scala/org/apache/pekko/util/ByteString.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/ByteString.scala
@@ -19,8 +19,6 @@ import java.nio.{ ByteBuffer, ByteOrder }
import java.nio.charset.{ Charset, StandardCharsets }
import java.util.Base64
-import org.apache.pekko.io.UnsynchronizedByteArrayInputStream
-
import scala.annotation.{ nowarn, tailrec, varargs }
import scala.collection.{ immutable, mutable }
import scala.collection.immutable.{ IndexedSeq, IndexedSeqOps,
StrictOptimizedSeqOps, VectorBuilder }
@@ -28,6 +26,8 @@ import scala.collection.mutable.{ Builder, WrappedArray }
import scala.jdk.CollectionConverters._
import scala.reflect.ClassTag
+import org.apache.pekko.io.UnsynchronizedByteArrayInputStream
+
object ByteString {
/**
diff --git
a/bench-jmh/src/main/scala/org/apache/pekko/stream/BroadcastHubBenchmark.scala
b/bench-jmh/src/main/scala/org/apache/pekko/stream/BroadcastHubBenchmark.scala
index ede811c798..c46bcf5aee 100644
---
a/bench-jmh/src/main/scala/org/apache/pekko/stream/BroadcastHubBenchmark.scala
+++
b/bench-jmh/src/main/scala/org/apache/pekko/stream/BroadcastHubBenchmark.scala
@@ -17,17 +17,20 @@
package org.apache.pekko.stream
-import com.typesafe.config.ConfigFactory
+import java.util.concurrent.{ CountDownLatch, TimeUnit }
+
+import scala.concurrent.Await
+import scala.concurrent.duration._
+
+import org.openjdk.jmh.annotations._
+
import org.apache.pekko.NotUsed
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.remote.artery.{ BenchTestSource, LatchSink }
import org.apache.pekko.stream.scaladsl._
import org.apache.pekko.stream.testkit.scaladsl.StreamTestKit
-import org.openjdk.jmh.annotations._
-import java.util.concurrent.{ CountDownLatch, TimeUnit }
-import scala.concurrent.Await
-import scala.concurrent.duration._
+import com.typesafe.config.ConfigFactory
object BroadcastHubBenchmark {
final val OperationsPerInvocation = 100000
diff --git
a/bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_asInputStream_Benchmark.scala
b/bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_asInputStream_Benchmark.scala
index 0cc29106bf..a6d9600a76 100644
---
a/bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_asInputStream_Benchmark.scala
+++
b/bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_asInputStream_Benchmark.scala
@@ -20,10 +20,11 @@ package org.apache.pekko.util
import java.io.InputStream
import java.util.concurrent.TimeUnit
-import org.apache.pekko.io.UnsynchronizedByteArrayInputStream
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra.Blackhole
+import org.apache.pekko.io.UnsynchronizedByteArrayInputStream
+
/**
* Compares ByteString.asInputStream and new
ByteStreamArray(ByteString.toArray).
*/
diff --git
a/bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_indexOfSlice_Benchmark.scala
b/bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_indexOfSlice_Benchmark.scala
index 167595f966..677a86a168 100644
---
a/bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_indexOfSlice_Benchmark.scala
+++
b/bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_indexOfSlice_Benchmark.scala
@@ -13,8 +13,8 @@
package org.apache.pekko.util
-import java.util.concurrent.TimeUnit
import java.nio.charset.StandardCharsets
+import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
diff --git
a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStoreSpec.scala
b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStoreSpec.scala
index 17eff3fe89..5598c30ea2 100644
---
a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStoreSpec.scala
+++
b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStoreSpec.scala
@@ -23,6 +23,7 @@ import pekko.stream.scaladsl.Sink
import pekko.stream.testkit.scaladsl.TestSink
import org.scalatest.wordspec.AnyWordSpecLike
+
import com.typesafe.config.ConfigFactory
object PersistenceTestKitDurableStateStoreSpec {
diff --git
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala
index 13862d9e4c..b098a2c9af 100644
---
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala
+++
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala
@@ -16,13 +16,13 @@ package org.apache.pekko.persistence.typed.javadsl
import java.util.Objects
import java.util.function.{ BiFunction, Function => JFunction, Predicate,
Supplier }
+import scala.jdk.FunctionConverters._
+
import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.persistence.typed.internal._
import pekko.util.OptionVal
-import scala.jdk.FunctionConverters._
-
/**
* FunctionalInterface for reacting on commands
*
diff --git
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala
index ed48d4de5e..7065c5a4f6 100644
---
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala
+++
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala
@@ -16,13 +16,13 @@ package org.apache.pekko.persistence.typed.javadsl
import java.util.Objects
import java.util.function.{ BiFunction, Function => JFunction, Predicate,
Supplier }
+import scala.jdk.FunctionConverters._
+
import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.persistence.typed.internal._
import pekko.util.OptionVal
-import scala.jdk.FunctionConverters._
-
/* Note that this is a copy of CommandHandler.scala to support ReplyEffect
* s/Effect/ReplyEffect/
* s/CommandHandler/CommandHandlerWithReply/
diff --git
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala
index 9b0b328347..57fa67454e 100644
---
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala
+++
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala
@@ -16,9 +16,10 @@ package org.apache.pekko.persistence.typed.javadsl
import java.util.Objects
import java.util.function.{ BiFunction, Function => JFunction, Predicate,
Supplier }
+import scala.jdk.FunctionConverters._
+
import org.apache.pekko
import pekko.annotation.InternalApi
-import scala.jdk.FunctionConverters._
import pekko.util.OptionVal
/**
diff --git
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala
index 27d01c7503..63032c5928 100644
---
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala
+++
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala
@@ -19,13 +19,13 @@ import java.util.function.BiFunction
import java.util.function.Predicate
import java.util.function.Supplier
+import scala.jdk.FunctionConverters._
+
import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.persistence.typed.state.internal._
import pekko.util.OptionVal
-import scala.jdk.FunctionConverters._
-
/**
* FunctionalInterface for reacting on commands
*
diff --git
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala
index 3e44cadbb7..ce53f9ef18 100644
---
a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala
+++
b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala
@@ -19,13 +19,13 @@ import java.util.function.BiFunction
import java.util.function.Predicate
import java.util.function.Supplier
+import scala.jdk.FunctionConverters._
+
import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.persistence.typed.state.internal._
import pekko.util.OptionVal
-import scala.jdk.FunctionConverters._
-
/* Note that this is a copy of CommandHandler.scala to support ReplyEffect
* s/Effect/ReplyEffect/
* s/CommandHandler/CommandHandlerWithReply/
diff --git
a/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonModule.scala
b/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonModule.scala
index 4fded4d075..ef02a795b1 100644
---
a/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonModule.scala
+++
b/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonModule.scala
@@ -18,8 +18,8 @@ import tools.jackson.core.Version
import tools.jackson.core.util.VersionUtil
import tools.jackson.databind.BeanDescription
import tools.jackson.databind.DeserializationConfig
-import tools.jackson.databind.JavaType
import tools.jackson.databind.JacksonModule.SetupContext
+import tools.jackson.databind.JavaType
import tools.jackson.databind.SerializationConfig
import tools.jackson.databind.ValueDeserializer
import tools.jackson.databind.ValueSerializer
diff --git
a/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala
b/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala
index 4da3a9ed07..ae83185ba2 100644
---
a/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala
+++
b/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala
@@ -15,6 +15,7 @@ package org.apache.pekko.serialization.jackson3
import java.util.Optional
import java.util.concurrent.ConcurrentHashMap
+
import scala.annotation.nowarn
import scala.collection.immutable
import scala.jdk.CollectionConverters._
@@ -22,7 +23,6 @@ import scala.jdk.OptionConverters._
import scala.util.{ Failure, Success }
import com.fasterxml.jackson.annotation.{ JsonAutoDetect, PropertyAccessor }
-import com.typesafe.config.Config
import tools.jackson.core.{ StreamReadConstraints, StreamReadFeature,
StreamWriteConstraints, StreamWriteFeature }
import tools.jackson.core.json.{ JsonFactory, JsonReadFeature,
JsonWriteFeature }
import tools.jackson.core.util.{ BufferRecycler, JsonRecyclerPools,
RecyclerPool }
@@ -37,6 +37,7 @@ import tools.jackson.databind.cfg.{ DateTimeFeature,
EnumFeature, MapperBuilder
import tools.jackson.databind.introspect.VisibilityChecker
import tools.jackson.databind.json.JsonMapper
import tools.jackson.dataformat.cbor.{ CBORFactory, CBORMapper }
+
import org.apache.pekko
import pekko.actor.{
ActorSystem,
@@ -51,6 +52,8 @@ import pekko.actor.setup.Setup
import pekko.annotation.InternalStableApi
import pekko.event.{ Logging, LoggingAdapter }
+import com.typesafe.config.Config
+
object JacksonObjectMapperProvider extends
ExtensionId[JacksonObjectMapperProvider] with ExtensionIdProvider {
override def get(system: ActorSystem): JacksonObjectMapperProvider =
super.get(system)
override def get(system: ClassicActorSystemProvider):
JacksonObjectMapperProvider = super.get(system)
diff --git
a/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala
b/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala
index 4d6c43c39e..956c34187c 100644
---
a/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala
+++
b/serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala
@@ -21,10 +21,10 @@ import scala.annotation.tailrec
import scala.util.{ Failure, Success }
import scala.util.control.NonFatal
+import net.jpountz.lz4.LZ4Factory
import tools.jackson.databind.ObjectMapper
import tools.jackson.databind.jsontype.impl.SubTypeValidator
import tools.jackson.dataformat.cbor.CBORFactory
-import net.jpountz.lz4.LZ4Factory
import org.apache.pekko
import pekko.actor.ExtendedActorSystem
diff --git
a/serialization-jackson3/src/test/scala/org/apache/pekko/serialization/jackson3/JacksonSerializerSpec.scala
b/serialization-jackson3/src/test/scala/org/apache/pekko/serialization/jackson3/JacksonSerializerSpec.scala
index 545f9d5b31..d0a8084d9c 100644
---
a/serialization-jackson3/src/test/scala/org/apache/pekko/serialization/jackson3/JacksonSerializerSpec.scala
+++
b/serialization-jackson3/src/test/scala/org/apache/pekko/serialization/jackson3/JacksonSerializerSpec.scala
@@ -19,10 +19,12 @@ import java.time.{ Duration, Instant, LocalDateTime }
import java.time.temporal.ChronoUnit
import java.util.{ Arrays, Optional, UUID }
import java.util.logging.FileHandler
+
import scala.annotation.nowarn
import scala.collection.immutable
-import scala.concurrent.duration.FiniteDuration
import scala.concurrent.duration._
+import scala.concurrent.duration.FiniteDuration
+
import com.fasterxml.jackson.annotation.{ JsonIgnore, JsonSubTypes,
JsonTypeInfo }
import tools.jackson.core.{ JsonGenerator, StreamReadFeature,
StreamWriteFeature }
import tools.jackson.core.`type`.TypeReference
@@ -38,10 +40,7 @@ import tools.jackson.databind.cfg.DateTimeFeature
import tools.jackson.databind.exc.InvalidTypeIdException
import tools.jackson.databind.module.SimpleModule
import tools.jackson.module.scala.JsonScalaEnumeration
-import com.typesafe.config.ConfigFactory
-import org.scalatest.BeforeAndAfterAll
-import org.scalatest.matchers.should.Matchers
-import org.scalatest.wordspec.AnyWordSpecLike
+
import org.apache.pekko
import pekko.actor.{ ActorRef, ActorSystem, Address, BootstrapSetup,
ExtendedActorSystem, Status }
import pekko.actor.setup.ActorSystemSetup
@@ -49,6 +48,12 @@ import pekko.actor.typed.scaladsl.Behaviors
import pekko.serialization.{ Serialization, SerializationExtension,
SerializerWithStringManifest }
import pekko.testkit.{ TestActors, TestKit }
+import org.scalatest.BeforeAndAfterAll
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpecLike
+
+import com.typesafe.config.ConfigFactory
+
object ScalaTestMessages {
trait TestMessage
diff --git
a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DoOnCancel.scala
b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DoOnCancel.scala
index e7419ca558..9b528b9e03 100644
--- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DoOnCancel.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DoOnCancel.scala
@@ -19,10 +19,10 @@ package org.apache.pekko.stream.impl.fusing
import org.apache.pekko
import pekko.annotation.InternalApi
+import pekko.stream.{ Attributes, FlowShape, Inlet, Outlet,
SubscriptionWithCancelException }
import pekko.stream.Attributes.SourceLocation
import pekko.stream.impl.Stages.DefaultAttributes
import pekko.stream.stage.{ GraphStage, GraphStageLogic, InHandler, OutHandler
}
-import pekko.stream.{ Attributes, FlowShape, Inlet, Outlet,
SubscriptionWithCancelException }
/**
* INTERNAL API
diff --git
a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DoOnFirst.scala
b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DoOnFirst.scala
index f2c444fd5a..009d15b5dc 100644
--- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DoOnFirst.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DoOnFirst.scala
@@ -19,9 +19,9 @@ package org.apache.pekko.stream.impl.fusing
import org.apache.pekko
import pekko.annotation.InternalApi
+import pekko.stream.{ Attributes, FlowShape, Inlet, Outlet }
import pekko.stream.Attributes.SourceLocation
import pekko.stream.impl.Stages.DefaultAttributes
-import pekko.stream.{ Attributes, FlowShape, Inlet, Outlet }
import pekko.stream.stage.{ GraphStage, GraphStageLogic, InHandler, OutHandler
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]