Skip to content

Commit 5b2aab6

Browse files
Update scalafmt-core to 3.8.4 (#1717)
* Update scalafmt-core to 3.8.4 * Reformat with scalafmt 3.8.4 Executed command: scalafmt --non-interactive * Add 'Reformat with scalafmt 3.8.4' to .git-blame-ignore-revs * remove postfixOps imports Assuming we want to keep the default `rewrite.avoidInfix.excludePostfix = false` - otherwise we can drop this commit --------- Co-authored-by: scala-steward-asf[bot] <147768647+scala-steward-asf[bot]@users.noreply.github.com> Co-authored-by: Arnout Engelen <[email protected]>
1 parent a75bc7a commit 5b2aab6

File tree

126 files changed

+728
-860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+728
-860
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,6 @@ c44c0b7cbdab11d85176cfe062288fdcba16c56a
7676

7777
# Scala Steward: Reformat with scalafmt 3.8.2
7878
38b03829b4e38e983521f3efd7e589d315658f18
79+
80+
# Scala Steward: Reformat with scalafmt 3.8.4
81+
f48453e60a8d11f74acc7a10d3a9da90b8acd4af

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.8.3
1+
version = 3.8.4
22
runner.dialect = scala213
33
project.git = true
44
style = defaultWithAlign

actor-tests/src/test/scala/org/apache/pekko/actor/ActorConfigurationVerificationSpec.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ package org.apache.pekko.actor
1515

1616
import scala.concurrent.duration._
1717

18-
import language.postfixOps
1918
import org.scalatest.BeforeAndAfterEach
2019

2120
import org.apache.pekko
@@ -79,7 +78,7 @@ class ActorConfigurationVerificationSpec
7978
"fail verification with a ConfigurationException if also configured with a ScatterGatherFirstCompletedPool" in {
8079
intercept[ConfigurationException] {
8180
system.actorOf(
82-
ScatterGatherFirstCompletedPool(nrOfInstances = 2, within = 2 seconds)
81+
ScatterGatherFirstCompletedPool(nrOfInstances = 2, within = 2.seconds)
8382
.withDispatcher("balancing-dispatcher")
8483
.props(Props[TestActor]()))
8584
}

actor-tests/src/test/scala/org/apache/pekko/actor/ActorCreationPerfSpec.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package org.apache.pekko.actor
1515

1616
import scala.concurrent.duration._
17-
import scala.language.postfixOps
1817

1918
import com.codahale.metrics.Histogram
2019
import com.typesafe.config.ConfigFactory
@@ -153,10 +152,10 @@ class ActorCreationPerfSpec
153152
expectMsg(Alive)
154153

155154
driver ! Create(number, propsCreator)
156-
expectMsgPF(15 seconds, s"$scenarioName waiting for Created") { case Created => }
155+
expectMsgPF(15.seconds, s"$scenarioName waiting for Created") { case Created => }
157156

158157
driver ! WaitForChildren
159-
expectMsgPF(15 seconds, s"$scenarioName waiting for Waited") { case Waited => }
158+
expectMsgPF(15.seconds, s"$scenarioName waiting for Waited") { case Waited => }
160159

161160
driver ! PoisonPill
162161
watch(driver)
@@ -175,10 +174,10 @@ class ActorCreationPerfSpec
175174
val before = mem.getHeapSnapshot
176175

177176
driver ! Create(number, propsCreator)
178-
expectMsgPF(15 seconds, s"$scenarioName waiting for Created") { case Created => }
177+
expectMsgPF(15.seconds, s"$scenarioName waiting for Created") { case Created => }
179178

180179
driver ! WaitForChildren
181-
expectMsgPF(15 seconds, s"$scenarioName waiting for Waited") { case Waited => }
180+
expectMsgPF(15.seconds, s"$scenarioName waiting for Waited") { case Waited => }
182181

183182
gc()
184183
val after = mem.getHeapSnapshot
@@ -252,5 +251,5 @@ class ActorCreationPerfSpec
252251

253252
override def afterTermination() = shutdownMetrics()
254253

255-
override def expectedTestDuration = 5 minutes
254+
override def expectedTestDuration = 5.minutes
256255
}

actor-tests/src/test/scala/org/apache/pekko/actor/ActorRefSpec.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import scala.concurrent.Await
1919
import scala.concurrent.Promise
2020
import scala.concurrent.duration._
2121

22-
import language.postfixOps
23-
2422
import org.apache.pekko
2523
import pekko.pattern.ask
2624
import pekko.serialization.JavaSerializer
@@ -141,7 +139,7 @@ class ActorRefSpec extends PekkoSpec("""
141139
def wrap[T](f: Promise[Actor] => T): T = {
142140
val result = Promise[Actor]()
143141
val r = f(result)
144-
Await.result(result.future, 1 minute)
142+
Await.result(result.future, 1.minute)
145143
r
146144
}
147145

@@ -448,7 +446,7 @@ class ActorRefSpec extends PekkoSpec("""
448446
val boss = system.actorOf(Props(new Actor {
449447

450448
override val supervisorStrategy =
451-
OneForOneStrategy(maxNrOfRetries = 2, withinTimeRange = 1 second)(List(classOf[Throwable]))
449+
OneForOneStrategy(maxNrOfRetries = 2, withinTimeRange = 1.second)(List(classOf[Throwable]))
452450

453451
val ref = context.actorOf(Props(new Actor {
454452
def receive = { case _ => }
@@ -460,7 +458,7 @@ class ActorRefSpec extends PekkoSpec("""
460458
}))
461459

462460
boss ! "sendKill"
463-
Await.ready(latch, 5 seconds)
461+
Await.ready(latch, 5.seconds)
464462
}
465463
}
466464

actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemSpec.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import java.util.concurrent.atomic.AtomicInteger
1818

1919
import scala.concurrent.{ Await, Future }
2020
import scala.concurrent.duration._
21-
import scala.language.postfixOps
2221

2322
import scala.annotation.nowarn
2423
import com.typesafe.config.{ Config, ConfigFactory }
@@ -224,7 +223,7 @@ class ActorSystemSpec extends PekkoSpec(ActorSystemSpec.config) with ImplicitSen
224223
}
225224

226225
system2.terminate()
227-
Await.ready(latch, 5 seconds)
226+
Await.ready(latch, 5.seconds)
228227

229228
val expected = (for (i <- 1 to count) yield i).reverse
230229

@@ -243,7 +242,7 @@ class ActorSystemSpec extends PekkoSpec(ActorSystemSpec.config) with ImplicitSen
243242
import system.dispatcher
244243
system2.scheduler.scheduleOnce(200.millis.dilated) { system2.terminate() }
245244

246-
Await.ready(system2.whenTerminated, 5 seconds)
245+
Await.ready(system2.whenTerminated, 5.seconds)
247246
callbackWasRun should ===(true)
248247
}
249248

@@ -252,17 +251,17 @@ class ActorSystemSpec extends PekkoSpec(ActorSystemSpec.config) with ImplicitSen
252251
val wt = system.whenTerminated
253252
wt.isCompleted should ===(false)
254253
val f = system.terminate()
255-
val terminated = Await.result(wt, 10 seconds)
254+
val terminated = Await.result(wt, 10.seconds)
256255
system.whenTerminated.isCompleted should ===(true)
257256
terminated.actor should ===(system.provider.rootGuardian)
258257
terminated.addressTerminated should ===(true)
259258
terminated.existenceConfirmed should ===(true)
260-
(terminated should be).theSameInstanceAs(Await.result(f, 10 seconds))
259+
(terminated should be).theSameInstanceAs(Await.result(f, 10.seconds))
261260
}
262261

263262
"throw RejectedExecutionException when shutdown" in {
264263
val system2 = ActorSystem("RejectedExecution-1", PekkoSpec.testConf)
265-
Await.ready(system2.terminate(), 10 seconds)
264+
Await.ready(system2.terminate(), 10.seconds)
266265

267266
intercept[RejectedExecutionException] {
268267
system2.registerOnTermination { println("IF YOU SEE THIS THEN THERE'S A BUG HERE") }
@@ -287,7 +286,7 @@ class ActorSystemSpec extends PekkoSpec(ActorSystemSpec.config) with ImplicitSen
287286

288287
"reliably create waves of actors" in {
289288
import system.dispatcher
290-
implicit val timeout: Timeout = Timeout((20 seconds).dilated)
289+
implicit val timeout: Timeout = Timeout(20.seconds.dilated)
291290
val waves = for (_ <- 1 to 3) yield system.actorOf(Props[ActorSystemSpec.Waves]()) ? 50000
292291
Await.result(Future.sequence(waves), timeout.duration + 5.seconds) should ===(Vector("done", "done", "done"))
293292
}
@@ -300,7 +299,7 @@ class ActorSystemSpec extends PekkoSpec(ActorSystemSpec.config) with ImplicitSen
300299
"reliable deny creation of actors while shutting down" in {
301300
val system = ActorSystem()
302301
import system.dispatcher
303-
system.scheduler.scheduleOnce(100 millis) { system.terminate() }
302+
system.scheduler.scheduleOnce(100.millis) { system.terminate() }
304303
var failing = false
305304
var created = Vector.empty[ActorRef]
306305
while (!system.whenTerminated.isCompleted) {

actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithBoundedStashSpec.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package org.apache.pekko.actor
1616
import scala.concurrent.duration._
1717

1818
import com.typesafe.config.{ Config, ConfigFactory }
19-
import language.postfixOps
2019
import org.scalatest.BeforeAndAfterEach
2120

2221
import org.apache.pekko
@@ -67,9 +66,9 @@ object ActorWithBoundedStashSpec {
6766
}
6867

6968
// bounded deque-based mailbox with capacity 10
70-
class Bounded10(@unused settings: Settings, @unused config: Config) extends BoundedDequeBasedMailbox(10, 500 millis)
69+
class Bounded10(@unused settings: Settings, @unused config: Config) extends BoundedDequeBasedMailbox(10, 500.millis)
7170

72-
class Bounded100(@unused settings: Settings, @unused config: Config) extends BoundedDequeBasedMailbox(100, 500 millis)
71+
class Bounded100(@unused settings: Settings, @unused config: Config) extends BoundedDequeBasedMailbox(100, 500.millis)
7372

7473
val dispatcherId1 = "my-dispatcher-1"
7574
val dispatcherId2 = "my-dispatcher-2"

actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithStashSpec.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import scala.concurrent.Await
1717
import scala.concurrent.duration._
1818

1919
import scala.annotation.nowarn
20-
import language.postfixOps
2120
import org.scalatest.BeforeAndAfterEach
2221

2322
import org.apache.pekko
@@ -144,13 +143,13 @@ class ActorWithStashSpec extends PekkoSpec with DefaultTimeout with BeforeAndAft
144143
val stasher = system.actorOf(Props[StashingTwiceActor]())
145144
stasher ! "hello"
146145
stasher ! "hello"
147-
Await.ready(state.expectedException, 10 seconds)
146+
Await.ready(state.expectedException, 10.seconds)
148147
}
149148

150149
"process stashed messages after restart" in {
151150
val boss = system.actorOf(
152151
Props(
153-
new Supervisor(OneForOneStrategy(maxNrOfRetries = 2, withinTimeRange = 1 second)(List(classOf[Throwable])))))
152+
new Supervisor(OneForOneStrategy(maxNrOfRetries = 2, withinTimeRange = 1.second)(List(classOf[Throwable])))))
154153

155154
val restartLatch = new TestLatch
156155
val hasMsgLatch = new TestLatch
@@ -180,8 +179,8 @@ class ActorWithStashSpec extends PekkoSpec with DefaultTimeout with BeforeAndAft
180179
employee ! "hello"
181180
employee ! "crash"
182181

183-
Await.ready(restartLatch, 10 seconds)
184-
Await.ready(hasMsgLatch, 10 seconds)
182+
Await.ready(restartLatch, 10.seconds)
183+
Await.ready(hasMsgLatch, 10.seconds)
185184
}
186185

187186
"re-receive unstashed Terminated messages" in {

actor-tests/src/test/scala/org/apache/pekko/actor/ConsistencySpec.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ package org.apache.pekko.actor
1515

1616
import scala.concurrent.duration._
1717

18-
import language.postfixOps
19-
2018
import org.apache.pekko
2119
import pekko.dispatch.ThreadPoolConfig
2220
import pekko.testkit.PekkoSpec
@@ -80,7 +78,7 @@ class ConsistencySpec extends PekkoSpec(ConsistencySpec.config) {
8078

8179
for (a <- actors) { a.tell("done", testActor) }
8280

83-
for (_ <- actors) expectMsg(5 minutes, "done")
81+
for (_ <- actors) expectMsg(5.minutes, "done")
8482
}
8583
}
8684
}

actor-tests/src/test/scala/org/apache/pekko/actor/DeathWatchSpec.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import scala.concurrent.Await
1717
import scala.concurrent.duration._
1818

1919
import scala.annotation.nowarn
20-
import language.postfixOps
2120

2221
import org.apache.pekko
2322
import pekko.actor.Props.EmptyActor
@@ -125,11 +124,11 @@ trait DeathWatchSpec { this: PekkoSpec with ImplicitSender with DefaultTimeout =
125124
lazy val supervisor = system.actorOf(Props(classOf[Supervisor], SupervisorStrategy.defaultStrategy), "watchers")
126125

127126
def startWatching(target: ActorRef) =
128-
Await.result((supervisor ? Watcher.props(target, testActor)).mapTo[ActorRef], 3 seconds)
127+
Await.result((supervisor ? Watcher.props(target, testActor)).mapTo[ActorRef], 3.seconds)
129128

130129
"The Death Watch" must {
131130
def expectTerminationOf(actorRef: ActorRef) =
132-
expectMsgPF(5 seconds, "" + actorRef + ": Stopped or Already terminated when linking") {
131+
expectMsgPF(5.seconds, "" + actorRef + ": Stopped or Already terminated when linking") {
133132
case WrappedTerminated(Terminated(`actorRef`)) => true
134133
}
135134

@@ -236,7 +235,7 @@ trait DeathWatchSpec { this: PekkoSpec with ImplicitSender with DefaultTimeout =
236235
startWatching(brother)
237236

238237
failed ! Kill
239-
val result = receiveWhile(3 seconds, messages = 3) {
238+
val result = receiveWhile(3.seconds, messages = 3) {
240239
case FF(Failed(_, _: ActorKilledException, _)) if lastSender eq failed => 1
241240
case FF(Failed(_, DeathPactException(`failed`), _)) if lastSender eq brother => 2
242241
case WrappedTerminated(Terminated(`brother`)) => 3

actor-tests/src/test/scala/org/apache/pekko/actor/DeployerSpec.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import scala.concurrent.duration._
1717

1818
import com.typesafe.config.ConfigFactory
1919
import com.typesafe.config.ConfigParseOptions
20-
import language.postfixOps
2120

2221
import org.apache.pekko
2322
import pekko.routing._
@@ -201,7 +200,7 @@ class DeployerSpec extends PekkoSpec(DeployerSpec.deployerConf) {
201200
"be able to parse 'pekko.actor.deployment._' with scatter-gather router" in {
202201
assertRouting(
203202
"/service-scatter-gather",
204-
ScatterGatherFirstCompletedPool(nrOfInstances = 1, within = 2 seconds),
203+
ScatterGatherFirstCompletedPool(nrOfInstances = 1, within = 2.seconds),
205204
"/service-scatter-gather")
206205
}
207206

@@ -218,7 +217,7 @@ class DeployerSpec extends PekkoSpec(DeployerSpec.deployerConf) {
218217
assertRouting("/some/wildcardmatch", RandomPool(1), "/some/*")
219218
assertRouting(
220219
"/somewildcardmatch/some",
221-
ScatterGatherFirstCompletedPool(nrOfInstances = 1, within = 2 seconds),
220+
ScatterGatherFirstCompletedPool(nrOfInstances = 1, within = 2.seconds),
222221
"/*/some")
223222
}
224223

0 commit comments

Comments
 (0)