diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreterSpecKit.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreterSpecKit.scala index 443749d8b4..0cdbafea71 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreterSpecKit.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreterSpecKit.scala @@ -13,12 +13,11 @@ package org.apache.pekko.stream.impl.fusing +import scala.annotation.nowarn import scala.collection.{ Map => SMap } import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration.FiniteDuration -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.Cancellable diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/BaseTwoStreamsSetup.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/BaseTwoStreamsSetup.scala index ba531045ac..20df26bc2d 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/BaseTwoStreamsSetup.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/BaseTwoStreamsSetup.scala @@ -16,13 +16,13 @@ package org.apache.pekko.stream.testkit import scala.collection.immutable import scala.util.control.NoStackTrace -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.scaladsl._ import pekko.stream.testkit.scaladsl.StreamTestKit._ import pekko.testkit.PekkoSpec +import org.reactivestreams.Publisher + abstract class BaseTwoStreamsSetup extends PekkoSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 pekko.stream.materializer.max-input-buffer-size = 2 diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/ChainSetup.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/ChainSetup.scala index ddb928f707..bc824c6835 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/ChainSetup.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/ChainSetup.scala @@ -14,7 +14,6 @@ package org.apache.pekko.stream.testkit import scala.annotation.nowarn -import org.reactivestreams.Publisher import org.apache.pekko import pekko.NotUsed @@ -25,6 +24,8 @@ import pekko.stream.ActorMaterializerSettings import pekko.stream.Materializer import pekko.stream.scaladsl._ +import org.reactivestreams.Publisher + class ChainSetup[In, Out, M]( stream: Flow[In, In, NotUsed] => Flow[In, Out, M], val settings: ActorMaterializerSettings, diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/ScriptedTest.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/ScriptedTest.scala index f22e006ac7..0f4925556f 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/ScriptedTest.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/ScriptedTest.scala @@ -15,13 +15,10 @@ package org.apache.pekko.stream.testkit import java.util.concurrent.ThreadLocalRandom +import scala.annotation.nowarn import scala.annotation.tailrec import scala.concurrent.duration._ -import scala.annotation.nowarn -import org.reactivestreams.Publisher -import org.scalatest.matchers.should.Matchers - import org.apache.pekko import pekko.NotUsed import pekko.actor.ActorSystem @@ -34,6 +31,10 @@ import pekko.stream.scaladsl.Source import pekko.stream.testkit.TestPublisher._ import pekko.stream.testkit.TestSubscriber._ +import org.reactivestreams.Publisher + +import org.scalatest.matchers.should.Matchers + trait ScriptedTest extends Matchers { class ScriptException(msg: String) extends RuntimeException(msg) diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamSpec.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamSpec.scala index 42aaad39d3..827a3c4918 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamSpec.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamSpec.scala @@ -16,18 +16,19 @@ package org.apache.pekko.stream.testkit import scala.concurrent.Future import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.Failed - import org.apache.pekko import pekko.actor.{ ActorRef, ActorSystem } +import pekko.stream.Materializer +import pekko.stream.impl.PhasedFusingActorMaterializer import pekko.stream.impl.StreamSupervisor import pekko.stream.snapshot.{ MaterializerState, StreamSnapshotImpl } +import pekko.stream.testkit.scaladsl.StreamTestKit.{ assertNoChildren, stopAllChildren } import pekko.testkit.{ PekkoSpec, TestProbe } import pekko.testkit.TestKitUtils -import pekko.stream.impl.PhasedFusingActorMaterializer -import pekko.stream.testkit.scaladsl.StreamTestKit.{ assertNoChildren, stopAllChildren } -import pekko.stream.Materializer + +import org.scalatest.Failed + +import com.typesafe.config.{ Config, ConfigFactory } abstract class StreamSpec(_system: ActorSystem) extends PekkoSpec(_system) { def this(config: Config) = diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamTestDefaultMailbox.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamTestDefaultMailbox.scala index dd561a5897..cc2f4a732f 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamTestDefaultMailbox.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamTestDefaultMailbox.scala @@ -13,8 +13,6 @@ package org.apache.pekko.stream.testkit -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -26,6 +24,8 @@ import pekko.dispatch.ProducesMessageQueue import pekko.dispatch.UnboundedMailbox import pekko.stream.impl.MaterializerGuardian +import com.typesafe.config.Config + /** * INTERNAL API * This mailbox is only used in tests to verify that stream actors are using diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamTestKitSpec.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamTestKitSpec.scala index 37ea49c071..5cf8130053 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamTestKitSpec.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamTestKitSpec.scala @@ -13,7 +13,10 @@ package org.apache.pekko.stream.testkit +import java.util + import scala.concurrent.duration._ + import org.apache.pekko import pekko.stream.scaladsl.Source import pekko.stream.testkit.scaladsl.TestSink @@ -21,8 +24,6 @@ import pekko.testkit._ import pekko.testkit.TestEvent.Mute import pekko.testkit.TestEvent.UnMute -import java.util - class StreamTestKitSpec extends PekkoSpec { val ex = new Exception("Boom!") diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/TestPublisherSubscriberSpec.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/TestPublisherSubscriberSpec.scala index 85a2c71ccd..918be688c3 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/TestPublisherSubscriberSpec.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/TestPublisherSubscriberSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.stream.testkit -import org.reactivestreams.Subscription - import org.apache.pekko import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source @@ -23,6 +21,8 @@ import pekko.stream.testkit.TestSubscriber._ import pekko.stream.testkit.scaladsl.StreamTestKit._ import pekko.testkit.PekkoSpec +import org.reactivestreams.Subscription + class TestPublisherSubscriberSpec extends PekkoSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 pekko.stream.materializer.max-input-buffer-size = 2 diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/TwoStreamsSetup.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/TwoStreamsSetup.scala index a91cfdd465..16960ae5ab 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/TwoStreamsSetup.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/TwoStreamsSetup.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.testkit -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream._ import pekko.stream.scaladsl._ +import org.reactivestreams.Publisher + abstract class TwoStreamsSetup extends BaseTwoStreamsSetup { abstract class Fixture { diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/Utils.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/Utils.scala index b3290443e3..af5d722bbf 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/Utils.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/Utils.scala @@ -15,12 +15,12 @@ package org.apache.pekko.stream.testkit import scala.util.control.NoStackTrace -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorRefWithCell +import com.typesafe.config.ConfigFactory + object Utils { /** Sets the default-mailbox to the usual [[pekko.dispatch.UnboundedMailbox]] instead of [[StreamTestDefaultMailbox]]. */ diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/ActorMaterializerSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/ActorMaterializerSpec.scala index 387a56d7fc..2e90a5ef42 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/ActorMaterializerSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/ActorMaterializerSpec.scala @@ -19,8 +19,6 @@ import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.{ Failure, Try } -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.Done import pekko.actor.{ Actor, ActorSystem, PoisonPill, Props } @@ -35,6 +33,8 @@ import pekko.stream.testkit.{ StreamSpec, TestPublisher } import pekko.testkit.{ ImplicitSender, TestProbe } import pekko.testkit.TestKit +import com.typesafe.config.ConfigFactory + object IndirectMaterializerCreation extends ExtensionId[IndirectMaterializerCreation] with ExtensionIdProvider { def createExtension(system: ExtendedActorSystem): IndirectMaterializerCreation = new IndirectMaterializerCreation(system) diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/DslConsistencySpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/DslConsistencySpec.scala index c1c993990a..ce1d60bee9 100755 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/DslConsistencySpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/DslConsistencySpec.scala @@ -16,9 +16,10 @@ package org.apache.pekko.stream import java.lang.reflect.Method import java.lang.reflect.Modifier -import org.apache.pekko import scala.annotation.nowarn +import org.apache.pekko + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/DslFactoriesConsistencySpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/DslFactoriesConsistencySpec.scala index 7e8933026a..df715bbf13 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/DslFactoriesConsistencySpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/DslFactoriesConsistencySpec.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream import org.apache.pekko + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/SystemMaterializerSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/SystemMaterializerSpec.scala index b4b5157c55..6cfa1c5ff7 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/SystemMaterializerSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/SystemMaterializerSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.stream import scala.concurrent.Future -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.stream.scaladsl.Keep import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source import pekko.stream.testkit.StreamSpec +import org.scalatest.concurrent.ScalaFutures + class SystemMaterializerSpec extends StreamSpec with ScalaFutures { def compileOnly(): Unit = { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/GraphStageLogicSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/GraphStageLogicSpec.scala index 3c5ae31dfc..787bbd029e 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/GraphStageLogicSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/GraphStageLogicSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.stream.impl import scala.concurrent.duration.Duration -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.NotUsed import pekko.stream._ @@ -27,6 +25,8 @@ import pekko.stream.stage.GraphStageLogic.{ EagerTerminateInput, EagerTerminateO import pekko.stream.testkit.StreamSpec import pekko.stream.testkit.scaladsl.TestSink +import org.scalatest.concurrent.ScalaFutures + class GraphStageLogicSpec extends StreamSpec with GraphInterpreterSpecKit with ScalaFutures { object emit1234 extends GraphStage[FlowShape[Int, Int]] { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/ResizableMultiReaderRingBufferSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/ResizableMultiReaderRingBufferSpec.scala index 8e7e363a65..fc6e5c550c 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/ResizableMultiReaderRingBufferSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/ResizableMultiReaderRingBufferSpec.scala @@ -15,11 +15,11 @@ package org.apache.pekko.stream.impl import scala.util.Random +import org.apache.pekko.stream.impl.ResizableMultiReaderRingBuffer._ + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.stream.impl.ResizableMultiReaderRingBuffer._ - class ResizableMultiReaderRingBufferSpec extends AnyWordSpec with Matchers { "A ResizableMultiReaderRingBuffer" should { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TimeoutsSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TimeoutsSpec.scala index 21deb69aff..a536c83199 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TimeoutsSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TimeoutsSpec.scala @@ -19,9 +19,6 @@ import scala.concurrent.Await import scala.concurrent.Future import scala.concurrent.duration._ -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.stream._ @@ -31,6 +28,9 @@ import pekko.stream.testkit.TestPublisher import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.Utils._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + class TimeoutsSpec extends StreamSpec { "InitialTimeout" must { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/fusing/ActorGraphInterpreterSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/fusing/ActorGraphInterpreterSpec.scala index 6c015c3431..770a5caaae 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/fusing/ActorGraphInterpreterSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/fusing/ActorGraphInterpreterSpec.scala @@ -19,10 +19,6 @@ import scala.concurrent.Await import scala.concurrent.Promise import scala.concurrent.duration._ -import org.reactivestreams.Publisher -import org.reactivestreams.Subscriber -import org.reactivestreams.Subscription - import org.apache.pekko import pekko.Done import pekko.stream._ @@ -40,6 +36,10 @@ import pekko.stream.testkit.Utils._ import pekko.testkit.EventFilter import pekko.testkit.TestLatch +import org.reactivestreams.Publisher +import org.reactivestreams.Subscriber +import org.reactivestreams.Subscription + class ActorGraphInterpreterSpec extends StreamSpec { "ActorGraphInterpreter" must { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/io/TLSUtilsSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/io/TLSUtilsSpec.scala index bfba6b546e..a28765cfb4 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/io/TLSUtilsSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/io/TLSUtilsSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.stream.impl.io import javax.net.ssl.{ SSLContext, SSLEngine, SSLParameters } -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.stream.TLSClientAuth import pekko.stream.TLSProtocol.NegotiateNewSession +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + class TLSUtilsSpec extends AnyWordSpecLike with Matchers { "TlsUtils.applySessionParameters" must { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/io/DeprecatedTlsSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/io/DeprecatedTlsSpec.scala index e3eb3764cd..ef56dfffcc 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/io/DeprecatedTlsSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/io/DeprecatedTlsSpec.scala @@ -26,8 +26,6 @@ import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.Random -import com.typesafe.sslconfig.pekko.PekkoSSLConfig - import org.apache.pekko import pekko.NotUsed import pekko.pattern.{ after => later } @@ -42,6 +40,8 @@ import pekko.testkit.WithLogCapturing import pekko.util.ByteString import pekko.util.JavaVersion +import com.typesafe.sslconfig.pekko.PekkoSSLConfig + object DeprecatedTlsSpec { val rnd = new Random 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 8bdf6c3c30..87eccbe843 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 @@ -23,7 +23,6 @@ import scala.concurrent.duration._ import scala.util.Success import com.google.common.jimfs.{ Configuration, Jimfs } -import org.scalatest.concurrent.ScalaFutures import org.apache.pekko import pekko.dispatch.ExecutionContexts @@ -35,6 +34,8 @@ import pekko.stream.testkit._ import pekko.stream.testkit.Utils._ import pekko.util.ByteString +import org.scalatest.concurrent.ScalaFutures + @nowarn class FileSinkSpec extends StreamSpec(UnboundedMailboxConfig) with ScalaFutures { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/io/OutputStreamSinkSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/io/OutputStreamSinkSpec.scala index af4b24bc01..09498fc555 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/io/OutputStreamSinkSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/io/OutputStreamSinkSpec.scala @@ -18,8 +18,6 @@ import java.io.OutputStream import scala.annotation.nowarn import scala.util.Success -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.Done import pekko.stream.{ ActorMaterializer, ActorMaterializerSettings, IOOperationIncompleteException } @@ -29,6 +27,8 @@ import pekko.stream.testkit.Utils._ import pekko.testkit.TestProbe import pekko.util.ByteString +import org.scalatest.concurrent.ScalaFutures + @nowarn class OutputStreamSinkSpec extends StreamSpec(UnboundedMailboxConfig) with ScalaFutures { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/io/TcpSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/io/TcpSpec.scala index 971a3f7823..403994cf1b 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/io/TcpSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/io/TcpSpec.scala @@ -25,11 +25,6 @@ import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.PatienceConfiguration -import org.scalatest.concurrent.PatienceConfiguration.Timeout - import org.apache.pekko import pekko.Done import pekko.NotUsed @@ -59,6 +54,12 @@ import pekko.testkit.TestProbe import pekko.testkit.WithLogCapturing import pekko.util.ByteString +import org.scalatest.concurrent.PatienceConfiguration +import org.scalatest.concurrent.PatienceConfiguration.Timeout + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + @nowarn("msg=never used") class NonResolvingDnsActor(cache: SimpleDnsCache, config: Config) extends Actor { def receive = { @@ -1021,12 +1022,12 @@ class TcpSpec extends StreamSpec(""" import java.security.KeyStore import javax.net.ssl._ - import com.typesafe.sslconfig.pekko.PekkoSSLConfig - import org.apache.pekko import pekko.stream.TLSClientAuth import pekko.stream.TLSProtocol + import com.typesafe.sslconfig.pekko.PekkoSSLConfig + val sslConfig = PekkoSSLConfig(system) // Don't hardcode your password in actual code diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/CodecSpecSupport.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/CodecSpecSupport.scala index 6a76af4ba1..54b9228e20 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/CodecSpecSupport.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/CodecSpecSupport.scala @@ -13,15 +13,15 @@ package org.apache.pekko.stream.io.compression -import org.scalatest.BeforeAndAfterAll -import org.scalatest.Suite -import org.scalatest.matchers.should.Matchers - import org.apache.pekko import pekko.actor.ActorSystem import pekko.testkit.TestKit import pekko.util.ByteString +import org.scalatest.BeforeAndAfterAll +import org.scalatest.Suite +import org.scalatest.matchers.should.Matchers + trait CodecSpecSupport extends Matchers with BeforeAndAfterAll { self: Suite => def readAs(string: String, charset: String = "UTF8") = diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/CoderSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/CoderSpec.scala index 4901ff0029..476550fa4a 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/CoderSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/io/compression/CoderSpec.scala @@ -22,15 +22,15 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import org.scalatest.Inspectors -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.NotUsed import pekko.stream.impl.io.compression.Compressor import pekko.stream.scaladsl.{ Compression, Flow, Sink, Source } import pekko.util.ByteString +import org.scalatest.Inspectors +import org.scalatest.wordspec.AnyWordSpec + abstract class CoderSpec(codecName: String) extends AnyWordSpec with CodecSpecSupport with Inspectors { import CompressionTestingTools._ diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/ActorRefSourceSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/ActorRefSourceSpec.scala index d559a108a8..d4afb84a2c 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/ActorRefSourceSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/ActorRefSourceSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.stream.scaladsl import scala.annotation.nowarn import scala.concurrent.duration._ -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.Done import pekko.actor.{ ActorRef, Status } @@ -26,6 +24,8 @@ import pekko.stream.testkit._ import pekko.stream.testkit.Utils._ import pekko.stream.testkit.scaladsl._ +import org.reactivestreams.Publisher + @nowarn("msg=deprecated") class ActorRefSourceSpec extends StreamSpec { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/AggregateWithBoundarySpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/AggregateWithBoundarySpec.scala index 78642f33d0..0cda1362b6 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/AggregateWithBoundarySpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/AggregateWithBoundarySpec.scala @@ -17,16 +17,17 @@ import scala.collection.mutable.ListBuffer import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.{ ConfigFactory, ConfigValueFactory } -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorSystem import pekko.stream.OverflowStrategy import pekko.stream.testkit.{ StreamSpec, TestPublisher, TestSubscriber } import pekko.testkit.{ ExplicitlyTriggeredScheduler, PekkoSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.{ ConfigFactory, ConfigValueFactory } + class AggregateWithBoundarySpec extends StreamSpec { "split aggregator by size" in { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/AttributesSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/AttributesSpec.scala index 0f3d85b827..15e37fe744 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/AttributesSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/AttributesSpec.scala @@ -14,22 +14,24 @@ package org.apache.pekko.stream.scaladsl import java.util.concurrent.{ CompletionStage, TimeUnit } + import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory import org.apache.pekko import pekko.{ Done, NotUsed } import pekko.actor.ActorSystem import pekko.dispatch.Dispatchers -import pekko.stream.ActorAttributes.Dispatcher import pekko.stream._ +import pekko.stream.ActorAttributes.Dispatcher import pekko.stream.Attributes._ import pekko.stream.javadsl -import pekko.stream.stage._ import pekko.stream.snapshot.MaterializerState +import pekko.stream.stage._ import pekko.stream.testkit._ import pekko.testkit.TestKit +import com.typesafe.config.ConfigFactory + object AttributesSpec { class AttributesSource(_initialAttributes: Attributes = Attributes.none) diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/CoupledTerminationFlowSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/CoupledTerminationFlowSpec.scala index 5ff38e190d..2e6f914833 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/CoupledTerminationFlowSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/CoupledTerminationFlowSpec.scala @@ -19,11 +19,6 @@ import scala.util.Success import scala.util.Try import scala.xml.Node -import org.reactivestreams.Publisher -import org.reactivestreams.Subscriber -import org.reactivestreams.Subscription -import org.scalatest.Assertion - import org.apache.pekko import pekko.Done import pekko.NotUsed @@ -32,6 +27,12 @@ import pekko.stream.testkit._ import pekko.stream.testkit.scaladsl.TestSource import pekko.testkit.TestProbe +import org.reactivestreams.Publisher +import org.reactivestreams.Subscriber +import org.reactivestreams.Subscription + +import org.scalatest.Assertion + class CoupledTerminationFlowSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 """) with ScriptedTest { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowAppendSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowAppendSpec.scala index df2b88bd7e..eddb44bcac 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowAppendSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowAppendSpec.scala @@ -13,14 +13,15 @@ package org.apache.pekko.stream.scaladsl -import org.reactivestreams.Subscriber -import org.scalatest.matchers.should.Matchers - import org.apache.pekko import pekko.actor.ActorSystem import pekko.stream.testkit.StreamSpec import pekko.stream.testkit.TestSubscriber +import org.reactivestreams.Subscriber + +import org.scalatest.matchers.should.Matchers + class FlowAppendSpec extends StreamSpec with River { "Flow" should { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowCompileSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowCompileSpec.scala index 74306d3c35..21ae42a0e4 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowCompileSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowCompileSpec.scala @@ -17,12 +17,12 @@ import scala.annotation.nowarn import scala.collection.immutable.Seq import scala.concurrent.Future -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.NotUsed import pekko.stream.testkit.StreamSpec +import org.reactivestreams.Publisher + @nowarn // unused vars are used in shouldNot compile tests class FlowCompileSpec extends StreamSpec { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowConcatAllLazySpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowConcatAllLazySpec.scala index b0e6f1e76e..7495360c77 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowConcatAllLazySpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowConcatAllLazySpec.scala @@ -13,14 +13,15 @@ package org.apache.pekko.stream.scaladsl +import java.util.StringJoiner +import java.util.concurrent.atomic.AtomicBoolean + +import scala.util.control.NoStackTrace + import org.apache.pekko import pekko.stream.testkit._ import pekko.stream.testkit.scaladsl.TestSink -import java.util.StringJoiner -import java.util.concurrent.atomic.AtomicBoolean -import scala.util.control.NoStackTrace - class FlowConcatAllLazySpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 pekko.stream.materializer.max-input-buffer-size = 2 diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowConcatSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowConcatSpec.scala index 8ad3cb4de8..a862104028 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowConcatSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowConcatSpec.scala @@ -19,9 +19,6 @@ import scala.concurrent.Await import scala.concurrent.Promise import scala.concurrent.duration._ -import org.reactivestreams.Publisher -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.NotUsed import pekko.stream.testkit.BaseTwoStreamsSetup @@ -30,6 +27,10 @@ import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.StreamTestKit._ import pekko.stream.testkit.scaladsl.TestSink +import org.reactivestreams.Publisher + +import org.scalatest.concurrent.ScalaFutures + abstract class AbstractFlowConcatSpec extends BaseTwoStreamsSetup { override type Outputs = Int diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDelaySpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDelaySpec.scala index ab48f423b3..1b0a5d1e89 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDelaySpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDelaySpec.scala @@ -17,10 +17,6 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import org.scalatest.concurrent.PatienceConfiguration -import org.scalatest.time.Milliseconds -import org.scalatest.time.Span - import org.apache.pekko import pekko.Done import pekko.stream._ @@ -33,6 +29,10 @@ import pekko.stream.testkit.scaladsl.TestSink import pekko.testkit.TestDuration import pekko.testkit.TimingTest +import org.scalatest.concurrent.PatienceConfiguration +import org.scalatest.time.Milliseconds +import org.scalatest.time.Span + class FlowDelaySpec extends StreamSpec { "A Delay" must { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFlattenMergeSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFlattenMergeSpec.scala index 4b89f51c72..8198d35265 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFlattenMergeSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFlattenMergeSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.stream.scaladsl import scala.concurrent._ import scala.concurrent.duration._ -import org.scalatest.exceptions.TestFailedException - import org.apache.pekko import pekko.NotUsed import pekko.stream._ @@ -33,6 +31,8 @@ import pekko.stream.testkit.scaladsl.TestSink import pekko.testkit.TestLatch import pekko.util.OptionVal +import org.scalatest.exceptions.TestFailedException + class FlowFlattenMergeSpec extends StreamSpec { import system.dispatcher diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFoldAsyncSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFoldAsyncSpec.scala index caeb8faf2e..3b31515d84 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFoldAsyncSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFoldAsyncSpec.scala @@ -19,8 +19,6 @@ import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import org.scalatest.concurrent.PatienceConfiguration.Timeout - import org.apache.pekko import pekko.NotUsed import pekko.stream.ActorAttributes.supervisionStrategy @@ -31,6 +29,8 @@ import pekko.stream.testkit._ import pekko.stream.testkit.Utils._ import pekko.testkit.LongRunningTest +import org.scalatest.concurrent.PatienceConfiguration.Timeout + class FlowFoldAsyncSpec extends StreamSpec { implicit def ec: ExecutionContextExecutor = system.dispatcher diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowGroupBySpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowGroupBySpec.scala index 584428b192..2ae158cb8a 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowGroupBySpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowGroupBySpec.scala @@ -22,9 +22,6 @@ import scala.concurrent.Await import scala.concurrent.Promise import scala.concurrent.duration._ -import org.reactivestreams.Publisher -import org.scalatest.concurrent.PatienceConfiguration.Timeout - import org.apache.pekko import pekko.Done import pekko.NotUsed @@ -41,6 +38,10 @@ import pekko.stream.testkit.scaladsl.TestSource import pekko.testkit.TestLatch import pekko.util.ByteString +import org.reactivestreams.Publisher + +import org.scalatest.concurrent.PatienceConfiguration.Timeout + object FlowGroupBySpec { implicit class Lift[M](val f: SubFlow[Int, M, Source[Int, M]#Repr, RunnableGraph[M]]) extends AnyVal { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowInterleaveAllSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowInterleaveAllSpec.scala index 2736ca3fde..3e4f298fc4 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowInterleaveAllSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowInterleaveAllSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.stream.scaladsl +import java.util.StringJoiner + import org.apache.pekko import pekko.stream.testkit._ import pekko.stream.testkit.scaladsl.StreamTestKit._ import pekko.stream.testkit.scaladsl.TestSink -import java.util.StringJoiner - class FlowInterleaveAllSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 pekko.stream.materializer.max-input-buffer-size = 2 diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowInterleaveSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowInterleaveSpec.scala index 564c68ab7e..d6e5b12265 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowInterleaveSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowInterleaveSpec.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.scaladsl -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.testkit._ import pekko.stream.testkit.scaladsl.StreamTestKit._ +import org.reactivestreams.Publisher + class FlowInterleaveSpec extends BaseTwoStreamsSetup { override type Outputs = Int diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowJoinSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowJoinSpec.scala index f7e44ac9ce..781a5007f2 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowJoinSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowJoinSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.stream.scaladsl import scala.collection.immutable -import org.scalatest.time._ - import org.apache.pekko import pekko.stream.FlowShape import pekko.stream.OverflowStrategy import pekko.stream.testkit._ import pekko.stream.testkit.scaladsl._ +import org.scalatest.time._ + class FlowJoinSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 """) { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMapAsyncSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMapAsyncSpec.scala index 2b881e2217..9edee111d5 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMapAsyncSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMapAsyncSpec.scala @@ -24,8 +24,6 @@ import scala.concurrent.Promise import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import org.scalatest.concurrent.PatienceConfiguration.Timeout - import org.apache.pekko import pekko.stream.ActorAttributes import pekko.stream.ActorAttributes.supervisionStrategy @@ -37,6 +35,8 @@ import pekko.stream.testkit.scaladsl.TestSink import pekko.testkit.TestLatch import pekko.testkit.TestProbe +import org.scalatest.concurrent.PatienceConfiguration.Timeout + class FlowMapAsyncSpec extends StreamSpec { "A Flow with mapAsync" must { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala index e897b0f09b..c23b251124 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala @@ -23,8 +23,6 @@ import scala.concurrent.Promise import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import org.scalatest.concurrent.PatienceConfiguration.Timeout - import org.apache.pekko import pekko.stream.ActorAttributes.supervisionStrategy import pekko.stream.Supervision.resumingDecider @@ -33,6 +31,8 @@ import pekko.stream.testkit.scaladsl._ import pekko.testkit.TestLatch import pekko.testkit.TestProbe +import org.scalatest.concurrent.PatienceConfiguration.Timeout + class FlowMapAsyncUnorderedSpec extends StreamSpec { "A Flow with mapAsyncUnordered" must { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMergeSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMergeSpec.scala index cf89c1c25a..ceda36540d 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMergeSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowMergeSpec.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.scaladsl -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.testkit._ import pekko.stream.testkit.scaladsl.StreamTestKit._ +import org.reactivestreams.Publisher + class FlowMergeSpec extends BaseTwoStreamsSetup { override type Outputs = Int diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowOnErrorCompleteSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowOnErrorCompleteSpec.scala index 338669f270..48a88288a4 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowOnErrorCompleteSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowOnErrorCompleteSpec.scala @@ -17,12 +17,13 @@ package org.apache.pekko.stream.scaladsl -import org.apache.pekko.stream.testkit.StreamSpec -import org.apache.pekko.stream.testkit.scaladsl.TestSink - import scala.concurrent.TimeoutException import scala.util.control.NoStackTrace +import org.apache.pekko +import pekko.stream.testkit.StreamSpec +import pekko.stream.testkit.scaladsl.TestSink + class FlowOnErrorCompleteSpec extends StreamSpec { val ex = new RuntimeException("ex") with NoStackTrace diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowScanAsyncSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowScanAsyncSpec.scala index 34dc91ca1b..53548f6fc7 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowScanAsyncSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowScanAsyncSpec.scala @@ -20,8 +20,6 @@ import scala.concurrent.Promise import scala.concurrent.duration._ import scala.util.Failure -import org.scalatest.matchers.should.Matchers - import org.apache.pekko import pekko.pattern import pekko.stream.ActorAttributes @@ -32,6 +30,8 @@ import pekko.stream.testkit.TestSubscriber.Probe import pekko.stream.testkit.Utils.TE import pekko.stream.testkit.scaladsl._ +import org.scalatest.matchers.should.Matchers + class FlowScanAsyncSpec extends StreamSpec with Matchers { implicit val executionContext: ExecutionContextExecutor = system.dispatcher diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSpec.scala index 4621110cbb..632f98a320 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSpec.scala @@ -14,13 +14,14 @@ package org.apache.pekko.stream.scaladsl import java.util.concurrent.ThreadLocalRandom +import java.util.concurrent.atomic.AtomicLong + +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory -import org.reactivestreams.{ Publisher, Subscriber } + import org.apache.pekko import pekko.NotUsed import pekko.stream._ @@ -30,7 +31,9 @@ import pekko.stream.testkit._ import pekko.stream.testkit.scaladsl.{ TestSink, TestSource } import pekko.testkit.TestDuration -import java.util.concurrent.atomic.AtomicLong +import org.reactivestreams.{ Publisher, Subscriber } + +import com.typesafe.config.ConfigFactory object FlowSpec { class Fruit extends Serializable diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSplitAfterSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSplitAfterSpec.scala index 81db84dae7..da91f8af0d 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSplitAfterSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSplitAfterSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.stream.scaladsl import scala.concurrent.Await import scala.concurrent.duration._ -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.NotUsed import pekko.stream._ @@ -29,6 +27,8 @@ import pekko.stream.testkit.TestPublisher import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.Utils._ +import org.reactivestreams.Publisher + object FlowSplitAfterSpec { implicit class Lift[M](val f: SubFlow[Int, M, Source[Int, M]#Repr, RunnableGraph[M]]) extends AnyVal { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSplitWhenSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSplitWhenSpec.scala index a7522a51d4..58c6238eac 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSplitWhenSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSplitWhenSpec.scala @@ -17,8 +17,6 @@ import scala.concurrent.Await import scala.concurrent.Future import scala.concurrent.duration._ -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.Done import pekko.NotUsed @@ -30,6 +28,8 @@ import pekko.stream.testkit._ import pekko.stream.testkit.Utils._ import pekko.stream.testkit.scaladsl.TestSink +import org.reactivestreams.Publisher + class FlowSplitWhenSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 pekko.stream.materializer.max-input-buffer-size = 2 diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowStatefulMapConcatSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowStatefulMapConcatSpec.scala index dc909475b3..47a7d44cd3 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowStatefulMapConcatSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowStatefulMapConcatSpec.scala @@ -13,6 +13,7 @@ package org.apache.pekko.stream.scaladsl +import scala.annotation.nowarn import scala.util.control.NoStackTrace import org.apache.pekko @@ -21,8 +22,6 @@ import pekko.stream.Supervision import pekko.stream.testkit._ import pekko.stream.testkit.scaladsl.TestSink -import scala.annotation.nowarn - @nowarn("msg=deprecated") class FlowStatefulMapConcatSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowZipAllSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowZipAllSpec.scala index 04a917d534..01f0b3a570 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowZipAllSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowZipAllSpec.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.scaladsl -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.testkit.{ BaseTwoStreamsSetup, TestSubscriber } import pekko.stream.testkit.scaladsl.StreamTestKit._ +import org.reactivestreams.Publisher + class FlowZipAllSpec extends BaseTwoStreamsSetup { override type Outputs = (Int, Int) diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/ForComprehensionsCompileSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/ForComprehensionsCompileSpec.scala index 4106282c6b..1e6fde98f2 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/ForComprehensionsCompileSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/ForComprehensionsCompileSpec.scala @@ -17,16 +17,17 @@ package org.apache.pekko.stream.scaladsl +import java.util.concurrent.CopyOnWriteArrayList + +import scala.concurrent.Await +import scala.concurrent.duration.DurationInt + import org.apache.pekko import pekko.Done import pekko.japi.Util import pekko.stream.testkit.StreamSpec import pekko.stream.testkit.scaladsl.TestSink -import java.util.concurrent.CopyOnWriteArrayList -import scala.concurrent.Await -import scala.concurrent.duration.DurationInt - class ForComprehensionsCompileSpec extends StreamSpec { "A Source" must { "be able to be used in a for comprehension which yield" in { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphBackedFlowSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphBackedFlowSpec.scala index 196edd4376..72395b666b 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphBackedFlowSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphBackedFlowSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.stream.scaladsl import scala.annotation.nowarn -import org.reactivestreams.Subscriber - import org.apache.pekko import pekko.stream._ import pekko.stream.ActorMaterializer import pekko.stream.ActorMaterializerSettings import pekko.stream.testkit._ +import org.reactivestreams.Subscriber + object GraphFlowSpec { val source1 = Source(0 to 3) diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphUnzipWithSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphUnzipWithSpec.scala index 0018890667..d69708333b 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphUnzipWithSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphUnzipWithSpec.scala @@ -17,8 +17,6 @@ import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.Done import pekko.NotUsed @@ -30,6 +28,8 @@ import pekko.testkit.EventFilter import pekko.testkit.TestProbe import pekko.util.unused +import org.reactivestreams.Publisher + class GraphUnzipWithSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 """) { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphZipLatestSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphZipLatestSpec.scala index 537feed10e..fdea832c4e 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphZipLatestSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphZipLatestSpec.scala @@ -17,7 +17,6 @@ import scala.concurrent.duration._ import scala.language.postfixOps import org.scalacheck.Gen -import org.scalatest.concurrent.ScalaFutures import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import org.apache.pekko @@ -29,6 +28,8 @@ import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink import pekko.stream.testkit.scaladsl.TestSource +import org.scalatest.concurrent.ScalaFutures + object GraphZipLatestSpec { val someString = "someString" val someInt = 1 diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphZipLatestWithSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphZipLatestWithSpec.scala index 2565f03716..6468d9f43e 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphZipLatestWithSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/GraphZipLatestWithSpec.scala @@ -16,13 +16,13 @@ package org.apache.pekko.stream.scaladsl import scala.concurrent.duration._ import scala.language.postfixOps -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream._ import pekko.stream.testkit._ import pekko.testkit.EventFilter +import org.reactivestreams.Publisher + class GraphZipLatestWithSpec extends TwoStreamsSetup { import GraphDSL.Implicits._ diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/LazilyAsyncSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/LazilyAsyncSpec.scala index 64f660b5d0..edd0a770ae 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/LazilyAsyncSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/LazilyAsyncSpec.scala @@ -18,14 +18,14 @@ import java.util.concurrent.atomic.AtomicBoolean import scala.annotation.nowarn import scala.concurrent.Future -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.Done import pekko.stream.testkit.StreamSpec import pekko.stream.testkit.TestSubscriber import pekko.testkit.DefaultTimeout +import org.scalatest.concurrent.ScalaFutures + @nowarn("msg=deprecated") // tests deprecated methods class LazilyAsyncSpec extends StreamSpec with DefaultTimeout with ScalaFutures { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/LazySourceSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/LazySourceSpec.scala index 84e740c9c5..8a69f14d28 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/LazySourceSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/LazySourceSpec.scala @@ -19,8 +19,6 @@ import scala.collection.immutable.Seq import scala.concurrent.Future import scala.concurrent.Promise -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.Done import pekko.NotUsed @@ -36,6 +34,8 @@ import pekko.stream.testkit.Utils.TE import pekko.testkit.DefaultTimeout import pekko.testkit.TestProbe +import org.scalatest.concurrent.ScalaFutures + class LazySourceSpec extends StreamSpec with DefaultTimeout with ScalaFutures { import system.dispatcher diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/QueueSourceSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/QueueSourceSpec.scala index aa970ad0cb..77ee27a341 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/QueueSourceSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/QueueSourceSpec.scala @@ -17,8 +17,6 @@ import scala.annotation.nowarn import scala.concurrent._ import scala.concurrent.duration._ -import org.scalatest.time.Span - import org.apache.pekko import pekko.Done import pekko.actor.Status @@ -32,6 +30,8 @@ import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink import pekko.testkit.TestProbe +import org.scalatest.time.Span + class QueueSourceSpec extends StreamSpec { implicit val ec: ExecutionContextExecutor = system.dispatcher val pause = 300.millis diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/RetryFlowSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/RetryFlowSpec.scala index 5918b40a09..adb86de4b6 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/RetryFlowSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/RetryFlowSpec.scala @@ -16,14 +16,14 @@ package org.apache.pekko.stream.scaladsl import scala.concurrent.duration._ import scala.util.{ Failure, Success, Try } -import org.scalatest.matchers.{ MatchResult, Matcher } - import org.apache.pekko import pekko.NotUsed import pekko.stream.OverflowStrategy import pekko.stream.testkit.{ StreamSpec, TestPublisher, TestSubscriber } import pekko.stream.testkit.scaladsl.{ TestSink, TestSource } +import org.scalatest.matchers.{ MatchResult, Matcher } + class RetryFlowSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 1 pekko.stream.materializer.max-input-buffer-size = 1 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 e5f0202b5c..a14ef9c37a 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 @@ -18,7 +18,6 @@ import scala.concurrent.{ Await, Future } import scala.concurrent.duration._ import org.apache.pekko -import org.scalatest.concurrent.ScalaFutures import pekko.Done import pekko.stream._ import pekko.stream.testkit._ @@ -27,6 +26,8 @@ import pekko.testkit.DefaultTimeout import org.reactivestreams.Publisher +import org.scalatest.concurrent.ScalaFutures + class SinkSpec extends StreamSpec with DefaultTimeout with ScalaFutures { import GraphDSL.Implicits._ diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceFromPublisherSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceFromPublisherSpec.scala index 9621a917e0..1d16dacb6a 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceFromPublisherSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceFromPublisherSpec.scala @@ -13,15 +13,15 @@ package org.apache.pekko.stream.scaladsl -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AsyncWordSpecLike - import org.apache.pekko import pekko.actor.ActorSystem import pekko.stream.Attributes import pekko.stream.testkit.TestPublisher import pekko.testkit.TestKit +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AsyncWordSpecLike + class SourceFromPublisherSpec extends TestKit(ActorSystem("source-from-publisher-spec")) with AsyncWordSpecLike diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala index 7d43d22afe..7bff2aa6cc 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala @@ -26,9 +26,6 @@ import java.util.stream.Collectors import scala.concurrent.Await import scala.concurrent.duration._ -import org.scalatest.time.Millis -import org.scalatest.time.Span - import org.apache.pekko import pekko.stream.ActorAttributes import pekko.stream.testkit.StreamSpec @@ -36,6 +33,9 @@ import pekko.stream.testkit.Utils.TE import pekko.testkit.DefaultTimeout import pekko.util.ByteString +import org.scalatest.time.Millis +import org.scalatest.time.Span + class StreamConvertersSpec extends StreamSpec with DefaultTimeout { implicit val config: PatienceConfig = PatienceConfig(timeout = Span(timeout.duration.toMillis, Millis)) diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamRefsSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamRefsSpec.scala index 796e3d31a5..da6f2e9f51 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamRefsSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamRefsSpec.scala @@ -19,8 +19,6 @@ import scala.concurrent.Promise import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import com.typesafe.config._ - import org.apache.pekko import pekko.{ Done, NotUsed } import pekko.actor.{ Actor, ActorIdentity, ActorLogging, ActorRef, ActorSystem, ActorSystemImpl, Identify, Props } @@ -34,6 +32,8 @@ import pekko.stream.testkit.scaladsl._ import pekko.testkit.{ PekkoSpec, TestKit, TestProbe } import pekko.util.ByteString +import com.typesafe.config._ + object StreamRefsSpec { object DataSourceActor { diff --git a/stream/src/main/scala/com/typesafe/sslconfig/pekko/PekkoSSLConfig.scala b/stream/src/main/scala/com/typesafe/sslconfig/pekko/PekkoSSLConfig.scala index fb520b9fc9..338d206cfc 100644 --- a/stream/src/main/scala/com/typesafe/sslconfig/pekko/PekkoSSLConfig.scala +++ b/stream/src/main/scala/com/typesafe/sslconfig/pekko/PekkoSSLConfig.scala @@ -15,14 +15,17 @@ package com.typesafe.sslconfig.pekko import java.util.Collections import javax.net.ssl._ -import com.typesafe.sslconfig.pekko.util.PekkoLoggerFactory -import com.typesafe.sslconfig.ssl._ -import com.typesafe.sslconfig.util.LoggerFactory + +import scala.annotation.nowarn + import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi import pekko.event.Logging -import scala.annotation.nowarn + +import com.typesafe.sslconfig.pekko.util.PekkoLoggerFactory +import com.typesafe.sslconfig.ssl._ +import com.typesafe.sslconfig.util.LoggerFactory @deprecated("Use Tcp and TLS with SSLEngine parameters instead. Setup the SSLEngine with needed parameters.", "Akka 2.6.0") diff --git a/stream/src/main/scala/com/typesafe/sslconfig/pekko/util/PekkoLoggerBridge.scala b/stream/src/main/scala/com/typesafe/sslconfig/pekko/util/PekkoLoggerBridge.scala index 785548d3ab..c9b2a6307f 100644 --- a/stream/src/main/scala/com/typesafe/sslconfig/pekko/util/PekkoLoggerBridge.scala +++ b/stream/src/main/scala/com/typesafe/sslconfig/pekko/util/PekkoLoggerBridge.scala @@ -13,13 +13,13 @@ package com.typesafe.sslconfig.pekko.util -import com.typesafe.sslconfig.util.{ LoggerFactory, NoDepsLogger } - import org.apache.pekko import pekko.actor.ActorSystem import pekko.event.{ DummyClassForStringSources, EventStream } import pekko.event.Logging._ +import com.typesafe.sslconfig.util.{ LoggerFactory, NoDepsLogger } + final class PekkoLoggerFactory(system: ActorSystem) extends LoggerFactory { override def apply(clazz: Class[_]): NoDepsLogger = new PekkoLoggerBridge(system.eventStream, clazz) diff --git a/stream/src/main/scala/org/apache/pekko/stream/ActorMaterializer.scala b/stream/src/main/scala/org/apache/pekko/stream/ActorMaterializer.scala index 7e7a8fdfd9..baf70d9e2f 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/ActorMaterializer.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/ActorMaterializer.scala @@ -15,13 +15,10 @@ package org.apache.pekko.stream import java.util.concurrent.TimeUnit +import scala.annotation.nowarn import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import scala.annotation.nowarn -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorContext import pekko.actor.ActorRef @@ -36,6 +33,9 @@ import pekko.stream.impl._ import pekko.stream.stage.GraphStageLogic import pekko.util.Helpers.toRootLowerCase +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object ActorMaterializer { /** diff --git a/stream/src/main/scala/org/apache/pekko/stream/IOResult.scala b/stream/src/main/scala/org/apache/pekko/stream/IOResult.scala index 71d48c8e76..bc764cd17c 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/IOResult.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/IOResult.scala @@ -13,11 +13,10 @@ package org.apache.pekko.stream +import scala.annotation.nowarn import scala.util.{ Failure, Success, Try } import scala.util.control.NoStackTrace -import scala.annotation.nowarn - import org.apache.pekko import pekko.Done diff --git a/stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala b/stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala index 4ce63a6cbf..6bdbccbf8f 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala @@ -19,8 +19,8 @@ package org.apache.pekko.stream import scala.collection.mutable import scala.concurrent.Future -import scala.util.control.{ NoStackTrace, NonFatal } import scala.util.{ Failure, Success, Try } +import scala.util.control.{ NoStackTrace, NonFatal } import org.apache.pekko import pekko.annotation.InternalApi diff --git a/stream/src/main/scala/org/apache/pekko/stream/Materializer.scala b/stream/src/main/scala/org/apache/pekko/stream/Materializer.scala index 1ca121276b..257ab27b33 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/Materializer.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/Materializer.scala @@ -13,11 +13,10 @@ package org.apache.pekko.stream +import scala.annotation.{ implicitNotFound, nowarn } import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration.FiniteDuration -import scala.annotation.{ implicitNotFound, nowarn } - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem diff --git a/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala b/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala index 11dde625ac..e7fb56b61a 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.event.Logging import pekko.event.Logging.LogLevel diff --git a/stream/src/main/scala/org/apache/pekko/stream/StreamRefSettings.scala b/stream/src/main/scala/org/apache/pekko/stream/StreamRefSettings.scala index c1755419c6..8c9356eecb 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/StreamRefSettings.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/StreamRefSettings.scala @@ -15,16 +15,16 @@ package org.apache.pekko.stream import java.util.concurrent.TimeUnit -import scala.concurrent.duration._ - import scala.annotation.nowarn -import com.typesafe.config.Config +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.ActorSystem import pekko.annotation.DoNotInherit import pekko.stream.impl.streamref.StreamRefSettingsImpl +import com.typesafe.config.Config + @nowarn("msg=deprecated") object StreamRefSettings { diff --git a/stream/src/main/scala/org/apache/pekko/stream/StreamTimeoutException.scala b/stream/src/main/scala/org/apache/pekko/stream/StreamTimeoutException.scala index 9be91f9967..f91ae71ec9 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/StreamTimeoutException.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/StreamTimeoutException.scala @@ -17,12 +17,12 @@ package org.apache.pekko.stream -import org.apache.pekko -import pekko.annotation.DoNotInherit - import scala.concurrent.TimeoutException import scala.util.control.NoStackTrace +import org.apache.pekko +import pekko.annotation.DoNotInherit + /** * Base class for timeout exceptions specific to Pekko Streams * diff --git a/stream/src/main/scala/org/apache/pekko/stream/SubscriptionWithCancelException.scala b/stream/src/main/scala/org/apache/pekko/stream/SubscriptionWithCancelException.scala index 3d6b742a77..d77de598f8 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/SubscriptionWithCancelException.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/SubscriptionWithCancelException.scala @@ -15,10 +15,10 @@ package org.apache.pekko.stream import scala.util.control.NoStackTrace -import org.reactivestreams.Subscription - import org.apache.pekko.annotation.DoNotInherit +import org.reactivestreams.Subscription + /** * Extension of Subscription that allows to pass a cause when a subscription is cancelled. * diff --git a/stream/src/main/scala/org/apache/pekko/stream/SubstreamCancelStrategy.scala b/stream/src/main/scala/org/apache/pekko/stream/SubstreamCancelStrategy.scala index 563ee91f61..7f74ac764e 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/SubstreamCancelStrategy.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/SubstreamCancelStrategy.scala @@ -13,10 +13,10 @@ package org.apache.pekko.stream -import SubstreamCancelStrategies._ - import scala.annotation.nowarn +import SubstreamCancelStrategies._ + /** * Represents a strategy that decides how to deal with substream events. */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/SystemMaterializer.scala b/stream/src/main/scala/org/apache/pekko/stream/SystemMaterializer.scala index 3c82b8d611..efd829d47d 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/SystemMaterializer.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/SystemMaterializer.scala @@ -13,11 +13,10 @@ package org.apache.pekko.stream +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.Promise -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.ClassicActorSystemProvider diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorMaterializerImpl.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorMaterializerImpl.scala index aaa4d83f17..214f333345 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorMaterializerImpl.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorMaterializerImpl.scala @@ -15,10 +15,11 @@ package org.apache.pekko.stream.impl import java.util.concurrent.atomic.AtomicBoolean +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration._ -import scala.annotation.nowarn + import org.apache.pekko import pekko.actor._ import pekko.annotation.DoNotInherit diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorProcessor.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorProcessor.scala index b3ad62e6e9..486db489ed 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorProcessor.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorProcessor.scala @@ -13,8 +13,6 @@ package org.apache.pekko.stream.impl -import org.reactivestreams.{ Processor, Subscriber, Subscription } - import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi @@ -24,6 +22,8 @@ import pekko.stream.ActorAttributes import pekko.stream.impl.ActorSubscriberMessage.{ OnComplete, OnError, OnNext, OnSubscribe } import pekko.util.unused +import org.reactivestreams.{ Processor, Subscriber, Subscription } + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorPublisher.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorPublisher.scala index f1c0898016..22cac866ab 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorPublisher.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorPublisher.scala @@ -19,13 +19,13 @@ import scala.annotation.tailrec import scala.collection.immutable import scala.util.control.NoStackTrace -import org.reactivestreams.{ Publisher, Subscriber } -import org.reactivestreams.Subscription - import org.apache.pekko import pekko.actor.{ Actor, ActorRef, Terminated } import pekko.annotation.InternalApi +import org.reactivestreams.{ Publisher, Subscriber } +import org.reactivestreams.Subscription + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefBackpressureSinkStage.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefBackpressureSinkStage.scala index 37f266de9b..c5224843c5 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefBackpressureSinkStage.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefBackpressureSinkStage.scala @@ -13,16 +13,16 @@ package org.apache.pekko.stream.impl +import java.util + import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi -import pekko.stream.Attributes.InputBuffer import pekko.stream._ +import pekko.stream.Attributes.InputBuffer import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.stage._ -import java.util - /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorSubscriberMessage.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorSubscriberMessage.scala index 6a63dd1a30..43737bdad0 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/ActorSubscriberMessage.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/ActorSubscriberMessage.scala @@ -13,13 +13,13 @@ package org.apache.pekko.stream.impl -import org.reactivestreams.Subscription - import org.apache.pekko import pekko.actor.DeadLetterSuppression import pekko.actor.NoSerializationVerificationNeeded import pekko.annotation.InternalApi +import org.reactivestreams.Subscription + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/Buffers.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/Buffers.scala index 00ff34bac0..8e377bd4bc 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/Buffers.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/Buffers.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream.impl import java.{ util => ju } + import org.apache.pekko import pekko.annotation.{ InternalApi, InternalStableApi } import pekko.stream._ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/CompletedPublishers.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/CompletedPublishers.scala index 87a7c0b5d5..32bda040aa 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/CompletedPublishers.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/CompletedPublishers.scala @@ -13,10 +13,10 @@ package org.apache.pekko.stream.impl -import org.reactivestreams.{ Publisher, Subscriber, Subscription } - import org.apache.pekko.annotation.InternalApi +import org.reactivestreams.{ Publisher, Subscriber, Subscription } + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/FanIn.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/FanIn.scala index b8a24f6803..d7b5d4fa42 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/FanIn.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/FanIn.scala @@ -13,8 +13,6 @@ package org.apache.pekko.stream.impl -import org.reactivestreams.{ Subscriber, Subscription } - import org.apache.pekko import pekko.actor._ import pekko.annotation.{ DoNotInherit, InternalApi } @@ -23,6 +21,8 @@ import pekko.stream.ActorAttributes import pekko.stream.Attributes import pekko.util.unused +import org.reactivestreams.{ Subscriber, Subscription } + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/FanOut.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/FanOut.scala index 68a94f9b1c..90a175a07e 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/FanOut.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/FanOut.scala @@ -15,8 +15,6 @@ package org.apache.pekko.stream.impl import scala.collection.immutable -import org.reactivestreams.Subscription - import org.apache.pekko import pekko.actor._ import pekko.annotation.{ DoNotInherit, InternalApi } @@ -25,6 +23,8 @@ import pekko.stream.ActorAttributes import pekko.stream.Attributes import pekko.util.unused +import org.reactivestreams.Subscription + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/FanoutProcessor.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/FanoutProcessor.scala index 62d1ce4ab1..d217f7b873 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/FanoutProcessor.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/FanoutProcessor.scala @@ -13,8 +13,6 @@ package org.apache.pekko.stream.impl -import org.reactivestreams.Subscriber - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -26,6 +24,8 @@ import pekko.stream.Attributes import pekko.stream.StreamSubscriptionTimeoutTerminationMode import pekko.util.OptionVal +import org.reactivestreams.Subscriber + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/JsonObjectParser.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/JsonObjectParser.scala index 860ecc2c4b..e5b9c35b95 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/JsonObjectParser.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/JsonObjectParser.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream.impl import scala.annotation.switch + import org.apache.pekko import pekko.annotation.InternalApi import pekko.stream.scaladsl.Framing.FramingException diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/LazySource.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/LazySource.scala index 35fe8fcf4e..dc68fc139f 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/LazySource.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/LazySource.scala @@ -15,10 +15,11 @@ package org.apache.pekko.stream.impl import scala.concurrent.{ Future, Promise } import scala.util.control.NonFatal + import org.apache.pekko import pekko.annotation.InternalApi -import pekko.stream.Attributes.SourceLocation import pekko.stream._ +import pekko.stream.Attributes.SourceLocation import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.scaladsl.{ Keep, Source } import pekko.stream.stage._ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/MaterializerGuardian.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/MaterializerGuardian.scala index 8a1861ba8e..c200bbf651 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/MaterializerGuardian.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/MaterializerGuardian.scala @@ -13,9 +13,8 @@ package org.apache.pekko.stream.impl -import scala.concurrent.Promise - import scala.annotation.nowarn +import scala.concurrent.Promise import org.apache.pekko import pekko.actor.Actor diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/Modules.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/Modules.scala index e57eb9731c..0f9574a101 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/Modules.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/Modules.scala @@ -15,8 +15,6 @@ package org.apache.pekko.stream.impl import scala.annotation.unchecked.uncheckedVariance -import org.reactivestreams._ - import org.apache.pekko import pekko.NotUsed import pekko.annotation.{ DoNotInherit, InternalApi } @@ -24,6 +22,8 @@ import pekko.event.Logging import pekko.stream._ import pekko.stream.impl.StreamLayout.AtomicModule +import org.reactivestreams._ + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala index 0bd9f06705..81bd562bc3 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala @@ -16,15 +16,11 @@ package org.apache.pekko.stream.impl import java.util import java.util.concurrent.atomic.AtomicBoolean +import scala.annotation.nowarn import scala.collection.immutable.Map import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration.FiniteDuration -import scala.annotation.nowarn -import org.reactivestreams.Processor -import org.reactivestreams.Publisher -import org.reactivestreams.Subscriber - import org.apache.pekko import pekko.NotUsed import pekko.actor.ActorContext @@ -55,6 +51,10 @@ import pekko.stream.stage.InHandler import pekko.stream.stage.OutHandler import pekko.util.OptionVal +import org.reactivestreams.Processor +import org.reactivestreams.Publisher +import org.reactivestreams.Subscriber + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/ReactiveStreamsCompliance.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/ReactiveStreamsCompliance.scala index b604c88fc2..6541f362c2 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/ReactiveStreamsCompliance.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/ReactiveStreamsCompliance.scala @@ -15,12 +15,12 @@ package org.apache.pekko.stream.impl import scala.util.control.NonFatal -import org.reactivestreams.{ Subscriber, Subscription } - import org.apache.pekko import pekko.annotation.InternalApi import pekko.stream.SubscriptionWithCancelException +import org.reactivestreams.{ Subscriber, Subscription } + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/SetupStage.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/SetupStage.scala index dd8a43c642..b6efde68a1 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/SetupStage.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/SetupStage.scala @@ -16,10 +16,11 @@ package org.apache.pekko.stream.impl import scala.concurrent.Future import scala.concurrent.Promise import scala.util.control.NonFatal + import org.apache.pekko import pekko.annotation.InternalApi -import pekko.stream.Attributes.SourceLocation import pekko.stream._ +import pekko.stream.Attributes.SourceLocation import pekko.stream.scaladsl.Flow import pekko.stream.scaladsl.Keep import pekko.stream.scaladsl.Sink diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/SinkholeSubscriber.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/SinkholeSubscriber.scala index f24b563912..4fd02e2162 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/SinkholeSubscriber.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/SinkholeSubscriber.scala @@ -15,12 +15,12 @@ package org.apache.pekko.stream.impl import scala.concurrent.Promise -import org.reactivestreams.{ Subscriber, Subscription } - import org.apache.pekko import pekko.Done import pekko.annotation.InternalApi +import org.reactivestreams.{ Subscriber, Subscription } + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala index b2605aac4c..380b27e2db 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream.impl import java.util.function.BinaryOperator + import scala.collection.immutable import scala.collection.mutable import scala.concurrent.Future @@ -22,8 +23,7 @@ import scala.util.Failure import scala.util.Success import scala.util.Try import scala.util.control.NonFatal -import org.reactivestreams.Publisher -import org.reactivestreams.Subscriber + import org.apache.pekko import pekko.NotUsed import pekko.annotation.DoNotInherit @@ -42,6 +42,9 @@ import pekko.stream.scaladsl.{ Keep, Sink, SinkQueueWithCancel, Source } import pekko.stream.stage._ import pekko.util.ccompat._ +import org.reactivestreams.Publisher +import org.reactivestreams.Subscriber + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala index f947840ea4..d1b3506f76 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala @@ -18,17 +18,17 @@ import java.util.concurrent.atomic.AtomicReference import scala.annotation.tailrec import scala.util.control.NonFatal -import org.reactivestreams.Processor -import org.reactivestreams.Publisher -import org.reactivestreams.Subscriber -import org.reactivestreams.Subscription - import org.apache.pekko import pekko.annotation.InternalApi import pekko.stream._ import pekko.stream.impl.Stages.DefaultAttributes import pekko.util.OptionVal +import org.reactivestreams.Processor +import org.reactivestreams.Publisher +import org.reactivestreams.Subscriber +import org.reactivestreams.Subscription + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/StreamSubscriptionTimeout.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/StreamSubscriptionTimeout.scala index b8ce5b44cf..9998c1e026 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/StreamSubscriptionTimeout.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/StreamSubscriptionTimeout.scala @@ -13,18 +13,18 @@ package org.apache.pekko.stream.impl +import scala.annotation.nowarn import scala.concurrent.duration.FiniteDuration import scala.util.control.NoStackTrace -import scala.annotation.nowarn -import org.reactivestreams._ - import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi import pekko.stream.StreamSubscriptionTimeoutSettings import pekko.stream.StreamSubscriptionTimeoutTerminationMode.{ CancelTermination, NoopTermination, WarnTermination } +import org.reactivestreams._ + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/Throttle.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/Throttle.scala index 751cfbfa1c..c2c04aede9 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/Throttle.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/Throttle.scala @@ -13,16 +13,16 @@ package org.apache.pekko.stream.impl +import scala.concurrent.duration.{ FiniteDuration, _ } + import org.apache.pekko import pekko.annotation.InternalApi -import pekko.stream.ThrottleMode.Enforcing import pekko.stream._ +import pekko.stream.ThrottleMode.Enforcing import pekko.stream.impl.fusing.GraphStages.SimpleLinearGraphStage import pekko.stream.stage._ import pekko.util.NanoTimeTokenBucket -import scala.concurrent.duration.{ FiniteDuration, _ } - /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/Unfold.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/Unfold.scala index ea6a525ec4..546bdf4f9a 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/Unfold.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/Unfold.scala @@ -13,6 +13,12 @@ package org.apache.pekko.stream.impl +import java.util.Optional +import java.util.concurrent.CompletionStage + +import scala.concurrent.Future +import scala.util.{ Failure, Success, Try } + import org.apache.pekko import pekko.annotation.InternalApi import pekko.japi.{ function, Pair } @@ -20,11 +26,6 @@ import pekko.stream._ import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.stage.{ GraphStage, GraphStageLogic, OutHandler } -import java.util.Optional -import java.util.concurrent.CompletionStage -import scala.concurrent.Future -import scala.util.{ Failure, Success, Try } - /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala index 8431e4afd3..7f783be6e8 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala @@ -13,19 +13,19 @@ package org.apache.pekko.stream.impl +import scala.concurrent.{ ExecutionContext, Future } +import scala.util.{ Failure, Success, Try } +import scala.util.control.NonFatal + import org.apache.pekko import pekko.Done import pekko.annotation.InternalApi import pekko.dispatch.ExecutionContexts.parasitic -import pekko.stream.ActorAttributes.SupervisionStrategy import pekko.stream._ +import pekko.stream.ActorAttributes.SupervisionStrategy import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.stage._ -import scala.concurrent.{ ExecutionContext, Future } -import scala.util.control.NonFatal -import scala.util.{ Failure, Success, Try } - /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/ActorGraphInterpreter.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/ActorGraphInterpreter.scala index ecd398e129..ad5f3b325a 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/ActorGraphInterpreter.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/ActorGraphInterpreter.scala @@ -22,10 +22,6 @@ import scala.collection.immutable import scala.concurrent.Promise import scala.util.control.NonFatal -import org.reactivestreams.Publisher -import org.reactivestreams.Subscriber -import org.reactivestreams.Subscription - import org.apache.pekko import pekko.Done import pekko.actor._ @@ -45,6 +41,10 @@ import pekko.stream.stage.InHandler import pekko.stream.stage.OutHandler import pekko.util.OptionVal +import org.reactivestreams.Publisher +import org.reactivestreams.Subscriber +import org.reactivestreams.Subscription + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/AggregateWithBoundary.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/AggregateWithBoundary.scala index 44ff9b2edf..79b547c4db 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/AggregateWithBoundary.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/AggregateWithBoundary.scala @@ -13,13 +13,13 @@ package org.apache.pekko.stream.impl.fusing +import scala.concurrent.duration._ + import org.apache.pekko import pekko.annotation.InternalApi import pekko.stream.{ Attributes, FlowShape, Inlet, Outlet } import pekko.stream.stage.{ GraphStage, GraphStageLogic, InHandler, OutHandler, TimerGraphStageLogic } -import scala.concurrent.duration._ - /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlatMapPrefix.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlatMapPrefix.scala index 9894870c63..c3672ae1ea 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlatMapPrefix.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlatMapPrefix.scala @@ -16,10 +16,11 @@ package org.apache.pekko.stream.impl.fusing import scala.collection.immutable import scala.concurrent.{ Future, Promise } import scala.util.control.NonFatal + import org.apache.pekko import pekko.annotation.InternalApi -import pekko.stream.Attributes.SourceLocation import pekko.stream._ +import pekko.stream.Attributes.SourceLocation import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.scaladsl.{ Flow, Keep, Source } import pekko.stream.stage.{ GraphStageLogic, GraphStageWithMaterializedValue, InHandler, OutHandler } diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FutureFlow.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FutureFlow.scala index ac50936f85..6535747d97 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FutureFlow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FutureFlow.scala @@ -13,11 +13,13 @@ package org.apache.pekko.stream.impl.fusing +import scala.concurrent.{ Future, Promise } +import scala.util.{ Failure, Success, Try } +import scala.util.control.NonFatal + import org.apache.pekko import pekko.annotation.InternalApi import pekko.dispatch.ExecutionContexts -import pekko.stream.Attributes.SourceLocation -import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.{ AbruptStageTerminationException, Attributes, @@ -26,14 +28,12 @@ import pekko.stream.{ NeverMaterializedException, Outlet } +import pekko.stream.Attributes.SourceLocation +import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.scaladsl.{ Flow, Keep, Source } import pekko.stream.stage.{ GraphStageLogic, GraphStageWithMaterializedValue, InHandler, OutHandler } import pekko.util.OptionVal -import scala.concurrent.{ Future, Promise } -import scala.util.control.NonFatal -import scala.util.{ Failure, Success, Try } - @InternalApi private[pekko] final class FutureFlow[In, Out, M](futureFlow: Future[Flow[In, Out, M]]) extends GraphStageWithMaterializedValue[FlowShape[In, Out], Future[M]] { diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala index 94abf377ef..aba8c7f680 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala @@ -15,10 +15,12 @@ package org.apache.pekko.stream.impl.fusing import java.util.Collections import java.util.concurrent.atomic.AtomicReference + import scala.annotation.{ nowarn, tailrec } import scala.collection.immutable import scala.concurrent.duration.FiniteDuration import scala.util.control.NonFatal + import org.apache.pekko import pekko.NotUsed import pekko.annotation.InternalApi @@ -26,8 +28,8 @@ import pekko.stream._ import pekko.stream.ActorAttributes.StreamSubscriptionTimeout import pekko.stream.ActorAttributes.SupervisionStrategy import pekko.stream.Attributes.SourceLocation -import pekko.stream.impl.{ Buffer => BufferImpl } import pekko.stream.Supervision.Decider +import pekko.stream.impl.{ Buffer => BufferImpl } import pekko.stream.impl.ActorSubscriberMessage import pekko.stream.impl.ActorSubscriberMessage.OnError import pekko.stream.impl.Stages.DefaultAttributes diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala index f275efae4d..4d9087cedf 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala @@ -14,7 +14,6 @@ package org.apache.pekko.stream.impl.io import java.nio.ByteBuffer - import javax.net.ssl._ import javax.net.ssl.SSLEngineResult.HandshakeStatus import javax.net.ssl.SSLEngineResult.HandshakeStatus._ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala index b9282d48ba..d9cfeabfa0 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala @@ -17,10 +17,10 @@ import java.net.InetSocketAddress import java.util.concurrent.TimeoutException import java.util.concurrent.atomic.{ AtomicBoolean, AtomicLong } +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.{ Future, Promise } import scala.concurrent.duration.{ Duration, FiniteDuration } -import scala.annotation.nowarn import org.apache.pekko import pekko.{ Done, NotUsed } diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/streamref/SinkRefImpl.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/streamref/SinkRefImpl.scala index 9b9575947a..848c1efbe7 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/streamref/SinkRefImpl.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/streamref/SinkRefImpl.scala @@ -13,9 +13,8 @@ package org.apache.pekko.stream.impl.streamref -import scala.util.{ Failure, Success, Try } - import scala.annotation.nowarn +import scala.util.{ Failure, Success, Try } import org.apache.pekko import pekko.Done diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/BidiFlow.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/BidiFlow.scala index 809dbebdca..98dd59fcbb 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/BidiFlow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/BidiFlow.scala @@ -13,9 +13,8 @@ package org.apache.pekko.stream.javadsl -import scala.concurrent.duration.FiniteDuration - import scala.annotation.nowarn +import scala.concurrent.duration.FiniteDuration import org.apache.pekko import pekko.NotUsed diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/FileIO.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/FileIO.scala index b76a406718..ebab976d0e 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/FileIO.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/FileIO.scala @@ -20,10 +20,10 @@ import java.util.concurrent.CompletionStage import org.apache.pekko import pekko.stream.{ javadsl, scaladsl, IOResult } -import pekko.util.ByteString -import pekko.util.ccompat.JavaConverters._ import pekko.stream.scaladsl.SinkToCompletionStage import pekko.stream.scaladsl.SourceToCompletionStage +import pekko.util.ByteString +import pekko.util.ccompat.JavaConverters._ /** * Java API: Factories to create sinks and sources from files diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala index 44dbeaaead..2e772e1ffc 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala @@ -23,9 +23,9 @@ import pekko.event.{ LogMarker, LoggingAdapter, MarkerLoggingAdapter } import pekko.japi.{ function, Pair, Util } import pekko.stream._ import pekko.util.ConstantFun -import pekko.util.ccompat.JavaConverters._ import pekko.util.FutureConverters._ import pekko.util.JavaDurationConverters._ +import pekko.util.ccompat.JavaConverters._ object FlowWithContext { diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala index d7f5cd9740..be492a1dc9 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream.javadsl import java.util.function.{ BiFunction, Supplier, ToLongBiFunction } + import org.apache.pekko import pekko.NotUsed import pekko.annotation.DoNotInherit diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala index 8b77a813d5..b825ec0b47 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala @@ -26,9 +26,9 @@ import pekko.japi.Util import pekko.japi.function import pekko.stream._ import pekko.util.ConstantFun -import pekko.util.ccompat.JavaConverters._ import pekko.util.FutureConverters._ import pekko.util.JavaDurationConverters._ +import pekko.util.ccompat.JavaConverters._ object SourceWithContext { diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/StreamConverters.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/StreamConverters.scala index 6ef3945d66..c400ca844d 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/StreamConverters.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/StreamConverters.scala @@ -17,18 +17,17 @@ import java.io.{ InputStream, OutputStream } import java.util.concurrent.CompletionStage import java.util.stream.Collector -import scala.concurrent.duration.FiniteDuration - import scala.annotation.nowarn +import scala.concurrent.duration.FiniteDuration import org.apache.pekko import pekko.NotUsed import pekko.japi.function import pekko.stream.{ javadsl, scaladsl } import pekko.stream.IOResult -import pekko.util.ByteString import pekko.stream.scaladsl.SinkToCompletionStage import pekko.stream.scaladsl.SourceToCompletionStage +import pekko.util.ByteString /** * Converters for interacting with the blocking `java.io` streams APIs and Java 8 Streams diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/TLS.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/TLS.scala index f5066eaa30..ae2341a3d7 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/TLS.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/TLS.scala @@ -19,8 +19,6 @@ import javax.net.ssl.{ SSLContext, SSLEngine, SSLSession } import scala.util.Try -import com.typesafe.sslconfig.pekko.PekkoSSLConfig - import org.apache.pekko import pekko.{ japi, NotUsed } import pekko.stream._ @@ -28,6 +26,8 @@ import pekko.stream.TLSProtocol._ import pekko.util.ByteString import pekko.util.OptionConverters._ +import com.typesafe.sslconfig.pekko.PekkoSSLConfig + /** * Stream cipher support based upon JSSE. * 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 50a802aa6e..3a82dd001c 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 @@ -23,12 +23,11 @@ import javax.net.ssl.SSLContext import javax.net.ssl.SSLEngine import javax.net.ssl.SSLSession +import scala.annotation.nowarn import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success -import scala.annotation.nowarn - import org.apache.pekko import pekko.{ Done, NotUsed } import pekko.actor.ActorSystem diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/BidiFlow.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/BidiFlow.scala index e756f83353..ece8f6c660 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/BidiFlow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/BidiFlow.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream.scaladsl import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.NotUsed import pekko.stream.{ BidiShape, _ } diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Flow.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Flow.scala index bdd6ea1b5a..fef56ceda6 100755 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Flow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Flow.scala @@ -36,6 +36,7 @@ import pekko.stream.impl.LinearTraversalBuilder import pekko.stream.impl.ProcessorModule import pekko.stream.impl.SetupFlowStage import pekko.stream.impl.SingleConcat +import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.impl.SubFlowImpl import pekko.stream.impl.Throttle import pekko.stream.impl.Timers @@ -43,7 +44,6 @@ import pekko.stream.impl.TraversalBuilder import pekko.stream.impl.fusing import pekko.stream.impl.fusing._ import pekko.stream.impl.fusing.FlattenMerge -import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.stage._ import pekko.util.ConstantFun import pekko.util.OptionVal diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContext.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContext.scala index 8925afc47a..b2e9bced04 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContext.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContext.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream.scaladsl import scala.annotation.unchecked.uncheckedVariance + import org.apache.pekko import pekko.NotUsed import pekko.japi.Pair diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContextOps.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContextOps.scala index 6c12dd4344..cd700c8879 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContextOps.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContextOps.scala @@ -17,6 +17,7 @@ import scala.annotation.unchecked.uncheckedVariance import scala.collection.immutable import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.NotUsed import pekko.annotation.ApiMayChange @@ -24,8 +25,8 @@ import pekko.dispatch.ExecutionContexts import pekko.event.{ LogMarker, LoggingAdapter, MarkerLoggingAdapter } import pekko.stream._ import pekko.stream.impl.Throttle -import pekko.util.{ ccompat, ConstantFun } -import ccompat._ +import pekko.util.ConstantFun +import pekko.util.ccompat._ /** * Shared stream operations for [[FlowWithContext]] and [[SourceWithContext]] that automatically propagate a context diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala index f336d961f7..cf3a9710e8 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala @@ -18,12 +18,14 @@ import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.{ AtomicLong, AtomicReference } import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicReferenceArray + import scala.annotation.tailrec import scala.collection.immutable import scala.collection.immutable.Queue import scala.collection.mutable.LongMap import scala.concurrent.{ Future, Promise } import scala.util.{ Failure, Success, Try } + import org.apache.pekko import pekko.NotUsed import pekko.annotation.DoNotInherit diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/JsonFraming.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/JsonFraming.scala index 931daad04c..b77470ff70 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/JsonFraming.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/JsonFraming.scala @@ -13,6 +13,8 @@ package org.apache.pekko.stream.scaladsl +import scala.util.control.NonFatal + import org.apache.pekko import pekko.NotUsed import pekko.stream.Attributes @@ -22,8 +24,6 @@ import pekko.stream.scaladsl.Framing.FramingException import pekko.stream.stage.{ GraphStageLogic, InHandler, OutHandler } import pekko.util.ByteString -import scala.util.control.NonFatal - /** Provides JSON framing operators that can separate valid JSON objects from incoming [[pekko.util.ByteString]] objects. */ object JsonFraming { diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/RestartSink.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/RestartSink.scala index ea1c3baa06..02743ce1ef 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/RestartSink.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/RestartSink.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.scaladsl +import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.NotUsed -import pekko.stream.stage.{ GraphStage, GraphStageLogic } import pekko.stream.{ Attributes, Inlet, RestartSettings, SinkShape } - -import scala.concurrent.duration.FiniteDuration +import pekko.stream.stage.{ GraphStage, GraphStageLogic } /** * A RestartSink wraps a [[Sink]] that gets restarted when it completes or fails. diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/RestartSource.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/RestartSource.scala index 2c845f691b..aba594accd 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/RestartSource.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/RestartSource.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.scaladsl +import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.NotUsed -import pekko.stream.stage.{ GraphStage, GraphStageLogic } import pekko.stream.{ Attributes, Outlet, RestartSettings, SourceShape } - -import scala.concurrent.duration.FiniteDuration +import pekko.stream.stage.{ GraphStage, GraphStageLogic } /** * A RestartSource wraps a [[Source]] that gets restarted when it completes or fails. diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/SourceWithContext.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/SourceWithContext.scala index 5ce8bcd752..55a6ce316c 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/SourceWithContext.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/SourceWithContext.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream.scaladsl import scala.annotation.unchecked.uncheckedVariance + import org.apache.pekko import pekko.stream._ 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 698180d92d..d502f7a1f7 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 @@ -19,8 +19,6 @@ import javax.net.ssl.SSLParameters import scala.util.{ Failure, Success, Try } -import com.typesafe.sslconfig.pekko.PekkoSSLConfig - import org.apache.pekko import pekko.NotUsed import pekko.actor.ActorSystem @@ -29,6 +27,8 @@ import pekko.stream.TLSProtocol._ import pekko.stream.impl.io.{ TlsModule, TlsUtils } import pekko.util.ByteString +import com.typesafe.sslconfig.pekko.PekkoSSLConfig + /** * Stream cipher support based upon JSSE. * diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Tcp.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Tcp.scala index ffae14db6a..89f15efbac 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Tcp.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Tcp.scala @@ -18,6 +18,8 @@ import java.util.concurrent.TimeoutException import javax.net.ssl.SSLContext import javax.net.ssl.SSLEngine import javax.net.ssl.SSLSession + +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.Future import scala.concurrent.duration.Duration @@ -25,7 +27,7 @@ import scala.concurrent.duration.FiniteDuration import scala.util.Success import scala.util.Try import scala.util.control.NoStackTrace -import scala.annotation.nowarn + import org.apache.pekko import pekko.Done import pekko.NotUsed diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/package.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/package.scala index e2e2d1806c..e27bea9502 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/package.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/package.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream -import org.apache.pekko.util.FutureConverters._ - import java.util.concurrent.CompletionStage import scala.concurrent.Future +import org.apache.pekko.util.FutureConverters._ + /** * Scala API: The flow DSL allows the formulation of stream transformations based on some * input. The starting point is called [[Source]] and can be a collection, an iterator, diff --git a/stream/src/main/scala/org/apache/pekko/stream/serialization/StreamRefSerializer.scala b/stream/src/main/scala/org/apache/pekko/stream/serialization/StreamRefSerializer.scala index 0f79e9441c..24b9a97c99 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/serialization/StreamRefSerializer.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/serialization/StreamRefSerializer.scala @@ -13,6 +13,8 @@ package org.apache.pekko.stream.serialization +import java.nio.charset.StandardCharsets + import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.InternalApi @@ -22,8 +24,6 @@ import pekko.serialization._ import pekko.stream.StreamRefMessages import pekko.stream.impl.streamref._ -import java.nio.charset.StandardCharsets - /** INTERNAL API */ @InternalApi private[pekko] final class StreamRefSerializer(val system: ExtendedActorSystem)