You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by he...@apache.org on 2026/06/06 10:00:49 UTC
(pekko) 01/01: chore: Rewrite to scala3 syntax
This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch scala3NewFmt1.x
in repository https://gitbox.apache.org/repos/asf/pekko.git
commit 3e1ff7edbe0f7c4d40d6f1047d49ef917a65c157
Author: He-Pin <he...@gmail.com>
AuthorDate: Sat Jun 6 17:42:25 2026 +0800
chore: Rewrite to scala3 syntax
---
.scalafmt.conf | 15 +-
.../apache/pekko/actor/testkit/typed/Effect.scala | 18 +-
.../actor/testkit/typed/TestKitSettings.scala | 10 +-
.../testkit/typed/internal/ActorSystemStub.scala | 2 +-
.../typed/internal/LoggingTestKitImpl.scala | 12 +-
.../typed/internal/StubbedActorContext.scala | 4 +-
.../testkit/typed/internal/TestKitUtils.scala | 4 +-
.../testkit/typed/internal/TestProbeImpl.scala | 2 +-
.../actor/testkit/typed/javadsl/ActorTestKit.scala | 8 +-
.../typed/javadsl/JUnit5TestKitBuilder.scala | 4 +-
.../testkit/typed/javadsl/LoggingTestKit.scala | 6 +-
.../actor/testkit/typed/javadsl/ManualTime.scala | 2 +-
.../typed/javadsl/SerializationTestKit.scala | 2 +-
.../typed/javadsl/TestKitJunitResource.scala | 2 +-
.../actor/testkit/typed/javadsl/TestProbe.scala | 8 +-
.../testkit/typed/scaladsl/ActorTestKit.scala | 8 +-
.../testkit/typed/scaladsl/LoggingTestKit.scala | 4 +-
.../actor/testkit/typed/scaladsl/ManualTime.scala | 4 +-
.../typed/scaladsl/ScalaTestWithActorTestKit.scala | 2 +-
.../typed/scaladsl/SerializationTestKit.scala | 2 +-
.../actor/testkit/typed/scaladsl/TestProbe.scala | 4 +-
.../typed/scaladsl/SyncTestingExampleSpec.scala | 4 +-
.../testkit/typed/scaladsl/ActorTestKitSpec.scala | 4 +-
.../typed/scaladsl/BehaviorTestKitSpec.scala | 6 +-
.../org/apache/pekko/util/LineNumberSpec.scala | 4 +-
.../org/apache/pekko/PekkoExceptionSpec.scala | 2 +-
.../org/apache/pekko/actor/ActorMailboxSpec.scala | 2 +-
.../org/apache/pekko/actor/ActorSystemSpec.scala | 11 +-
.../pekko/actor/CoordinatedShutdownSpec.scala | 9 +-
.../org/apache/pekko/actor/DynamicAccessSpec.scala | 2 +-
.../org/apache/pekko/actor/ExtensionSpec.scala | 2 +-
.../apache/pekko/actor/ReceiveTimeoutSpec.scala | 3 +-
.../org/apache/pekko/actor/SchedulerSpec.scala | 27 +-
.../pekko/actor/SupervisorHierarchySpec.scala | 7 +-
.../org/apache/pekko/actor/TypedActorSpec.scala | 4 +-
.../actor/dispatch/BalancingDispatcherSpec.scala | 3 +-
.../apache/pekko/dispatch/MailboxConfigSpec.scala | 2 +-
.../apache/pekko/event/LoggingReceiveSpec.scala | 2 +-
.../scala/org/apache/pekko/pattern/AskSpec.scala | 4 +-
.../org/apache/pekko/pattern/StatusReplySpec.scala | 2 +-
.../serialization/SerializationSetupSpec.scala | 2 +-
.../apache/pekko/serialization/SerializeSpec.scala | 10 +-
.../pekko/util/BoundedBlockingQueueSpec.scala | 2 +-
.../pekko/util/ByteStringInitializationSpec.scala | 2 +-
.../org/apache/pekko/util/ByteStringSpec.scala | 2 +-
.../org/apache/pekko/util/WildcardIndexSpec.scala | 6 +-
.../pekko/typed/InteractionPatterns3Spec.scala | 23 +-
.../pekko/typed/InteractionPatternsSpec.scala | 4 +-
.../apache/pekko/typed/LoggingDocExamples.scala | 4 +-
.../apache/pekko/typed/StyleGuideDocExamples.scala | 2 +-
.../pekko/typed/extensions/ExtensionDocSpec.scala | 6 +-
.../org/apache/pekko/actor/typed/AskSpec.scala | 2 +-
.../apache/pekko/actor/typed/ExtensionsSpec.scala | 20 +-
.../LocalActorRefProviderLogMessagesSpec.scala | 8 +-
.../pekko/actor/typed/MailboxSelectorSpec.scala | 2 +-
.../apache/pekko/actor/typed/SupervisionSpec.scala | 21 +-
.../delivery/DurableProducerControllerSpec.scala | 4 +-
.../typed/delivery/DurableWorkPullingSpec.scala | 4 +-
.../delivery/ReliableDeliveryRandomSpec.scala | 4 +-
.../actor/typed/internal/ActorSystemSpec.scala | 5 +-
.../receptionist/LocalReceptionistSpec.scala | 2 +-
.../actor/typed/scaladsl/MailboxSelectorSpec.scala | 4 +-
.../org/apache/pekko/actor/typed/ActorRef.scala | 2 +-
.../pekko/actor/typed/ActorRefResolver.scala | 10 +-
.../pekko/actor/typed/BehaviorInterceptor.scala | 8 +-
.../org/apache/pekko/actor/typed/Extensions.scala | 10 +-
.../actor/typed/delivery/ConsumerController.scala | 4 +-
.../typed/delivery/DurableProducerQueue.scala | 10 +-
.../actor/typed/delivery/ProducerController.scala | 4 +-
.../delivery/WorkPullingProducerController.scala | 4 +-
.../delivery/internal/ConsumerControllerImpl.scala | 18 +-
.../delivery/internal/ProducerControllerImpl.scala | 7 +-
.../actor/typed/eventstream/EventStream.scala | 2 +-
.../actor/typed/internal/ActorContextImpl.scala | 14 +-
.../actor/typed/internal/ActorFlightRecorder.scala | 2 +-
.../pekko/actor/typed/internal/ActorRefImpl.scala | 4 +-
.../typed/internal/EventStreamExtension.scala | 4 +-
.../actor/typed/internal/ExtensionsImpl.scala | 12 +-
.../actor/typed/internal/InterceptorImpl.scala | 10 +-
.../pekko/actor/typed/internal/LoggerClass.scala | 6 +-
.../typed/internal/MiscMessageSerializer.scala | 4 +-
.../pekko/actor/typed/internal/PoisonPill.scala | 2 +-
.../pekko/actor/typed/internal/Supervision.scala | 19 +-
.../internal/WithMdcBehaviorInterceptor.scala | 4 +-
.../typed/internal/adapter/ActorAdapter.scala | 8 +-
.../internal/adapter/ActorContextAdapter.scala | 8 +-
.../typed/internal/adapter/ActorRefAdapter.scala | 4 +-
.../internal/adapter/ActorSystemAdapter.scala | 6 +-
.../internal/receptionist/LocalReceptionist.scala | 8 +-
.../internal/receptionist/ReceptionistImpl.scala | 2 +-
.../receptionist/ReceptionistMessages.scala | 6 +-
.../receptionist/ServiceKeySerializer.scala | 4 +-
.../typed/internal/routing/GroupRouterImpl.scala | 2 +-
.../typed/internal/routing/PoolRouterImpl.scala | 2 +-
.../pekko/actor/typed/javadsl/ActorContext.scala | 2 +-
.../apache/pekko/actor/typed/javadsl/Adapter.scala | 18 +-
.../actor/typed/javadsl/BehaviorBuilder.scala | 4 +-
.../pekko/actor/typed/javadsl/ReceiveBuilder.scala | 4 +-
.../actor/typed/receptionist/Receptionist.scala | 26 +-
.../pekko/actor/typed/scaladsl/ActorContext.scala | 2 +-
.../pekko/actor/typed/scaladsl/AskPattern.scala | 4 +-
.../actor/typed/scaladsl/adapter/package.scala | 8 +-
.../org/apache/pekko/util/ByteString.scala | 2 +-
.../org/apache/pekko/util/ByteIterator.scala | 111 ++++----
.../scala-3/org/apache/pekko/util/ByteString.scala | 288 ++++++++++-----------
.../apache/pekko/util/JavaDurationConverters.scala | 2 +-
.../org/apache/pekko/util/OptionConverters.scala | 2 +-
.../pekko/dispatch/PekkoJdk9ForkJoinPool.scala | 2 +-
.../org/apache/pekko/actor/AbstractProps.scala | 20 +-
.../scala/org/apache/pekko/actor/ActorCell.scala | 2 +-
.../scala/org/apache/pekko/actor/ActorPath.scala | 9 +-
.../scala/org/apache/pekko/actor/ActorSystem.scala | 17 +-
.../apache/pekko/actor/CoordinatedShutdown.scala | 2 +-
.../scala/org/apache/pekko/actor/Deployer.scala | 2 +-
.../org/apache/pekko/actor/DynamicAccess.scala | 6 +-
.../scala/org/apache/pekko/actor/Extension.scala | 2 +-
.../main/scala/org/apache/pekko/actor/FSM.scala | 4 +-
.../org/apache/pekko/actor/FaultHandling.scala | 16 +-
.../apache/pekko/actor/IndirectActorProducer.scala | 16 +-
.../pekko/actor/LightArrayRevolverScheduler.scala | 11 +-
.../main/scala/org/apache/pekko/actor/Props.scala | 12 +-
.../pekko/actor/ReflectiveDynamicAccess.scala | 10 +-
.../scala/org/apache/pekko/actor/TypedActor.scala | 34 +--
.../pekko/actor/dungeon/ChildrenContainer.scala | 4 +-
.../org/apache/pekko/actor/dungeon/Dispatch.scala | 2 +-
.../pekko/actor/setup/ActorSystemSetup.scala | 2 +-
.../apache/pekko/dispatch/CompletionStages.scala | 18 +-
.../dispatch/ForkJoinExecutorConfigurator.scala | 4 +-
.../scala/org/apache/pekko/dispatch/Mailbox.scala | 8 +-
.../org/apache/pekko/dispatch/Mailboxes.scala | 32 +--
.../apache/pekko/dispatch/ThreadPoolBuilder.scala | 8 +-
.../dispatch/VirtualizedExecutorService.scala | 10 +-
.../scala/org/apache/pekko/event/EventStream.scala | 17 +-
.../scala/org/apache/pekko/event/Logging.scala | 154 +++++------
.../org/apache/pekko/event/LoggingReceive.scala | 5 +-
.../org/apache/pekko/event/jul/JavaLogger.scala | 10 +-
.../scala/org/apache/pekko/io/DnsProvider.scala | 4 +-
.../pekko/io/dns/internal/TcpDnsClient.scala | 3 +-
.../main/scala/org/apache/pekko/japi/JavaAPI.scala | 4 +-
.../org/apache/pekko/pattern/CircuitBreaker.scala | 9 +-
.../pekko/pattern/CircuitBreakersRegistry.scala | 2 +-
.../org/apache/pekko/pattern/StatusReply.scala | 4 +-
.../org/apache/pekko/routing/ConsistentHash.scala | 6 +-
.../pekko/serialization/PrimitiveSerializers.scala | 10 +-
.../apache/pekko/serialization/Serialization.scala | 24 +-
.../pekko/serialization/SerializationSetup.scala | 6 +-
.../apache/pekko/serialization/Serializer.scala | 20 +-
.../apache/pekko/util/BoundedBlockingQueue.scala | 14 +-
.../scala/org/apache/pekko/util/BoxedType.scala | 4 +-
.../pekko/util/ClassLoaderObjectInputStream.scala | 2 +-
.../org/apache/pekko/util/FrequencySketch.scala | 9 +-
.../scala/org/apache/pekko/util/LineNumbers.scala | 2 +-
.../main/scala/org/apache/pekko/util/Reflect.scala | 20 +-
.../org/apache/pekko/util/TypedMultiMap.scala | 2 +-
.../pekko/actor/typed/TypedBenchmarkActors.scala | 2 +-
.../typed/delivery/ReliableDeliveryBenchmark.scala | 5 +-
.../pekko/remote/artery/CodecBenchmark.scala | 2 +-
.../org/apache/pekko/stream/FlowMapBenchmark.scala | 2 +-
.../scala/org/apache/pekko/util/StackBench.scala | 4 +-
build.sbt | 8 +-
.../metrics/protobuf/NumberInputStream.scala | 2 +-
.../sharding/typed/ClusterShardingQuery.scala | 8 +-
.../sharding/typed/ClusterShardingSettings.scala | 4 +-
.../typed/ReplicatedShardingExtension.scala | 4 +-
.../typed/ShardedDaemonProcessSettings.scala | 4 +-
.../delivery/ShardingConsumerController.scala | 4 +-
.../delivery/ShardingProducerController.scala | 4 +-
.../internal/ShardingConsumerControllerImpl.scala | 2 +-
.../internal/ShardingProducerControllerImpl.scala | 9 +-
.../typed/internal/ClusterShardingImpl.scala | 12 +-
.../cluster/sharding/typed/internal/Murmur2.scala | 5 +-
.../internal/ReplicatedShardingExtensionImpl.scala | 5 +-
.../typed/internal/ShardedDaemonProcessImpl.scala | 2 +-
.../typed/internal/ShardingSerializer.scala | 6 +-
.../typed/internal/testkit/TestEntityRefImpl.scala | 4 +-
.../sharding/typed/javadsl/ClusterSharding.scala | 2 +-
.../typed/javadsl/ShardedDaemonProcess.scala | 2 +-
.../sharding/typed/scaladsl/ClusterSharding.scala | 6 +-
.../typed/scaladsl/ShardedDaemonProcess.scala | 2 +-
.../typed/delivery/DeliveryThroughputSpec.scala | 10 +-
...urableStateStoreQueryUsageCompileOnlySpec.scala | 2 +-
.../ExternalShardAllocationCompileOnlySpec.scala | 2 +-
.../typed/HelloWorldPersistentEntityExample.scala | 2 +-
.../typed/ReplicatedShardingCompileOnlySpec.scala | 2 +-
...oinConfigCompatCheckerClusterShardingSpec.scala | 4 +-
.../sharding/typed/ReplicatedShardingSpec.scala | 2 +-
.../typed/delivery/DurableShardingSpec.scala | 8 +-
.../scaladsl/ClusterShardingPersistenceSpec.scala | 2 +-
.../cluster/sharding/ClusterShardingSettings.scala | 3 +-
.../pekko/cluster/sharding/ShardCoordinator.scala | 3 +-
.../pekko/cluster/sharding/ShardRegion.scala | 12 +-
.../cluster/sharding/ShardingFlightRecorder.scala | 2 +-
.../internal/LeastShardAllocationStrategy.scala | 5 +-
.../RandomizedBrainResolverIntegrationSpec.scala | 13 +-
.../sharding/MultiDcClusterShardingSpec.scala | 3 +-
.../sharding/MultiNodeClusterShardingConfig.scala | 5 +-
.../JoinConfigCompatCheckShardingSpec.scala | 3 +-
.../cluster/sharding/ShardingQueriesSpec.scala | 6 +-
.../cluster/pubsub/DistributedPubSubMediator.scala | 7 +-
.../ddata/typed/internal/ReplicatorBehavior.scala | 71 +++--
.../ddata/typed/javadsl/DistributedData.scala | 10 +-
.../ddata/typed/javadsl/ReplicatorSettings.scala | 2 +-
.../ddata/typed/scaladsl/DistributedData.scala | 6 +-
.../ddata/typed/scaladsl/ReplicatorSettings.scala | 4 +-
.../org/apache/pekko/cluster/typed/Cluster.scala | 8 +-
.../pekko/cluster/typed/ClusterSingleton.scala | 16 +-
.../typed/internal/AdaptedClusterImpl.scala | 4 +-
.../internal/AdaptedClusterSingletonImpl.scala | 10 +-
.../internal/PekkoClusterTypedSerializer.scala | 8 +-
.../delivery/ReliableDeliverySerializer.scala | 26 +-
.../receptionist/ClusterReceptionist.scala | 20 +-
.../receptionist/ClusterReceptionistSettings.scala | 2 +-
.../typed/internal/receptionist/Registry.scala | 12 +-
.../cluster/typed/BasicClusterExampleSpec.scala | 10 +-
.../cluster/typed/DistributedPubSubExample.scala | 6 +-
.../pekko/cluster/typed/GroupRouterSpec.scala | 8 +-
.../delivery/ReliableDeliverySerializerSpec.scala | 6 +-
.../scala/org/apache/pekko/cluster/Cluster.scala | 6 +-
.../org/apache/pekko/cluster/ClusterDaemon.scala | 13 +-
.../org/apache/pekko/cluster/ClusterEvent.scala | 7 +-
.../org/apache/pekko/cluster/MembershipState.scala | 3 +-
.../cluster/routing/ClusterRouterConfig.scala | 3 +-
.../ClusterAccrualFailureDetectorSpec.scala | 3 +-
.../pekko/cluster/ClusterDeathWatchSpec.scala | 3 +-
.../apache/pekko/cluster/JoinInProgressSpec.scala | 3 +-
.../apache/pekko/cluster/LeaderLeavingSpec.scala | 3 +-
.../cluster/MembershipChangeListenerUpSpec.scala | 6 +-
.../pekko/cluster/MinMembersBeforeUpSpec.scala | 6 +-
.../pekko/cluster/MultiDcSunnyWeatherSpec.scala | 5 +-
.../apache/pekko/cluster/NodeMembershipSpec.scala | 6 +-
.../org/apache/pekko/cluster/SplitBrainSpec.scala | 3 +-
.../org/apache/pekko/cluster/StressSpec.scala | 14 +-
.../cluster/SurviveNetworkInstabilitySpec.scala | 2 +-
.../cluster/ClusterHeartbeatSenderStateSpec.scala | 4 +-
.../cluster/JoinConfigCompatCheckerSpec.scala | 27 +-
.../pekko/cluster/ReachabilityPerfSpec.scala | 15 +-
.../pekko/cluster/StartupWithOneThreadSpec.scala | 6 +-
.../apache/pekko/cluster/VectorClockPerfSpec.scala | 12 +-
.../pekko/cluster/sbr/SplitBrainResolverSpec.scala | 21 +-
.../lease/scaladsl/LeaseProvider.scala | 2 +-
.../org/apache/pekko/cluster/ddata/GSet.scala | 8 +-
.../scala/org/apache/pekko/cluster/ddata/Key.scala | 4 +-
.../org/apache/pekko/cluster/ddata/LWWMap.scala | 2 +-
.../apache/pekko/cluster/ddata/LWWRegister.scala | 2 +-
.../org/apache/pekko/cluster/ddata/ORMap.scala | 52 ++--
.../apache/pekko/cluster/ddata/ORMultiMap.scala | 2 +-
.../org/apache/pekko/cluster/ddata/ORSet.scala | 28 +-
.../apache/pekko/cluster/ddata/PNCounterMap.scala | 2 +-
.../apache/pekko/cluster/ddata/Replicator.scala | 7 +-
.../apache/pekko/cluster/ddata/VersionVector.scala | 2 +-
.../ddata/protobuf/ReplicatedDataSerializer.scala | 134 +++++-----
.../protobuf/ReplicatorMessageSerializer.scala | 56 ++--
.../cluster/ddata/JepsenInspiredInsertSpec.scala | 16 +-
.../pekko/cluster/ddata/ReplicatorChaosSpec.scala | 6 +-
.../pekko/cluster/ddata/ReplicatorDeltaSpec.scala | 24 +-
.../pekko/cluster/ddata/ReplicatorGossipSpec.scala | 4 +-
.../cluster/ddata/ReplicatorORSetDeltaSpec.scala | 2 +-
.../pekko/cluster/ddata/ReplicatorSpec.scala | 10 +-
.../pekko/cluster/ddata/LocalConcurrencySpec.scala | 2 +-
.../apache/pekko/cluster/ddata/LotsOfDataBot.scala | 2 +-
.../docs/actor/SharedMutableStateDocSpec.scala | 2 +-
.../docs/actor/io/dns/DnsCompileOnlyDocSpec.scala | 8 +-
.../test/scala/docs/cluster/FactorialBackend.scala | 2 +-
.../scala/docs/ddata/DistributedDataDocSpec.scala | 10 +-
docs/src/test/scala/docs/ddata/ShoppingCart.scala | 4 +-
.../ddata/protobuf/TwoPhaseSetSerializer.scala | 4 +-
.../ddata/protobuf/TwoPhaseSetSerializer2.scala | 2 +-
.../src/test/scala/docs/event/LoggingDocSpec.scala | 2 +-
docs/src/test/scala/docs/io/EchoServer.scala | 2 +-
.../persistence/PersistenceSerializerDocSpec.scala | 4 +-
.../docs/serialization/SerializationDocSpec.scala | 2 +-
.../test/scala/docs/stream/GraphDSLDocSpec.scala | 4 +-
.../docs/stream/cookbook/RecipeAdhocSource.scala | 2 +-
.../scala/docs/stream/operators/source/Zip.scala | 2 +-
.../docs/stream/operators/sourceorflow/Limit.scala | 2 +-
.../operators/sourceorflow/LimitWeighted.scala | 2 +-
.../apache/pekko/remote/testconductor/Player.scala | 4 +-
.../pekko/remote/testkit/MultiNodeSpec.scala | 4 +-
.../apache/pekko/osgi/ActorSystemActivator.scala | 4 +-
.../pekko/osgi/BundleDelegatingClassLoader.scala | 4 +-
.../org/apache/pekko/osgi/PojoSRTestSupport.scala | 2 +-
.../query/internal/QuerySerializer.scala | 4 +-
.../journal/leveldb/AllPersistenceIdsStage.scala | 2 +-
.../leveldb/EventsByPersistenceIdStage.scala | 5 +-
.../query/journal/leveldb/EventsByTagStage.scala | 2 +-
.../leveldb/scaladsl/LeveldbReadJournal.scala | 3 +-
.../persistence/query/typed/EventEnvelope.scala | 2 +-
.../persistence/serialization/SerializerSpec.scala | 4 +-
.../persistence/scalatest/OptionalTests.scala | 5 +-
.../internal/EventSourcedBehaviorTestKitImpl.scala | 6 +-
.../testkit/internal/PersistenceProbeImpl.scala | 10 +-
.../SnapshotStorageEmulatorExtension.scala | 2 +-
.../javadsl/EventSourcedBehaviorTestKit.scala | 4 +-
.../testkit/javadsl/PersistenceTestKit.scala | 2 +-
.../testkit/javadsl/SnapshotTestKit.scala | 2 +-
.../scaladsl/EventSourcedBehaviorTestKit.scala | 4 +-
.../testkit/scaladsl/PersistenceTestKit.scala | 2 +-
.../persistence/testkit/scaladsl/TestOps.scala | 10 +-
.../typed/ReplicatedAuctionExampleSpec.scala | 6 +-
.../ReplicatedEventSourcingCompileOnlySpec.scala | 4 +-
.../scaladsl/EventSourcedBehaviorReplySpec.scala | 8 +-
.../typed/scaladsl/EventSourcedBehaviorSpec.scala | 16 +-
.../scaladsl/EventSourcedBehaviorStashSpec.scala | 12 +-
.../scaladsl/EventSourcedBehaviorWatchSpec.scala | 4 +-
.../scaladsl/DurableStateBehaviorReplySpec.scala | 6 +-
.../DurableStateBehaviorStashOverflowSpec.scala | 4 +-
.../pekko/persistence/typed/crdt/ORSet.scala | 2 +-
.../typed/delivery/EventSourcedProducerQueue.scala | 8 +-
.../persistence/typed/internal/BehaviorSetup.scala | 3 +-
.../typed/internal/EventSourcedBehaviorImpl.scala | 8 +-
.../typed/internal/EventSourcedSettings.scala | 4 +-
.../typed/internal/ExternalInteractions.scala | 8 +-
.../typed/internal/ReplayingEvents.scala | 8 +-
.../typed/internal/ReplayingSnapshot.scala | 4 +-
.../typed/internal/RequestingRecoveryPermit.scala | 2 +-
.../pekko/persistence/typed/internal/Running.scala | 14 +-
.../typed/javadsl/EventSourcedBehavior.scala | 4 +-
.../typed/scaladsl/EventSourcedBehavior.scala | 14 +-
.../ReplicatedEventSourcingSerializer.scala | 28 +-
.../state/internal/DurableStateBehaviorImpl.scala | 6 +-
.../state/internal/DurableStateSettings.scala | 2 +-
.../internal/DurableStateStoreInteractions.scala | 4 +-
.../typed/state/internal/Recovering.scala | 6 +-
.../state/internal/RequestingRecoveryPermit.scala | 2 +-
.../persistence/typed/state/internal/Running.scala | 12 +-
.../typed/state/javadsl/DurableStateBehavior.scala | 2 +-
.../state/scaladsl/DurableStateBehavior.scala | 12 +-
...DurableStatePersistentBehaviorCompileOnly.scala | 24 +-
.../persistence/typed/ManyRecoveriesSpec.scala | 3 +-
.../typed/StashingWhenSnapshottingSpec.scala | 2 +-
.../typed/internal/StashStateSpec.scala | 2 +-
.../scaladsl/PersistentActorCompileOnlyTest.scala | 2 +-
.../org/apache/pekko/persistence/TraitOrder.scala | 2 +-
.../org/apache/pekko/persistence/TraitOrder.scala | 2 +-
.../pekko/persistence/PersistencePlugin.scala | 4 +-
.../pekko/persistence/journal/EventAdapters.scala | 18 +-
.../journal/PersistencePluginProxy.scala | 2 +-
.../persistence/journal/inmem/InmemJournal.scala | 9 +-
.../serialization/MessageSerializer.scala | 2 +-
.../serialization/SnapshotSerializer.scala | 2 +-
.../state/DurableStateStoreRegistry.scala | 14 +-
.../persistence/AtLeastOnceDeliverySpec.scala | 8 +-
.../pekko/persistence/PersistentActorSpec.scala | 2 +-
.../SnapshotRecoveryWithEmptyJournalSpec.scala | 2 +-
.../persistence/SnapshotSerializationSpec.scala | 2 +-
.../apache/pekko/persistence/SnapshotSpec.scala | 2 +-
.../SnapshotSerializerMigrationAkkaSpec.scala | 8 +-
.../SnapshotSerializerNoMigrationSpec.scala | 4 +-
.../serialization/SnapshotSerializerSpec.scala | 12 +-
.../exception/DurableStateExceptionsSpec.scala | 2 +-
project/AddLogTimestamps.scala | 2 +-
project/CopyrightHeaderForBoilerplate.scala | 2 +-
project/CopyrightHeaderForBuild.scala | 2 +-
project/CopyrightHeaderForJdk9.scala | 2 +-
project/CopyrightHeaderForProtobuf.scala | 2 +-
project/Dependencies.scala | 15 +-
project/Doc.scala | 3 +-
project/JavaFormatter.scala | 2 +-
project/MultiNode.scala | 2 +-
project/Paradox.scala | 9 +-
project/PekkoBuild.scala | 24 +-
project/PekkoDevelocityPlugin.scala | 2 +-
project/PekkoDisciplinePlugin.scala | 53 ++--
project/Protobuf.scala | 2 +-
project/SbtMultiJvmPlugin.scala | 9 +-
project/ScalaFixExtraRulesPlugin.scala | 2 +-
project/ScalaFixForJdk9Plugin.scala | 4 +-
project/ScalafixForMultiNodePlugin.scala | 4 +-
project/ScalafixIgnoreFilePlugin.scala | 4 +-
project/StreamOperatorsIndexGenerator.scala | 5 +-
project/TestExtras.scala | 9 +-
project/ValidatePullRequest.scala | 2 +-
project/VerifyJDK9Classes.scala | 2 +-
project/VersionGenerator.scala | 2 +-
.../pekko/remote/routing/RemoteRandomSpec.scala | 3 +-
.../remote/routing/RemoteScatterGatherSpec.scala | 3 +-
.../scala/org/apache/pekko/remote/Endpoint.scala | 5 +-
.../org/apache/pekko/remote/RemoteDaemon.scala | 2 +-
.../pekko/remote/RemoteMetricsExtension.scala | 2 +-
.../pekko/remote/artery/ArteryTransport.scala | 4 +-
.../apache/pekko/remote/artery/Association.scala | 3 +-
.../pekko/remote/artery/EnvelopeBufferPool.scala | 6 +-
.../org/apache/pekko/remote/artery/Handshake.scala | 2 +-
.../pekko/remote/artery/ImmutableLongMap.scala | 2 +-
.../pekko/remote/artery/MessageDispatcher.scala | 3 +-
.../pekko/remote/artery/RemoteInstrument.scala | 2 +-
.../remote/artery/RemotingFlightRecorder.scala | 2 +-
.../remote/artery/SystemMessageDelivery.scala | 4 +-
.../pekko/remote/artery/aeron/AeronSink.scala | 3 +-
.../artery/aeron/ArteryAeronUdpTransport.scala | 11 +-
.../remote/artery/compress/CompressionTable.scala | 5 +-
.../remote/artery/tcp/ArteryTcpTransport.scala | 11 +-
.../pekko/remote/artery/tcp/ssl/X509Readers.scala | 2 +-
.../serialization/DaemonMsgCreateSerializer.scala | 2 +-
.../serialization/MessageContainerSerializer.scala | 2 +-
.../serialization/MiscMessageSerializer.scala | 14 +-
.../serialization/PrimitiveSerializers.scala | 8 +-
.../remote/serialization/ProtobufSerializer.scala | 16 +-
.../serialization/SystemMessageSerializer.scala | 2 +-
.../transport/AbstractTransportAdapter.scala | 3 +-
.../pekko/remote/AccrualFailureDetectorSpec.scala | 7 +-
.../pekko/remote/DeadlineFailureDetectorSpec.scala | 3 +-
.../pekko/remote/artery/ImmutableLongMapSpec.scala | 9 +-
.../remote/artery/OutboundIdleShutdownSpec.scala | 3 +-
.../RemoteInstrumentsSerializationSpec.scala | 8 +-
.../pekko/remote/artery/RemoteWatcherSpec.scala | 3 +-
.../pekko/remote/artery/tcp/TcpFramingSpec.scala | 4 +-
.../pekko/remote/classic/RemoteWatcherSpec.scala | 3 +-
...reateSerializerAllowJavaSerializationSpec.scala | 4 +-
.../serialization/jackson/JacksonModule.scala | 14 +-
.../serialization/jackson/JacksonSerializer.scala | 22 +-
.../serialization/jackson/StreamRefModule.scala | 24 +-
.../jackson/TypedActorRefModule.scala | 12 +-
.../org/apache/pekko/event/slf4j/Slf4jLogger.scala | 18 +-
.../pekko/stream/testkit/StreamTestKit.scala | 8 +-
.../impl/fusing/GraphInterpreterSpecKit.scala | 30 +--
.../apache/pekko/stream/testkit/ChainSetup.scala | 6 +-
.../apache/pekko/stream/testkit/ScriptedTest.scala | 2 +-
.../apache/pekko/stream/testkit/StreamSpec.scala | 2 +-
.../pekko/stream/testkit/TwoStreamsSetup.scala | 2 +-
.../tck/FlatMapConcatDoubleSubscriberTest.scala | 2 +-
.../tck/PekkoIdentityProcessorVerification.scala | 2 +-
.../apache/pekko/stream/DslConsistencySpec.scala | 46 ++--
.../pekko/stream/DslFactoriesConsistencySpec.scala | 53 ++--
.../apache/pekko/stream/impl/FixedBufferSpec.scala | 12 +-
.../stream/impl/LinearTraversalBuilderSpec.scala | 3 +-
.../pekko/stream/impl/TraversalBuilderSpec.scala | 2 +-
.../impl/fusing/ActorGraphInterpreterSpec.scala | 4 +-
.../pekko/stream/impl/fusing/InterpreterSpec.scala | 3 +-
.../impl/fusing/LifecycleInterpreterSpec.scala | 6 +-
.../pekko/stream/io/ByteStringParserSpec.scala | 3 +-
.../stream/scaladsl/CancellationStrategySpec.scala | 3 +-
.../scaladsl/CoupledTerminationFlowSpec.scala | 4 +-
.../pekko/stream/scaladsl/FlowCompileSpec.scala | 32 +--
.../pekko/stream/scaladsl/FlowConcatAllSpec.scala | 2 +-
.../pekko/stream/scaladsl/FlowConcatSpec.scala | 12 +-
.../pekko/stream/scaladsl/FlowGroupBySpec.scala | 14 +-
.../stream/scaladsl/FlowGroupedWithinSpec.scala | 3 +-
.../pekko/stream/scaladsl/FlowIteratorSpec.scala | 4 +-
.../pekko/stream/scaladsl/FlowOnCompleteSpec.scala | 2 +-
.../pekko/stream/scaladsl/FlowOrElseSpec.scala | 3 +-
.../stream/scaladsl/FlowPrefixAndTailSpec.scala | 12 +-
.../pekko/stream/scaladsl/FlowScanAsyncSpec.scala | 2 +-
.../apache/pekko/stream/scaladsl/FlowSpec.scala | 26 +-
.../pekko/stream/scaladsl/FlowSplitAfterSpec.scala | 6 +-
.../pekko/stream/scaladsl/FlowSplitWhenSpec.scala | 6 +-
.../pekko/stream/scaladsl/FlowTakeSpec.scala | 2 +-
.../pekko/stream/scaladsl/GraphConcatSpec.scala | 2 +-
.../stream/scaladsl/GraphMergeLatestSpec.scala | 2 +-
.../stream/scaladsl/GraphMergePreferredSpec.scala | 2 +-
.../scaladsl/GraphMergePrioritizedSpec.scala | 2 +-
.../stream/scaladsl/GraphMergeSequenceSpec.scala | 2 +-
.../stream/scaladsl/GraphMergeSortedSpec.scala | 2 +-
.../pekko/stream/scaladsl/GraphMergeSpec.scala | 2 +-
.../stream/scaladsl/GraphOpsIntegrationSpec.scala | 6 +-
.../pekko/stream/scaladsl/GraphUnzipWithSpec.scala | 6 +-
.../stream/scaladsl/GraphZipLatestWithSpec.scala | 2 +-
.../pekko/stream/scaladsl/GraphZipNSpec.scala | 2 +-
.../pekko/stream/scaladsl/GraphZipSpec.scala | 2 +-
.../pekko/stream/scaladsl/GraphZipWithNSpec.scala | 2 +-
.../pekko/stream/scaladsl/GraphZipWithSpec.scala | 2 +-
.../apache/pekko/stream/scaladsl/RestartSpec.scala | 8 +-
.../pekko/stream/scaladsl/RetryFlowSpec.scala | 3 +-
.../SubstreamSubscriptionTimeoutSpec.scala | 6 +-
.../pekko/stream/MapAsyncPartitionedSpec.scala | 2 +-
.../stream/typed/ActorSourceSinkExample.scala | 8 +-
.../pekko/stream/javadsl/CollectionUtil.scala | 2 +-
.../stream/impl/JavaFlowAndRsConverters.scala | 8 +-
.../pekko/stream/scaladsl/JavaFlowSupport.scala | 2 +-
.../sslconfig/pekko/util/PekkoLoggerBridge.scala | 6 +-
.../scala/org/apache/pekko/stream/FanInShape.scala | 12 +-
.../org/apache/pekko/stream/FanOutShape.scala | 12 +-
.../main/scala/org/apache/pekko/stream/Shape.scala | 53 ++--
.../apache/pekko/stream/SystemMaterializer.scala | 9 +-
.../apache/pekko/stream/impl/ActorPublisher.scala | 12 +-
.../stream/impl/ActorRefBackpressureSource.scala | 2 +-
.../pekko/stream/impl/ActorRefSinkStage.scala | 2 +-
.../apache/pekko/stream/impl/ActorRefSource.scala | 2 +-
.../pekko/stream/impl/CompletedPublishers.scala | 6 +-
.../scala/org/apache/pekko/stream/impl/FanIn.scala | 3 +-
.../org/apache/pekko/stream/impl/FanOut.scala | 2 +-
.../apache/pekko/stream/impl/FanoutProcessor.scala | 4 +-
.../impl/PhasedFusingActorMaterializer.scala | 2 +-
.../org/apache/pekko/stream/impl/QueueSource.scala | 2 +-
.../scala/org/apache/pekko/stream/impl/Sinks.scala | 4 +-
.../apache/pekko/stream/impl/StreamLayout.scala | 32 +--
.../stream/impl/StreamSubscriptionTimeout.scala | 12 +-
.../pekko/stream/impl/SubscriberManagement.scala | 8 +-
.../pekko/stream/impl/TraversalBuilder.scala | 24 +-
.../stream/impl/fusing/ActorGraphInterpreter.scala | 2 +-
.../pekko/stream/impl/fusing/FlattenConcat.scala | 2 +-
.../pekko/stream/impl/fusing/GraphStages.scala | 4 +-
.../org/apache/pekko/stream/impl/fusing/Ops.scala | 8 +-
.../pekko/stream/impl/fusing/StreamOfStreams.scala | 8 +-
.../pekko/stream/impl/io/InputStreamSource.scala | 2 +-
.../stream/impl/io/OutputStreamGraphStage.scala | 2 +-
.../apache/pekko/stream/impl/io/TcpStages.scala | 3 +-
.../pekko/stream/impl/streamref/SinkRefImpl.scala | 2 +-
.../stream/impl/streamref/SourceRefImpl.scala | 2 +-
.../org/apache/pekko/stream/javadsl/Flow.scala | 98 +++----
.../pekko/stream/javadsl/FlowWithContext.scala | 2 +-
.../org/apache/pekko/stream/javadsl/Graph.scala | 30 +--
.../apache/pekko/stream/javadsl/RestartFlow.scala | 16 +-
.../apache/pekko/stream/javadsl/RestartSink.scala | 10 +-
.../pekko/stream/javadsl/RestartSource.scala | 20 +-
.../org/apache/pekko/stream/javadsl/Sink.scala | 10 +-
.../org/apache/pekko/stream/javadsl/Source.scala | 110 ++++----
.../pekko/stream/javadsl/SourceWithContext.scala | 2 +-
.../pekko/stream/javadsl/StreamConverters.scala | 4 +-
.../org/apache/pekko/stream/javadsl/SubFlow.scala | 74 +++---
.../apache/pekko/stream/javadsl/SubSource.scala | 74 +++---
.../org/apache/pekko/stream/javadsl/package.scala | 2 +-
.../org/apache/pekko/stream/scaladsl/Flow.scala | 46 ++--
.../pekko/stream/scaladsl/FlowWithContext.scala | 8 +-
.../pekko/stream/scaladsl/FlowWithContextOps.scala | 8 +-
.../org/apache/pekko/stream/scaladsl/Graph.scala | 102 ++++----
.../apache/pekko/stream/scaladsl/RestartFlow.scala | 16 +-
.../apache/pekko/stream/scaladsl/RestartSink.scala | 8 +-
.../pekko/stream/scaladsl/RestartSource.scala | 14 +-
.../org/apache/pekko/stream/scaladsl/Sink.scala | 6 +-
.../org/apache/pekko/stream/scaladsl/Source.scala | 14 +-
.../pekko/stream/scaladsl/SourceWithContext.scala | 8 +-
.../pekko/stream/scaladsl/StreamConverters.scala | 4 +-
.../org/apache/pekko/stream/scaladsl/Tcp.scala | 8 +-
.../stream/serialization/StreamRefSerializer.scala | 18 +-
.../org/apache/pekko/stream/stage/GraphStage.scala | 59 +++--
.../apache/pekko/stream/stage/StageLogging.scala | 2 +-
.../apache/pekko/testkit/TestEventListener.scala | 8 +-
.../apache/pekko/testkit/TestJavaSerializer.scala | 2 +-
.../scala/org/apache/pekko/testkit/TestKit.scala | 18 +-
.../org/apache/pekko/testkit/TestKitUtils.scala | 2 +-
.../apache/pekko/testkit/javadsl/EventFilter.scala | 10 +-
.../org/apache/pekko/testkit/javadsl/TestKit.scala | 6 +-
.../scala/org/apache/pekko/testkit/PekkoSpec.scala | 8 +-
.../apache/pekko/testkit/TestActorRefSpec.scala | 2 +-
.../metrics/reporter/PekkoConsoleReporter.scala | 6 +-
536 files changed, 2567 insertions(+), 2413 deletions(-)
diff --git a/.scalafmt.conf b/.scalafmt.conf
index c4cf1ef617..741e757826 100644
--- a/.scalafmt.conf
+++ b/.scalafmt.conf
@@ -1,5 +1,5 @@
-version = 3.9.7
-runner.dialect = scala213
+version = 3.11.1
+runner.dialect = scala213source3
project.git = true
style = defaultWithAlign
docstrings.style = Asterisk
@@ -24,6 +24,7 @@ binPack.unsafeCallSite = always
binPack.unsafeDefnSite = always
binPack.indentCallSiteSingleArg = false
binPack.indentCallSiteOnce = true
+binPack.importSelectors = unfold
newlines.avoidForSimpleOverflow = [slc]
newlines.source = keep
newlines.beforeMultiline = keep
@@ -75,3 +76,13 @@ project.excludeFilters = [
"scripts/authors.scala"
]
project.layout = StandardConvention
+
+rewrite.scala3.convertToNewSyntax = true
+runner {
+ dialectOverride {
+ allowSignificantIndentation = false
+ allowAsForImportRename = false
+ allowStarWildcardImport = false
+ allowPostfixStarVarargSplices = false
+ }
+}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/Effect.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/Effect.scala
index 5af065e03a..1cbcd2c394 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/Effect.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/Effect.scala
@@ -100,7 +100,7 @@ object Effect {
with Serializable {
override def equals(other: Any) = other match {
- case o: Spawned[_] =>
+ case o: Spawned[?] =>
this.behavior == o.behavior &&
this.childName == o.childName &&
this.props == o.props
@@ -113,7 +113,7 @@ object Effect {
override def _1: Behavior[T] = behavior
override def _2: String = childName
override def _3: Props = props
- override def canEqual(o: Any) = o.isInstanceOf[Spawned[_]]
+ override def canEqual(o: Any) = o.isInstanceOf[Spawned[?]]
}
object Spawned {
@@ -131,7 +131,7 @@ object Effect {
with Serializable {
override def equals(other: Any) = other match {
- case o: SpawnedAnonymous[_] => this.behavior == o.behavior && this.props == o.props
+ case o: SpawnedAnonymous[?] => this.behavior == o.behavior && this.props == o.props
case _ => false
}
override def hashCode: Int = behavior.## * 31 + props.##
@@ -140,7 +140,7 @@ object Effect {
override def productPrefix = "SpawnedAnonymous"
override def _1: Behavior[T] = behavior
override def _2: Props = props
- override def canEqual(o: Any) = o.isInstanceOf[SpawnedAnonymous[_]]
+ override def canEqual(o: Any) = o.isInstanceOf[SpawnedAnonymous[?]]
}
object SpawnedAnonymous {
@@ -160,7 +160,7 @@ object Effect {
with Serializable {
override def equals(other: Any) = other match {
- case o: SpawnedAdapter[_] => this.name == o.name
+ case o: SpawnedAdapter[?] => this.name == o.name
case _ => false
}
override def hashCode: Int = name.##
@@ -168,7 +168,7 @@ object Effect {
override def productPrefix = "SpawnedAdapter"
override def _1: String = name
- override def canEqual(o: Any) = o.isInstanceOf[SpawnedAdapter[_]]
+ override def canEqual(o: Any) = o.isInstanceOf[SpawnedAdapter[?]]
}
/**
@@ -192,17 +192,17 @@ object Effect {
with Serializable {
override def equals(other: Any): Boolean = other match {
- case _: SpawnedAnonymousAdapter[_] => true
+ case _: SpawnedAnonymousAdapter[?] => true
case _ => false
}
override def hashCode: Int = Nil.##
override def toString: String = "SpawnedAnonymousAdapter"
override def productPrefix: String = "SpawnedAnonymousAdapter"
- override def productIterator: Iterator[_] = Iterator.empty
+ override def productIterator: Iterator[?] = Iterator.empty
override def productArity: Int = 0
override def productElement(n: Int) = throw new NoSuchElementException
- override def canEqual(o: Any): Boolean = o.isInstanceOf[SpawnedAnonymousAdapter[_]]
+ override def canEqual(o: Any): Boolean = o.isInstanceOf[SpawnedAnonymousAdapter[?]]
}
/**
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/TestKitSettings.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/TestKitSettings.scala
index 8de5d2b9e4..195d40c101 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/TestKitSettings.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/TestKitSettings.scala
@@ -29,7 +29,7 @@ object TestKitSettings {
/**
* Reads configuration settings from `pekko.actor.testkit.typed` section.
*/
- def apply(system: ActorSystem[_]): TestKitSettings =
+ def apply(system: ActorSystem[?]): TestKitSettings =
Ext(system).settings
/**
@@ -42,7 +42,7 @@ object TestKitSettings {
/**
* Java API: Reads configuration settings from `pekko.actor.testkit.typed` section.
*/
- def create(system: ActorSystem[_]): TestKitSettings =
+ def create(system: ActorSystem[?]): TestKitSettings =
apply(system)
/**
@@ -53,11 +53,11 @@ object TestKitSettings {
new TestKitSettings(config)
private object Ext extends ExtensionId[Ext] {
- override def createExtension(system: ActorSystem[_]): Ext = new Ext(system)
- def get(system: ActorSystem[_]): Ext = Ext.apply(system)
+ override def createExtension(system: ActorSystem[?]): Ext = new Ext(system)
+ def get(system: ActorSystem[?]): Ext = Ext.apply(system)
}
- private class Ext(system: ActorSystem[_]) extends Extension {
+ private class Ext(system: ActorSystem[?]) extends Extension {
val settings: TestKitSettings = TestKitSettings(system.settings.config.getConfig("pekko.actor.testkit.typed"))
}
}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/ActorSystemStub.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/ActorSystemStub.scala
index c39cdc0e98..9d3b1cecc2 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/ActorSystemStub.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/ActorSystemStub.scala
@@ -131,7 +131,7 @@ import pekko.util.FutureConverters._
override def extension[T <: Extension](ext: ExtensionId[T]): T =
throw new UnsupportedOperationException("ActorSystemStub cannot register extensions")
- override def hasExtension(ext: ExtensionId[_ <: Extension]): Boolean =
+ override def hasExtension(ext: ExtensionId[? <: Extension]): Boolean =
throw new UnsupportedOperationException("ActorSystemStub cannot register extensions")
override def log: Logger = LoggerFactory.getLogger(getClass)
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LoggingTestKitImpl.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LoggingTestKitImpl.scala
index 555c4c4c22..3a23dd131e 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LoggingTestKitImpl.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LoggingTestKitImpl.scala
@@ -48,7 +48,7 @@ import pekko.testkit.TestKit
source: Option[String],
messageContains: Option[String],
messageRegex: Option[Regex],
- cause: Option[Class[_ <: Throwable]],
+ cause: Option[Class[? <: Throwable]],
mdc: Map[String, String],
checkExcess: Boolean,
custom: Option[Function[LoggingEvent, Boolean]])
@@ -95,7 +95,7 @@ import pekko.testkit.TestKit
todo > 0
}
- override def expect[T](code: => T)(implicit system: ActorSystem[_]): T = {
+ override def expect[T](code: => T)(implicit system: ActorSystem[?]): T = {
val effectiveLoggerName = loggerName.getOrElse("")
checkLogback(system)
TestAppender.setupTestAppender(effectiveLoggerName)
@@ -120,14 +120,14 @@ import pekko.testkit.TestKit
}
}
- override def expect[T](system: ActorSystem[_], code: Supplier[T]): T =
+ override def expect[T](system: ActorSystem[?], code: Supplier[T]): T =
expect(code.get())(system)
// deprecated (renamed to expect)
- override def intercept[T](code: => T)(implicit system: ActorSystem[_]): T =
+ override def intercept[T](code: => T)(implicit system: ActorSystem[?]): T =
expect(code)(system)
- private def checkLogback(system: ActorSystem[_]): Unit = {
+ private def checkLogback(system: ActorSystem[?]): Unit = {
if (!system.dynamicAccess.classIsOnClasspath("ch.qos.logback.classic.spi.ILoggingEvent")) {
throw new IllegalStateException("LoggingEventFilter requires logback-classic dependency in classpath.")
}
@@ -170,7 +170,7 @@ import pekko.testkit.TestKit
override def withCustom(newCustom: Function[LoggingEvent, Boolean]): LoggingTestKitImpl =
copy(custom = Option(newCustom))
- override def withCause(newCause: Class[_ <: Throwable]): javadsl.LoggingTestKit =
+ override def withCause(newCause: Class[? <: Throwable]): javadsl.LoggingTestKit =
copy(cause = Option(newCause))
}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala
index cc2bce6020..5e62f88eef 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala
@@ -88,7 +88,7 @@ private[pekko] final class FunctionRef[-T](override val path: ActorPath, send: (
@InternalApi private[pekko] val selfInbox = new TestInboxImpl[T](path)
override val self = selfInbox.ref
- private var _children = TreeMap.empty[String, BehaviorTestKitImpl[_]]
+ private var _children = TreeMap.empty[String, BehaviorTestKitImpl[?]]
private val childName = Iterator.from(0).map(Helpers.base64(_))
private val substituteLoggerFactory = new SubstituteLoggerFactory
private val logger: Logger = substituteLoggerFactory.getLogger("StubbedLogger")
@@ -228,7 +228,7 @@ private[pekko] final class FunctionRef[-T](override val path: ActorPath, send: (
checkCurrentActorThread()
}
- override def setLoggerName(clazz: Class[_]): Unit = {
+ override def setLoggerName(clazz: Class[?]): Unit = {
// nop as we don't track logger
checkCurrentActorThread()
}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestKitUtils.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestKitUtils.scala
index e54319dae0..6cc2da2599 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestKitUtils.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestKitUtils.scala
@@ -79,7 +79,7 @@ private[pekko] object TestKitUtils {
// common internal utility impls for Java and Scala
private val TestKitRegex = """org\.apache\.pekko\.testkit\.typed\.(?:javadsl|scaladsl)\.ActorTestKit(?:\$.*)?""".r
- def testNameFromCallStack(classToStartFrom: Class[_]): String =
+ def testNameFromCallStack(classToStartFrom: Class[?]): String =
pekko.testkit.TestKitUtils.testNameFromCallStack(classToStartFrom, TestKitRegex)
/**
@@ -90,7 +90,7 @@ private[pekko] object TestKitUtils {
def scrubActorSystemName(name: String): String =
pekko.testkit.TestKitUtils.scrubActorSystemName(name)
- def shutdown(system: ActorSystem[_], timeout: Duration, throwIfShutdownTimesOut: Boolean): Unit = {
+ def shutdown(system: ActorSystem[?], timeout: Duration, throwIfShutdownTimesOut: Boolean): Unit = {
system.terminate()
try Await.ready(system.whenTerminated, timeout)
catch {
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala
index 18e5ad198e..5e7cead935 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala
@@ -74,7 +74,7 @@ private[pekko] object TestProbeImpl {
}
@InternalApi
-private[pekko] final class TestProbeImpl[M](name: String, system: ActorSystem[_])
+private[pekko] final class TestProbeImpl[M](name: String, system: ActorSystem[?])
extends JavaTestProbe[M]
with ScalaTestProbe[M]
with InternalRecipientRef[M] {
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala
index 6b06770756..6b4504881c 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala
@@ -56,7 +56,7 @@ object ActorTestKit {
* Config loaded from the provided actor if that exists, otherwise
* using default configuration from the reference.conf resources that ship with the Akka libraries.
*/
- def create(system: ActorSystem[_]): ActorTestKit =
+ def create(system: ActorSystem[?]): ActorTestKit =
new ActorTestKit(scaladsl.ActorTestKit(system))
/**
@@ -122,7 +122,7 @@ object ActorTestKit {
* an error is printed to stdout when the system did not shutdown but
* no exception is thrown.
*/
- def shutdown(system: ActorSystem[_], duration: Duration, throwIfShutdownTimesOut: Boolean): Unit = {
+ def shutdown(system: ActorSystem[?], duration: Duration, throwIfShutdownTimesOut: Boolean): Unit = {
TestKitUtils.shutdown(system, duration.asScala, throwIfShutdownTimesOut)
}
@@ -131,7 +131,7 @@ object ActorTestKit {
* if more time than `system-shutdown-default` passes an exception is thrown
* (can be configured with `throw-on-shutdown-timeout`).
*/
- def shutdown(system: ActorSystem[_], duration: Duration): Unit = {
+ def shutdown(system: ActorSystem[?], duration: Duration): Unit = {
val settings = TestKitSettings.create(system)
shutdown(system, duration, settings.ThrowOnShutdownTimeout)
}
@@ -141,7 +141,7 @@ object ActorTestKit {
* if more time than `system-shutdown-default` passes an exception is thrown
* (can be configured with `throw-on-shutdown-timeout`).
*/
- def shutdown(system: ActorSystem[_]): Unit = {
+ def shutdown(system: ActorSystem[?]): Unit = {
val settings = TestKitSettings.create(system)
shutdown(system, settings.DefaultActorSystemShutdownTimeout.asJava, settings.ThrowOnShutdownTimeout)
}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala
index ac3ae80e6e..d306d4e3b4 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala
@@ -25,13 +25,13 @@ import pekko.actor.typed.ActorSystem
final class JUnit5TestKitBuilder() {
- var system: Option[ActorSystem[_]] = None
+ var system: Option[ActorSystem[?]] = None
var customConfig: Config = ApplicationTestConfig
var name: String = TestKitUtils.testNameFromCallStack(classOf[JUnit5TestKitBuilder])
- def withSystem(system: ActorSystem[_]): JUnit5TestKitBuilder = {
+ def withSystem(system: ActorSystem[?]): JUnit5TestKitBuilder = {
this.system = Some(system)
this
}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKit.scala
index 63432d9e96..563fd50aca 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKit.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKit.scala
@@ -78,7 +78,7 @@ import pekko.annotation.DoNotInherit
* Matching events with an included `throwable` that is a class or subclass of the given
* `Throwable` class.
*/
- def withCause(newCause: Class[_ <: Throwable]): LoggingTestKit
+ def withCause(newCause: Class[? <: Throwable]): LoggingTestKit
/**
* Matching events with MDC containing all entries of the given `Map`.
@@ -109,7 +109,7 @@ import pekko.annotation.DoNotInherit
*
* Care is taken to remove the testkit when the block is finished or aborted.
*/
- def expect[T](system: ActorSystem[_], code: Supplier[T]): T
+ def expect[T](system: ActorSystem[?], code: Supplier[T]): T
}
@@ -198,7 +198,7 @@ object LoggingTestKit {
*
* More conditions can be added to the returned [LoggingEventFilter].
*/
- def error(causeClass: Class[_ <: Throwable]): LoggingTestKit =
+ def error(causeClass: Class[? <: Throwable]): LoggingTestKit =
empty.withLogLevel(Level.ERROR).withCause(causeClass)
/**
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala
index 99d526c869..8945324db6 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala
@@ -73,7 +73,7 @@ final class ManualTime(delegate: pekko.testkit.ExplicitlyTriggeredScheduler) {
def timePasses(amount: Duration): Unit = delegate.timePasses(amount.asScala)
@varargs
- def expectNoMessageFor(duration: Duration, on: TestProbe[_]*): Unit = {
+ def expectNoMessageFor(duration: Duration, on: TestProbe[?]*): Unit = {
delegate.timePasses(duration.asScala)
on.foreach(_.expectNoMessage(Duration.ZERO))
}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/SerializationTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/SerializationTestKit.scala
index 16b47af91c..768e5c7ab8 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/SerializationTestKit.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/SerializationTestKit.scala
@@ -20,7 +20,7 @@ import pekko.actor.typed.ActorSystem
/**
* Utilities to test serialization.
*/
-class SerializationTestKit(system: ActorSystem[_]) {
+class SerializationTestKit(system: ActorSystem[?]) {
private val delegate = new scaladsl.SerializationTestKit(system)
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala
index ad7e445b6b..3dfda8fdff 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala
@@ -71,7 +71,7 @@ final class TestKitJunitResource(_kit: ActorTestKit) extends ExternalResource {
/**
* Use a custom [[pekko.actor.typed.ActorSystem]] for the actor system.
*/
- def this(system: ActorSystem[_]) = this(ActorTestKit.create(system))
+ def this(system: ActorSystem[?]) = this(ActorTestKit.create(system))
/**
* Use a custom config for the actor system.
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestProbe.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestProbe.scala
index 1d7bf62122..44f3936d65 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestProbe.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestProbe.scala
@@ -54,16 +54,16 @@ object FishingOutcomes {
object TestProbe {
- def create[M](system: ActorSystem[_]): TestProbe[M] =
+ def create[M](system: ActorSystem[?]): TestProbe[M] =
create(name = "testProbe", system)
- def create[M](@unused clazz: Class[M], system: ActorSystem[_]): TestProbe[M] =
+ def create[M](@unused clazz: Class[M], system: ActorSystem[?]): TestProbe[M] =
create(system)
- def create[M](name: String, system: ActorSystem[_]): TestProbe[M] =
+ def create[M](name: String, system: ActorSystem[?]): TestProbe[M] =
new TestProbeImpl[M](name, system)
- def create[M](name: String, @unused clazz: Class[M], system: ActorSystem[_]): TestProbe[M] =
+ def create[M](name: String, @unused clazz: Class[M], system: ActorSystem[?]): TestProbe[M] =
new TestProbeImpl[M](name, system)
}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKit.scala
index ffad923a50..991cd64730 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKit.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKit.scala
@@ -74,7 +74,7 @@ object ActorTestKit {
* Config loaded from the provided actor if that exists, otherwise
* using default configuration from the reference.conf resources that ship with the Akka libraries.
*/
- def apply(system: ActorSystem[_]): ActorTestKit = {
+ def apply(system: ActorSystem[?]): ActorTestKit = {
val name = testKitGuardianCounter.incrementAndGet() match {
case 1 => "test"
case n => s"test-$n"
@@ -159,7 +159,7 @@ object ActorTestKit {
* Shutdown the given [[pekko.actor.typed.ActorSystem]] and block until it shuts down,
* if more time than `TestKitSettings.DefaultActorSystemShutdownTimeout` passes an exception is thrown
*/
- def shutdown(system: ActorSystem[_]): Unit = {
+ def shutdown(system: ActorSystem[?]): Unit = {
val settings = TestKitSettings(system)
TestKitUtils.shutdown(system, settings.DefaultActorSystemShutdownTimeout, settings.ThrowOnShutdownTimeout)
}
@@ -168,7 +168,7 @@ object ActorTestKit {
* Shutdown the given [[pekko.actor.typed.ActorSystem]] and block until it shuts down
* or the `duration` hits. If the timeout hits `verifySystemShutdown` decides
*/
- def shutdown(system: ActorSystem[_], timeout: Duration, throwIfShutdownFails: Boolean = false): Unit =
+ def shutdown(system: ActorSystem[?], timeout: Duration, throwIfShutdownFails: Boolean = false): Unit =
TestKitUtils.shutdown(system, timeout, throwIfShutdownFails)
/**
@@ -192,7 +192,7 @@ object ActorTestKit {
* For synchronous testing of a `Behavior` see [[BehaviorTestKit]]
*/
final class ActorTestKit private[pekko] (
- val internalSystem: ActorSystem[_],
+ val internalSystem: ActorSystem[?],
internalTestKitGuardian: ActorRef[ActorTestKitGuardian.TestKitCommand],
settings: Option[TestKitSettings]) {
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingTestKit.scala
index 460fa67270..5effef7aa0 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingTestKit.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingTestKit.scala
@@ -108,7 +108,7 @@ import pekko.annotation.DoNotInherit
*
* Care is taken to remove the testkit when the block is finished or aborted.
*/
- def expect[T](code: => T)(implicit system: ActorSystem[_]): T
+ def expect[T](code: => T)(implicit system: ActorSystem[?]): T
/**
* Run the given code block and assert that the criteria of this `LoggingTestKit` has
@@ -118,7 +118,7 @@ import pekko.annotation.DoNotInherit
* Care is taken to remove the testkit when the block is finished or aborted.
*/
@deprecated("Use expect instead.", "Akka 2.6.0")
- def intercept[T](code: => T)(implicit system: ActorSystem[_]): T
+ def intercept[T](code: => T)(implicit system: ActorSystem[?]): T
}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ManualTime.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ManualTime.scala
index 2499cb683e..6339029825 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ManualTime.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ManualTime.scala
@@ -41,7 +41,7 @@ object ManualTime {
* Access the manual scheduler, note that you need to setup the actor system/testkit with [[ManualTime.config]]
* for this to work.
*/
- def apply()(implicit system: ActorSystem[_]): ManualTime =
+ def apply()(implicit system: ActorSystem[?]): ManualTime =
system.scheduler match {
case adapter: SchedulerAdapter =>
adapter.classicScheduler match {
@@ -73,7 +73,7 @@ final class ManualTime(delegate: pekko.testkit.ExplicitlyTriggeredScheduler) {
def timePasses(amount: FiniteDuration): Unit = delegate.timePasses(amount)
@varargs
- def expectNoMessageFor(duration: FiniteDuration, on: TestProbe[_]*): Unit = {
+ def expectNoMessageFor(duration: FiniteDuration, on: TestProbe[?]*): Unit = {
delegate.timePasses(duration)
on.foreach(_.expectNoMessage(Duration.Zero))
}
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala
index ee244dff23..fb6bef609c 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala
@@ -52,7 +52,7 @@ abstract class ScalaTestWithActorTestKit(override val testKit: ActorTestKit)
/**
* Use a custom [[pekko.actor.typed.ActorSystem]] for the actor system.
*/
- def this(system: ActorSystem[_]) = this(ActorTestKit(system))
+ def this(system: ActorSystem[?]) = this(ActorTestKit(system))
/**
* Use a custom config for the actor system.
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/SerializationTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/SerializationTestKit.scala
index 84ecfb2adf..691291aa15 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/SerializationTestKit.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/SerializationTestKit.scala
@@ -22,7 +22,7 @@ import pekko.serialization.Serializers
/**
* Utilities to test serialization.
*/
-class SerializationTestKit(system: ActorSystem[_]) {
+class SerializationTestKit(system: ActorSystem[?]) {
private val serialization = SerializationExtension(system.toClassic)
diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestProbe.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestProbe.scala
index 322f9a7172..2f93ba7daf 100644
--- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestProbe.scala
+++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestProbe.scala
@@ -52,10 +52,10 @@ object FishingOutcomes {
}
object TestProbe {
- def apply[M]()(implicit system: ActorSystem[_]): TestProbe[M] =
+ def apply[M]()(implicit system: ActorSystem[?]): TestProbe[M] =
apply(name = "testProbe")
- def apply[M](name: String)(implicit system: ActorSystem[_]): TestProbe[M] =
+ def apply[M](name: String)(implicit system: ActorSystem[?]): TestProbe[M] =
new TestProbeImpl[M](name, system)
}
diff --git a/actor-testkit-typed/src/test/scala/docs/org/apache/pekko/actor/testkit/typed/scaladsl/SyncTestingExampleSpec.scala b/actor-testkit-typed/src/test/scala/docs/org/apache/pekko/actor/testkit/typed/scaladsl/SyncTestingExampleSpec.scala
index 34a5e4d84f..8fe060f658 100644
--- a/actor-testkit-typed/src/test/scala/docs/org/apache/pekko/actor/testkit/typed/scaladsl/SyncTestingExampleSpec.scala
+++ b/actor-testkit-typed/src/test/scala/docs/org/apache/pekko/actor/testkit/typed/scaladsl/SyncTestingExampleSpec.scala
@@ -233,10 +233,10 @@ class SyncTestingExampleSpec extends AnyWordSpec with Matchers {
testKit.run(ConfigAware.SpawnChild(inbox.ref.narrow))
val childTestKit = inbox.receiveMessage() match {
- case ar: ActorRef[_] =>
+ case ar: ActorRef[?] =>
testKit.childTestKit(ar.unsafeUpcast[Any].narrow[ConfigAware.Command])
case unexpected =>
- unexpected should be(a[ActorRef[_]])
+ unexpected should be(a[ActorRef[?]])
???
}
diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala
index c3cdc0eb79..cf1bff5c74 100644
--- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala
+++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala
@@ -55,7 +55,7 @@ class ActorTestKitSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike wi
}
"use name from given class name with replaced package name" in {
- val testkit2 = ActorTestKit(classOf[Vector[_]].getName)
+ val testkit2 = ActorTestKit(classOf[Vector[?]].getName)
try {
// removing package name and such
testkit2.system.name should ===("Vector")
@@ -170,7 +170,7 @@ class MyConcreteDerivateSpec extends MyBaseSpec {
}
"use name from given class name" in {
- val testkit2 = ActorTestKit(classOf[Vector[_]].getName)
+ val testkit2 = ActorTestKit(classOf[Vector[?]].getName)
try {
testkit2.system.name should ===("Vector")
} finally testkit2.shutdownTestKit()
diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala
index e4c45b0240..fa3f36d530 100644
--- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala
+++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala
@@ -209,7 +209,7 @@ class BehaviorTestKitSpec extends AnyWordSpec with Matchers with LogCapturing {
"allow assertions on effect type" in {
val testkit = BehaviorTestKit[Parent.Command](Parent.init)
testkit.run(SpawnAnonymous(1))
- val spawnAnonymous = testkit.expectEffectType[Effect.SpawnedAnonymous[_]]
+ val spawnAnonymous = testkit.expectEffectType[Effect.SpawnedAnonymous[?]]
spawnAnonymous.props should ===(Props.empty)
}
@@ -400,7 +400,7 @@ class BehaviorTestKitSpec extends AnyWordSpec with Matchers with LogCapturing {
val sessionRef =
testkit.runAsk[ActorRef[String]](SpawnSession(_, h.ref)).receiveReply()
- val s = testkit.expectEffectType[SpawnedAnonymous[_]]
+ val s = testkit.expectEffectType[SpawnedAnonymous[?]]
// must be able to get the created ref, even without explicit reply
s.ref shouldBe sessionRef
@@ -422,7 +422,7 @@ class BehaviorTestKitSpec extends AnyWordSpec with Matchers with LogCapturing {
testkit.expectEffect(Stopped(child.childName))
testkit.run(SpawnChild)
- val newChild = testkit.expectEffectType[Spawned[_]]
+ val newChild = testkit.expectEffectType[Spawned[?]]
child.childName shouldBe newChild.childName
}
}
diff --git a/actor-tests/src/test/scala-3/org/apache/pekko/util/LineNumberSpec.scala b/actor-tests/src/test/scala-3/org/apache/pekko/util/LineNumberSpec.scala
index 0cb668d49f..87837251e9 100644
--- a/actor-tests/src/test/scala-3/org/apache/pekko/util/LineNumberSpec.scala
+++ b/actor-tests/src/test/scala-3/org/apache/pekko/util/LineNumberSpec.scala
@@ -15,14 +15,14 @@ package org.apache.pekko.util
import org.apache.pekko
import pekko.testkit.PekkoSpec
-import pekko.util.LineNumbers._
+import pekko.util.LineNumbers.*
class LineNumberSpec extends PekkoSpec {
"LineNumbers" when {
"writing Scala" must {
- import LineNumberSpecCodeForScala._
+ import LineNumberSpecCodeForScala.*
"work for small functions" in {
LineNumbers(oneline) should ===(SourceFileLines("LineNumberSpecCodeForScala.scala", 22, 22))
diff --git a/actor-tests/src/test/scala/org/apache/pekko/PekkoExceptionSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/PekkoExceptionSpec.scala
index 79439d1cb4..c8a2e59039 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/PekkoExceptionSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/PekkoExceptionSpec.scala
@@ -36,7 +36,7 @@ class PekkoExceptionSpec extends AnyWordSpec with Matchers {
}
}
- def verify(clazz: java.lang.Class[_]): Unit = {
+ def verify(clazz: java.lang.Class[?]): Unit = {
clazz.getConstructor(Array(classOf[String]): _*)
}
}
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorMailboxSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorMailboxSpec.scala
index 99222249ff..83b60916b9 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorMailboxSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorMailboxSpec.scala
@@ -241,7 +241,7 @@ class ActorMailboxSpec(conf: Config) extends PekkoSpec(conf) with DefaultTimeout
def this() = this(ActorMailboxSpec.mailboxConf)
- def checkMailboxQueue(props: Props, name: String, types: Seq[Class[_]]): MessageQueue = {
+ def checkMailboxQueue(props: Props, name: String, types: Seq[Class[?]]): MessageQueue = {
val actor = system.actorOf(props, name)
actor ! "ping"
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemSpec.scala
index fd9b4f52f1..3345d1859a 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemSpec.scala
@@ -41,11 +41,12 @@ object ActorSystemSpec {
def receive = {
case n: Int =>
master = sender()
- terminaters = Set() ++ (for (_ <- 1 to n) yield {
- val man = context.watch(context.system.actorOf(Props[Terminater]()))
- man ! "run"
- man
- })
+ terminaters = Set() ++
+ (for (_ <- 1 to n) yield {
+ val man = context.watch(context.system.actorOf(Props[Terminater]()))
+ man ! "run"
+ man
+ })
case Terminated(child) if terminaters contains child =>
terminaters -= child
if (terminaters.isEmpty) {
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/CoordinatedShutdownSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/CoordinatedShutdownSpec.scala
index d2d7554421..60141592e6 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/CoordinatedShutdownSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/CoordinatedShutdownSpec.scala
@@ -581,7 +581,8 @@ class CoordinatedShutdownSpec
}
}
- "add and remove user JVM hooks with run-by-jvm-shutdown-hook = off, terminate-actor-system = off" in new JvmHookTest {
+ "add and remove user JVM hooks with run-by-jvm-shutdown-hook = off, terminate-actor-system = off" in
+ new JvmHookTest {
lazy val systemName = s"CoordinatedShutdownSpec-JvmHooks-1-${System.currentTimeMillis()}"
lazy val systemConfig = ConfigFactory.parseString("""
pekko.coordinated-shutdown.run-by-jvm-shutdown-hook = off
@@ -597,7 +598,8 @@ class CoordinatedShutdownSpec
}
}
- "add and remove user JVM hooks with run-by-jvm-shutdown-hook = on, terminate-actor-system = off" in new JvmHookTest {
+ "add and remove user JVM hooks with run-by-jvm-shutdown-hook = on, terminate-actor-system = off" in
+ new JvmHookTest {
lazy val systemName = s"CoordinatedShutdownSpec-JvmHooks-2-${System.currentTimeMillis()}"
lazy val systemConfig = ConfigFactory.parseString("""
pekko.coordinated-shutdown.run-by-jvm-shutdown-hook = on
@@ -629,7 +631,8 @@ class CoordinatedShutdownSpec
}
}
- "add and remove user JVM hooks with run-by-jvm-shutdown-hook = on, pekko.jvm-shutdown-hooks = off" in new JvmHookTest {
+ "add and remove user JVM hooks with run-by-jvm-shutdown-hook = on, pekko.jvm-shutdown-hooks = off" in
+ new JvmHookTest {
lazy val systemName = s"CoordinatedShutdownSpec-JvmHooks-4-${System.currentTimeMillis()}"
lazy val systemConfig = ConfigFactory.parseString("""
pekko.jvm-shutdown-hooks = off
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/DynamicAccessSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/DynamicAccessSpec.scala
index 2f1bf94099..4517af50c2 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/DynamicAccessSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/DynamicAccessSpec.scala
@@ -82,7 +82,7 @@ class DynamicAccessSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll
case Failure(_: NoSuchMethodException) =>
dynamicAccess
.createInstanceFor[TestSuperclass](fqcn, immutable.Seq((classOf[String], "string ctor argument")))
- case f: Failure[_] => f
+ case f: Failure[?] => f
}
}
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ExtensionSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ExtensionSpec.scala
index 62084fb17d..898083055b 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/ExtensionSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ExtensionSpec.scala
@@ -45,7 +45,7 @@ object InstanceCountingExtension extends ExtensionId[InstanceCountingExtension]
override def createExtension(system: ExtendedActorSystem): InstanceCountingExtension = {
new InstanceCountingExtension
}
- override def lookup: ExtensionId[_ <: Extension] = this
+ override def lookup: ExtensionId[? <: Extension] = this
}
class InstanceCountingExtension extends Extension {
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ReceiveTimeoutSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ReceiveTimeoutSpec.scala
index 0a0b0ee0eb..4cf8978adf 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/ReceiveTimeoutSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ReceiveTimeoutSpec.scala
@@ -265,7 +265,8 @@ class ReceiveTimeoutSpec extends PekkoSpec() {
system.stop(timeoutActor)
}
- "work correctly if the timeout is changed multiple times while handling a NotInfluenceReceiveTimeout message" taggedAs TimingTest in {
+ "work correctly if the timeout is changed multiple times while handling a NotInfluenceReceiveTimeout message" taggedAs
+ TimingTest in {
val probe = TestProbe()
val initialTimeout = 500.millis
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala
index f9e30481f9..a8642562e3 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala
@@ -200,10 +200,11 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit
}
val latencies = within(10.seconds) {
for (i <- 1 to N)
- yield try expectMsgType[Long]
- catch {
- case NonFatal(e) => throw new Exception(s"failed expecting the $i-th latency", e)
- }
+ yield
+ try expectMsgType[Long]
+ catch {
+ case NonFatal(e) => throw new Exception(s"failed expecting the $i-th latency", e)
+ }
}
val histogram = latencies.groupBy(_ / 100000000L)
for (k <- histogram.keys.toSeq.sorted) {
@@ -505,10 +506,11 @@ class LightArrayRevolverSchedulerSpec extends PekkoSpec(SchedulerSpec.testConfRe
println(cancelled)
val latencies = within(10.seconds) {
for (i <- 1 to (N - cancelled))
- yield try expectMsgType[Long]
- catch {
- case NonFatal(e) => throw new Exception(s"failed expecting the $i-th latency", e)
- }
+ yield
+ try expectMsgType[Long]
+ catch {
+ case NonFatal(e) => throw new Exception(s"failed expecting the $i-th latency", e)
+ }
}
val histogram = latencies.groupBy(_ / 100000000L)
for (k <- histogram.keys.toSeq.sorted) {
@@ -815,10 +817,11 @@ class LightArrayRevolverSchedulerSpec extends PekkoSpec(SchedulerSpec.testConfRe
override protected def waitNanos(ns: Long): Unit = {
// println(s"waiting $ns")
prb.ref ! ns
- try time += (lbq.get match {
- case q: LinkedBlockingQueue[Long] => q.take()
- case null => 0L
- })
+ try time +=
+ (lbq.get match {
+ case q: LinkedBlockingQueue[Long] => q.take()
+ case null => 0L
+ })
catch {
case _: InterruptedException => Thread.currentThread.interrupt()
}
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorHierarchySpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorHierarchySpec.scala
index acc5903a91..3dfdd94561 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorHierarchySpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorHierarchySpec.scala
@@ -558,7 +558,8 @@ object SupervisorHierarchySpec {
case this.Event(StateTimeout, todo) =>
log.info("dumping state due to StateTimeout")
log.info(
- "children: " + children.size + " pinged: " + pingChildren.size + " idle: " + idleChildren.size + " work: " + todo)
+ "children: " + children.size + " pinged: " + pingChildren.size + " idle: " + idleChildren.size + " work: " +
+ todo)
pingChildren.foreach(println)
println(system.asInstanceOf[ActorSystemImpl].printTree)
pingChildren.foreach(getErrorsUp)
@@ -927,8 +928,8 @@ class SupervisorHierarchySpec extends PekkoSpec(SupervisorHierarchySpec.config)
fsm ! FSM.SubscribeTransitionCallBack(system.actorOf(Props(new Actor {
def receive = {
- case s: FSM.CurrentState[_] => log.info("{}", s)
- case t: FSM.Transition[_] => log.info("{}", t)
+ case s: FSM.CurrentState[?] => log.info("{}", s)
+ case t: FSM.Transition[?] => log.info("{}", t)
}
})))
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/TypedActorSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/TypedActorSpec.scala
index 0a113862f5..41480a178a 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/TypedActorSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/TypedActorSpec.scala
@@ -414,7 +414,7 @@ class TypedActorSpec
case e: IllegalStateException if e.getMessage == "expected" => SupervisorStrategy.Resume
}
def receive = {
- case p: TypedProps[_] => context.sender() ! pekko.actor.TypedActor(context).typedActorOf(p)
+ case p: TypedProps[?] => context.sender() ! pekko.actor.TypedActor(context).typedActorOf(p)
}
}))
val t = Await.result(
@@ -515,7 +515,7 @@ class TypedActorSpec
val m = pekko.actor.TypedActor.MethodCall(
classOf[Foo].getDeclaredMethod(
"testMethodCallSerialization",
- Array[Class[_]](classOf[Foo], classOf[String], classOf[Int], classOf[WithStringSerializedClass]): _*),
+ Array[Class[?]](classOf[Foo], classOf[String], classOf[Int], classOf[WithStringSerializedClass]): _*),
Array[AnyRef](someFoo, null, 1.asInstanceOf[AnyRef], WithStringSerializedClass()))
val baos = new ByteArrayOutputStream(8192 * 4)
val out = new ObjectOutputStream(baos)
diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/BalancingDispatcherSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/BalancingDispatcherSpec.scala
index 08e0bf2ab9..63e367b21a 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/BalancingDispatcherSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/BalancingDispatcherSpec.scala
@@ -95,7 +95,8 @@ class BalancingDispatcherSpec extends PekkoSpec(BalancingDispatcherSpec.config)
fast.underlying.asInstanceOf[ActorCell].mailbox.hasMessages should ===(false)
slow.underlying.asInstanceOf[ActorCell].mailbox.hasMessages should ===(false)
fast.underlying.asInstanceOf[ActorCell].actor.asInstanceOf[DelayableActor].invocationCount should be > sentToFast
- fast.underlying.asInstanceOf[ActorCell].actor.asInstanceOf[DelayableActor].invocationCount should be >
+ fast.underlying.asInstanceOf[ActorCell].actor.asInstanceOf[DelayableActor].invocationCount should
+ be >
slow.underlying.asInstanceOf[ActorCell].actor.asInstanceOf[DelayableActor].invocationCount
system.stop(slow)
system.stop(fast)
diff --git a/actor-tests/src/test/scala/org/apache/pekko/dispatch/MailboxConfigSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/dispatch/MailboxConfigSpec.scala
index d9e26a4d86..7b04d1cb9b 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/dispatch/MailboxConfigSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/dispatch/MailboxConfigSpec.scala
@@ -127,7 +127,7 @@ abstract class MailboxSpec extends PekkoSpec with BeforeAndAfterAll with BeforeA
def ensureInitialMailboxState(config: MailboxType, q: MessageQueue): Unit = {
q should not be null
q match {
- case aQueue: BlockingQueue[_] =>
+ case aQueue: BlockingQueue[?] =>
config match {
case BoundedMailbox(capacity, _) => aQueue.remainingCapacity should ===(capacity)
case UnboundedMailbox() => aQueue.remainingCapacity should ===(Int.MaxValue)
diff --git a/actor-tests/src/test/scala/org/apache/pekko/event/LoggingReceiveSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/event/LoggingReceiveSpec.scala
index 910aa7f814..d0bba945ba 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/event/LoggingReceiveSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/event/LoggingReceiveSpec.scala
@@ -59,7 +59,7 @@ class LoggingReceiveSpec extends AnyWordSpec with BeforeAndAfterAll {
def ignoreMute(t: TestKit): Unit = {
t.ignoreMsg {
- case (_: TestEvent.Mute | _: TestEvent.UnMute) => true
+ case _: TestEvent.Mute | _: TestEvent.UnMute => true
}
}
diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/AskSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/AskSpec.scala
index e79024c34d..a8de9413af 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/pattern/AskSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/AskSpec.scala
@@ -129,8 +129,8 @@ class AskSpec extends PekkoSpec("""
implicit val timeout: Timeout = Timeout(5.seconds)
import system.dispatcher
val echo = system.actorOf(Props(new Actor { def receive = { case x => sender() ! x } }), "select-echo")
- val identityFuture =
- (system.actorSelection("/user/select-echo") ? Identify(None)).mapTo[ActorIdentity].map(_.ref.get)
+ val identityFuture = (system.actorSelection("/user/select-echo") ? Identify(None)).mapTo[ActorIdentity].map(
+ _.ref.get)
Await.result(identityFuture, 5.seconds) should ===(echo)
}
diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/StatusReplySpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/StatusReplySpec.scala
index cc0cffb91c..c1cce80d8b 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/pattern/StatusReplySpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/StatusReplySpec.scala
@@ -44,7 +44,7 @@ class StatusReplySpec extends PekkoSpec with ScalaFutures {
}
}
"not throw exception if null" in {
- (null: StatusReply[_]) match {
+ (null: StatusReply[?]) match {
case StatusReply.Success(_) => fail()
case StatusReply.Error(_) => fail()
case _ =>
diff --git a/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializationSetupSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializationSetupSpec.scala
index 9b8aac0896..2ca2470f39 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializationSetupSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializationSetupSpec.scala
@@ -46,7 +46,7 @@ final class FakeSerializer extends Serializer {
Array(id.toByte)
}
- def fromBinary(bytes: Array[Byte], clazz: Option[Class[_]]) = {
+ def fromBinary(bytes: Array[Byte], clazz: Option[Class[?]]) = {
require(bytes.length == 1)
val id = bytes(0).toInt
registry.get(id)
diff --git a/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializeSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializeSpec.scala
index cb379ee854..a188d32c80 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializeSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializeSpec.scala
@@ -364,7 +364,7 @@ class VerifySerializabilitySpec extends PekkoSpec(SerializationTests.verifySeria
class ReferenceSerializationSpec extends PekkoSpec(SerializationTests.mostlyReferenceSystem) {
val ser = SerializationExtension(system)
- def serializerMustBe(toSerialize: Class[_], expectedSerializer: Class[_]) =
+ def serializerMustBe(toSerialize: Class[?], expectedSerializer: Class[?]) =
ser.serializerFor(toSerialize).getClass should ===(expectedSerializer)
"Serialization settings from reference.conf" must {
@@ -402,7 +402,7 @@ class ReferenceSerializationSpec extends PekkoSpec(SerializationTests.mostlyRefe
class AllowJavaSerializationSpec extends PekkoSpec(SerializationTests.allowJavaSerializationSystem) {
val ser = SerializationExtension(system)
- def serializerMustBe(toSerialize: Class[_], expectedSerializer: Class[_]) =
+ def serializerMustBe(toSerialize: Class[?], expectedSerializer: Class[?]) =
ser.serializerFor(toSerialize).getClass should ===(expectedSerializer)
val address = SerializationTests.Address("120", "Monroe Street", "Santa Clara", "95050")
@@ -595,7 +595,7 @@ protected[pekko] class NoopSerializer extends Serializer {
Array.empty[Byte]
}
- def fromBinary(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = null
+ def fromBinary(bytes: Array[Byte], clazz: Option[Class[?]]): AnyRef = null
}
protected[pekko] class NoopSerializer2 extends Serializer {
@@ -607,7 +607,7 @@ protected[pekko] class NoopSerializer2 extends Serializer {
Array.empty[Byte]
}
- def fromBinary(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = null
+ def fromBinary(bytes: Array[Byte], clazz: Option[Class[?]]): AnyRef = null
}
protected[pekko] class NoopSerializerSameId extends NoopSerializer
@@ -628,5 +628,5 @@ class DeadlockSerializer(system: ExtendedActorSystem) extends Serializer {
def toBinary(o: AnyRef): Array[Byte] = Array.empty[Byte]
- def fromBinary(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = null
+ def fromBinary(bytes: Array[Byte], clazz: Option[Class[?]]): AnyRef = null
}
diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/BoundedBlockingQueueSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/BoundedBlockingQueueSpec.scala
index 1302cae07a..3ea6b3dc8b 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/util/BoundedBlockingQueueSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/util/BoundedBlockingQueueSpec.scala
@@ -740,7 +740,7 @@ trait BlockingHelpers {
/**
* Check that a Future does not complete within a set timespan.
*/
- def mustBlockFor(timeout: Span, action: Future[_])(implicit pos: Position): Unit =
+ def mustBlockFor(timeout: Span, action: Future[?])(implicit pos: Position): Unit =
Exception.ignoring(classOf[TimeoutException]) {
Await.ready(action, timeout)
fail("Expected action to block for at least " + timeout.prettyString + " but it completed.")
diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringInitializationSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringInitializationSpec.scala
index b14b5e56f0..071fbea89c 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringInitializationSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringInitializationSpec.scala
@@ -29,7 +29,7 @@ class ByteStringInitializationSpec extends AnyWordSpec with Matchers {
val cleanCl = new ClassLoader(null) {
val outerCl = ByteStringInitializationSpec.this.getClass.getClassLoader
val buffer = new Array[Byte](1000000)
- override def loadClass(name: String): Class[_] =
+ override def loadClass(name: String): Class[?] =
if (!name.startsWith("org.apache.pekko")) outerCl.loadClass(name)
else {
val classFile = name.replace(".", "/") + ".class"
diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringSpec.scala
index e70f2ad8b3..3142de2a95 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringSpec.scala
@@ -198,7 +198,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers {
(!strict || (bsAIt.toSeq -> bsBIt.toSeq) == (vecAIt.toSeq -> vecBIt.toSeq))
}
- def likeVecBld(body: Builder[Byte, _] => Unit): Boolean = {
+ def likeVecBld(body: Builder[Byte, ?] => Unit): Boolean = {
val bsBuilder = ByteString.newBuilder
val vecBuilder = Vector.newBuilder[Byte]
diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/WildcardIndexSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/WildcardIndexSpec.scala
index 7757db7daf..9ee1fe4bae 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/util/WildcardIndexSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/util/WildcardIndexSpec.scala
@@ -20,9 +20,9 @@ class WildcardIndexSpec extends AnyWordSpec with Matchers {
"wildcard index" must {
"allow to insert elements using Arrays of strings" in {
- emptyIndex.insert(Array("a", "b"), 1) shouldBe a[WildcardIndex[_]]
- emptyIndex.insert(Array("a"), 1) shouldBe a[WildcardIndex[_]]
- emptyIndex.insert(Array.empty[String], 1) shouldBe a[WildcardIndex[_]]
+ emptyIndex.insert(Array("a", "b"), 1) shouldBe a[WildcardIndex[?]]
+ emptyIndex.insert(Array("a"), 1) shouldBe a[WildcardIndex[?]]
+ emptyIndex.insert(Array.empty[String], 1) shouldBe a[WildcardIndex[?]]
}
"allow to find inserted elements" in {
diff --git a/actor-typed-tests/src/test/scala-3/docs/org/apache/pekko/typed/InteractionPatterns3Spec.scala b/actor-typed-tests/src/test/scala-3/docs/org/apache/pekko/typed/InteractionPatterns3Spec.scala
index bd7f7203be..c449112ff6 100644
--- a/actor-typed-tests/src/test/scala-3/docs/org/apache/pekko/typed/InteractionPatterns3Spec.scala
+++ b/actor-typed-tests/src/test/scala-3/docs/org/apache/pekko/typed/InteractionPatterns3Spec.scala
@@ -16,7 +16,7 @@ package docs.org.apache.pekko.typed
import java.net.URI
import scala.concurrent.Future
-import scala.concurrent.duration._
+import scala.concurrent.duration.*
import scala.util.Failure
import scala.util.Success
import org.apache.pekko
@@ -45,7 +45,7 @@ object DummyData3 {
}
class InteractionPatterns3Spec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing {
- import DummyData3._
+ import DummyData3.*
private class DummyContext[T](val self: ActorRef[T])
"The interaction patterns docs" must {
@@ -140,7 +140,6 @@ class InteractionPatterns3Spec extends ScalaTestWithActorTestKit with AnyWordSpe
def apply(backend: ActorRef[Backend.Request]): Behavior[Command] = // (2)
Behaviors.setup[CommandAndResponse] { context =>
-
def active(inProgress: Map[Int, ActorRef[URI]], count: Int): Behavior[CommandAndResponse] = {
Behaviors.receiveMessage[CommandAndResponse] {
case Translate(site, replyTo) =>
@@ -205,7 +204,7 @@ class InteractionPatterns3Spec extends ScalaTestWithActorTestKit with AnyWordSpe
target: ActorRef[Buncher.Batch],
after: FiniteDuration,
maxSize: Int) {
- import Buncher._
+ import Buncher.*
private def idle(): Behavior[Command] = {
Behaviors.receiveMessage[Command] { message =>
@@ -221,7 +220,7 @@ class InteractionPatterns3Spec extends ScalaTestWithActorTestKit with AnyWordSpe
idle()
case m =>
val newBuffer = buffer :+ m
- if (newBuffer.size == maxSize) {
+ if newBuffer.size == maxSize then {
timers.cancel(TimerKey)
target ! Batch(newBuffer)
idle()
@@ -472,7 +471,7 @@ class InteractionPatterns3Spec extends ScalaTestWithActorTestKit with AnyWordSpe
def apply(): Behaviors.Receive[CookieFabric.GiveMeCookies] =
Behaviors.receiveMessage { message =>
- if (message.count >= 5)
+ if message.count >= 5 then
message.replyTo ! InvalidRequest("Too many cookies.")
else
message.replyTo ! Cookies(message.count)
@@ -489,14 +488,14 @@ class InteractionPatterns3Spec extends ScalaTestWithActorTestKit with AnyWordSpe
// #standalone-ask
import org.apache.pekko
- import pekko.actor.typed.scaladsl.AskPattern._
+ import pekko.actor.typed.scaladsl.AskPattern.*
import pekko.util.Timeout
// asking someone requires a timeout if the timeout hits without response
// the ask is failed with a TimeoutException
implicit val timeout: Timeout = 3.seconds
// implicit ActorSystem in scope
- implicit val system: ActorSystem[_] = theSystem
+ implicit val system: ActorSystem[?] = theSystem
val result: Future[CookieFabric.Reply] = cookieFabric.ask(ref => CookieFabric.GiveMeCookies(3, ref))
@@ -537,7 +536,7 @@ class InteractionPatterns3Spec extends ScalaTestWithActorTestKit with AnyWordSpe
def apply(): Behaviors.Receive[CookieFabric.GiveMeCookies] =
Behaviors.receiveMessage { message =>
- if (message.count >= 5)
+ if message.count >= 5 then
message.replyTo ! StatusReply.Error("Too many cookies.")
else
message.replyTo ! StatusReply.Success(Cookies(message.count))
@@ -554,14 +553,14 @@ class InteractionPatterns3Spec extends ScalaTestWithActorTestKit with AnyWordSpe
// #standalone-ask-with-status
import org.apache.pekko
- import pekko.actor.typed.scaladsl.AskPattern._
+ import pekko.actor.typed.scaladsl.AskPattern.*
import pekko.util.Timeout
// asking someone requires a timeout if the timeout hits without response
// the ask is failed with a TimeoutException
implicit val timeout: Timeout = 3.seconds
// implicit ActorSystem in scope
- implicit val system: ActorSystem[_] = theSystem
+ implicit val system: ActorSystem[?] = theSystem
val result: Future[CookieFabric.Cookies] = cookieFabric.askWithStatus(ref => CookieFabric.GiveMeCookies(3, ref))
@@ -621,7 +620,7 @@ class InteractionPatterns3Spec extends ScalaTestWithActorTestKit with AnyWordSpe
Behaviors.receive { (context, command) =>
command match {
case Update(value, replyTo) =>
- if (operationsInProgress == MaxOperationsInProgress) {
+ if operationsInProgress == MaxOperationsInProgress then {
replyTo ! UpdateFailure(value.id, s"Max $MaxOperationsInProgress concurrent operations supported")
Behaviors.same
} else {
diff --git a/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/InteractionPatternsSpec.scala b/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/InteractionPatternsSpec.scala
index 6e2c5a40ed..a5cda8b824 100644
--- a/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/InteractionPatternsSpec.scala
+++ b/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/InteractionPatternsSpec.scala
@@ -495,7 +495,7 @@ class InteractionPatternsSpec extends ScalaTestWithActorTestKit with AnyWordSpec
// the ask is failed with a TimeoutException
implicit val timeout: Timeout = 3.seconds
// implicit ActorSystem in scope
- implicit val system: ActorSystem[_] = theSystem
+ implicit val system: ActorSystem[?] = theSystem
val result: Future[CookieFabric.Reply] = cookieFabric.ask(ref => CookieFabric.GiveMeCookies(3, ref))
@@ -560,7 +560,7 @@ class InteractionPatternsSpec extends ScalaTestWithActorTestKit with AnyWordSpec
// the ask is failed with a TimeoutException
implicit val timeout: Timeout = 3.seconds
// implicit ActorSystem in scope
- implicit val system: ActorSystem[_] = theSystem
+ implicit val system: ActorSystem[?] = theSystem
val result: Future[CookieFabric.Cookies] = cookieFabric.askWithStatus(ref => CookieFabric.GiveMeCookies(3, ref))
diff --git a/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/LoggingDocExamples.scala b/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/LoggingDocExamples.scala
index f4e62b3279..ea59d532fb 100644
--- a/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/LoggingDocExamples.scala
+++ b/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/LoggingDocExamples.scala
@@ -104,7 +104,7 @@ object LoggingDocExamples {
}
def withMdc(): Unit = {
- val system: ActorSystem[_] = ???
+ val system: ActorSystem[?] = ???
// #withMdc
val staticMdc = Map("startTime" -> system.startTime.toString)
@@ -118,7 +118,7 @@ object LoggingDocExamples {
}
def logging(): Unit = {
- implicit val system: ActorSystem[_] = ???
+ implicit val system: ActorSystem[?] = ???
final case class Message(s: String)
val ref: ActorRef[Message] = ???
diff --git a/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/StyleGuideDocExamples.scala b/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/StyleGuideDocExamples.scala
index 5d950775f7..49d58c530f 100644
--- a/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/StyleGuideDocExamples.scala
+++ b/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/StyleGuideDocExamples.scala
@@ -311,7 +311,7 @@ object StyleGuideDocExamples {
// #behavior-factory-method
object Usage {
- val context: ActorContext[_] = ???
+ val context: ActorContext[?] = ???
val doneRef: ActorRef[Done] = ???
// #behavior-factory-method-spawn
diff --git a/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/extensions/ExtensionDocSpec.scala b/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/extensions/ExtensionDocSpec.scala
index d7d6f831e0..7e8b20a20c 100644
--- a/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/extensions/ExtensionDocSpec.scala
+++ b/actor-typed-tests/src/test/scala/docs/org/apache/pekko/typed/extensions/ExtensionDocSpec.scala
@@ -33,16 +33,16 @@ class ExpensiveDatabaseConnection {
//#extension-id
object DatabasePool extends ExtensionId[DatabasePool] {
// will only be called once
- def createExtension(system: ActorSystem[_]): DatabasePool = new DatabasePool(system)
+ def createExtension(system: ActorSystem[?]): DatabasePool = new DatabasePool(system)
// Java API
- def get(system: ActorSystem[_]): DatabasePool = apply(system)
+ def get(system: ActorSystem[?]): DatabasePool = apply(system)
}
//#extension-id
@nowarn
//#extension
-class DatabasePool(system: ActorSystem[_]) extends Extension {
+class DatabasePool(system: ActorSystem[?]) extends Extension {
// database configuration can be loaded from config
// from the actor system
private val _connection = new ExpensiveDatabaseConnection()
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/AskSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/AskSpec.scala
index 0a6b650dd0..58ec6dad74 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/AskSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/AskSpec.scala
@@ -108,7 +108,7 @@ class AskSpec extends ScalaTestWithActorTestKit("""
"fail the future if the actor doesn't exist" in {
val noSuchActor: ActorRef[Msg] = system match {
- case adaptedSys: ActorSystemAdapter[_] =>
+ case adaptedSys: ActorSystemAdapter[?] =>
import pekko.actor.typed.scaladsl.adapter._
adaptedSys.system.provider.resolveActorRef("/foo/bar")
case _ =>
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ExtensionsSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ExtensionsSpec.scala
index 17bfa5d4ce..34c77d09c8 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ExtensionsSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ExtensionsSpec.scala
@@ -31,17 +31,17 @@ import pekko.actor.typed.scaladsl.Behaviors
class DummyExtension1 extends Extension
object DummyExtension1 extends ExtensionId[DummyExtension1] {
- def createExtension(system: ActorSystem[_]) = new DummyExtension1
- def get(system: ActorSystem[_]): DummyExtension1 = apply(system)
+ def createExtension(system: ActorSystem[?]) = new DummyExtension1
+ def get(system: ActorSystem[?]): DummyExtension1 = apply(system)
}
-class DummyExtension1Setup(factory: ActorSystem[_] => DummyExtension1)
+class DummyExtension1Setup(factory: ActorSystem[?] => DummyExtension1)
extends AbstractExtensionSetup[DummyExtension1](DummyExtension1, factory)
class DummyExtension1ViaSetup extends DummyExtension1
class SlowExtension extends Extension
object SlowExtension extends ExtensionId[SlowExtension] {
- def createExtension(system: ActorSystem[_]) = {
+ def createExtension(system: ActorSystem[?]) = {
Thread.sleep(25)
new SlowExtension
}
@@ -49,29 +49,29 @@ object SlowExtension extends ExtensionId[SlowExtension] {
class FailingToLoadExtension extends Extension
object FailingToLoadExtension extends ExtensionId[FailingToLoadExtension] {
- def createExtension(system: ActorSystem[_]) = {
+ def createExtension(system: ActorSystem[?]) = {
throw new RuntimeException("I cannot be trusted!")
}
}
class MultiExtension(val n: Int) extends Extension
class MultiExtensionId(n: Int) extends ExtensionId[MultiExtension] {
- def createExtension(system: ActorSystem[_]): MultiExtension = new MultiExtension(n)
+ def createExtension(system: ActorSystem[?]): MultiExtension = new MultiExtension(n)
}
object InstanceCountingExtension extends ExtensionId[DummyExtension1] {
val createCount = new AtomicInteger(0)
- override def createExtension(system: ActorSystem[_]): DummyExtension1 = {
+ override def createExtension(system: ActorSystem[?]): DummyExtension1 = {
createCount.addAndGet(1)
new DummyExtension1
}
}
object AccessSystemFromConstructorExtensionId extends ExtensionId[AccessSystemFromConstructor] {
- override def createExtension(system: ActorSystem[_]): AccessSystemFromConstructor =
+ override def createExtension(system: ActorSystem[?]): AccessSystemFromConstructor =
new AccessSystemFromConstructor(system)
}
-class AccessSystemFromConstructor(system: ActorSystem[_]) extends Extension {
+class AccessSystemFromConstructor(system: ActorSystem[?]) extends Extension {
system.log.info("I log from the constructor")
system.receptionist ! Receptionist.Find(ServiceKey[String]("i-just-made-it-up"), system.deadLetters) // or touch the receptionist!
}
@@ -266,7 +266,7 @@ class ExtensionsSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with
}
def withEmptyActorSystem[T](name: String, config: Option[Config] = None, setup: Option[ActorSystemSetup] = None)(
- f: ActorSystem[_] => T): T = {
+ f: ActorSystem[?] => T): T = {
val bootstrap = config match {
case Some(c) => BootstrapSetup(c)
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LocalActorRefProviderLogMessagesSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LocalActorRefProviderLogMessagesSpec.scala
index dd8b9dc05c..2086e89634 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LocalActorRefProviderLogMessagesSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LocalActorRefProviderLogMessagesSpec.scala
@@ -38,7 +38,7 @@ class LocalActorRefProviderLogMessagesSpec
"An LocalActorRefProvider" must {
"logs on dedicated 'serialization' logger of unknown path" in {
- val provider = system.asInstanceOf[ActorSystemAdapter[_]].provider
+ val provider = system.asInstanceOf[ActorSystemAdapter[?]].provider
LoggingTestKit
.debug("of unknown (invalid) path [dummy/path]")
@@ -49,7 +49,7 @@ class LocalActorRefProviderLogMessagesSpec
}
"logs on dedicated 'serialization' logger when path doesn't match existing actor" in {
- val provider = system.asInstanceOf[ActorSystemAdapter[_]].provider
+ val provider = system.asInstanceOf[ActorSystemAdapter[?]].provider
val invalidPath = provider.rootPath / "user" / "invalid"
LoggingTestKit
@@ -62,10 +62,10 @@ class LocalActorRefProviderLogMessagesSpec
"logs on dedicated 'serialization' logger when of foreign path" in {
- val otherSystem = ActorTestKit("otherSystem").system.asInstanceOf[ActorSystemAdapter[_]]
+ val otherSystem = ActorTestKit("otherSystem").system.asInstanceOf[ActorSystemAdapter[?]]
val invalidPath = otherSystem.provider.rootPath / "user" / "foo"
- val provider = system.asInstanceOf[ActorSystemAdapter[_]].provider
+ val provider = system.asInstanceOf[ActorSystemAdapter[?]].provider
try {
LoggingTestKit
.debug("Resolve (deserialization) of foreign path [pekko://otherSystem/user/foo]")
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MailboxSelectorSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MailboxSelectorSpec.scala
index e90eab5909..93fa97fdd6 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MailboxSelectorSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MailboxSelectorSpec.scala
@@ -44,7 +44,7 @@ class MailboxSelectorSpec extends ScalaTestWithActorTestKit("""
Behaviors.receiveMessage[WhatsYourMailbox] {
case WhatsYourMailbox(replyTo) =>
val mailbox = context match {
- case adapter: ActorContextAdapter[_] =>
+ case adapter: ActorContextAdapter[?] =>
adapter.classicContext match {
case cell: ActorCell =>
cell.mailbox.messageQueue
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SupervisionSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SupervisionSpec.scala
index 9950127d5c..cf8586899f 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SupervisionSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SupervisionSpec.scala
@@ -49,8 +49,8 @@ object SupervisionSpec {
case object IncrementState extends Command
case object GetState extends Command
final case class CreateChild[T](behavior: Behavior[T], name: String) extends Command
- final case class Watch(ref: ActorRef[_]) extends Command
- final case class WatchWith(ref: ActorRef[_], cmd: Command) extends Command
+ final case class Watch(ref: ActorRef[?]) extends Command
+ final case class WatchWith(ref: ActorRef[?], cmd: Command) extends Command
sealed trait Event
final case class Pong(n: Int) extends Event
@@ -459,7 +459,8 @@ class SupervisionSpec extends ScalaTestWithActorTestKit("""
.onFailure[Exception](SupervisorStrategy.restart)
}(ReceivedSignal(PostStop))
- "support nesting exceptions with outer restart and inner backoff strategies" in throwIOExceptionThenIllegalArgumentException {
+ "support nesting exceptions with outer restart and inner backoff strategies" in
+ throwIOExceptionThenIllegalArgumentException {
probeRef =>
supervise(
supervise(targetBehavior(probeRef))
@@ -467,14 +468,16 @@ class SupervisionSpec extends ScalaTestWithActorTestKit("""
.onFailure[IOException](SupervisorStrategy.restart)
}()
- "support flattening exceptions with outer restart and inner backoff strategies" in throwIOExceptionThenIllegalArgumentException {
+ "support flattening exceptions with outer restart and inner backoff strategies" in
+ throwIOExceptionThenIllegalArgumentException {
probeRef =>
supervise(targetBehavior(probeRef))
.onFailure[IllegalArgumentException](SupervisorStrategy.restartWithBackoff(10.millis, 10.millis, 0.0))
.onFailure[IOException](SupervisorStrategy.restart)
}()
- "support nesting exceptions with inner restart and outer backoff strategies" in throwIOExceptionThenIllegalArgumentException {
+ "support nesting exceptions with inner restart and outer backoff strategies" in
+ throwIOExceptionThenIllegalArgumentException {
probeRef =>
supervise(
supervise(targetBehavior(probeRef))
@@ -482,7 +485,8 @@ class SupervisionSpec extends ScalaTestWithActorTestKit("""
.onFailure[IOException](SupervisorStrategy.restartWithBackoff(10.millis, 10.millis, 0.0))
}()
- "support flattening exceptions with inner restart and outer backoff strategies" in throwIOExceptionThenIllegalArgumentException {
+ "support flattening exceptions with inner restart and outer backoff strategies" in
+ throwIOExceptionThenIllegalArgumentException {
probeRef =>
supervise(targetBehavior(probeRef))
.onFailure[IllegalArgumentException](SupervisorStrategy.restart)
@@ -1133,7 +1137,8 @@ class SupervisionSpec extends ScalaTestWithActorTestKit("""
}
}
- "fail instead of restart with exponential backoff when deferred factory throws unhandled" in new FailingUnhandledTestSetup(
+ "fail instead of restart with exponential backoff when deferred factory throws unhandled" in
+ new FailingUnhandledTestSetup(
strategy = SupervisorStrategy.restartWithBackoff(minBackoff = 100.millis.dilated, maxBackoff = 1.second, 0)) {
LoggingTestKit.error[ActorInitializationException].expect {
@@ -1431,7 +1436,7 @@ class SupervisionSpec extends ScalaTestWithActorTestKit("""
LoggingTestKit.error[DeathPactException].expect {
actor ! "boom"
- val child = probe.expectMessageType[ActorRef[_]]
+ val child = probe.expectMessageType[ActorRef[?]]
probe.expectTerminated(child, 3.seconds)
}
actor ! "ping"
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerControllerSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerControllerSpec.scala
index e2da511cfd..e8cf383e46 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerControllerSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerControllerSpec.scala
@@ -97,7 +97,7 @@ class DurableProducerControllerSpec
val durable = TestDurableProducerQueue[TestConsumer.Job](
Duration.Zero,
stateHolder,
- (_: DurableProducerQueue.Command[_]) => false)
+ (_: DurableProducerQueue.Command[?]) => false)
val producerController =
spawn(ProducerController[TestConsumer.Job](producerId, Some(durable)), s"producerController-$idCount")
@@ -182,7 +182,7 @@ class DurableProducerControllerSpec
TestDurableProducerQueue[TestConsumer.Job](
Duration.Zero,
stateHolder,
- (_: DurableProducerQueue.Command[_]) => false)
+ (_: DurableProducerQueue.Command[?]) => false)
val producerController =
spawn(
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableWorkPullingSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableWorkPullingSpec.scala
index 617e27c9f1..db3b1ac405 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableWorkPullingSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableWorkPullingSpec.scala
@@ -167,7 +167,7 @@ class DurableWorkPullingSpec
val durable = TestDurableProducerQueue[TestConsumer.Job](
Duration.Zero,
stateHolder,
- (_: DurableProducerQueue.Command[_]) => false)
+ (_: DurableProducerQueue.Command[?]) => false)
val workPullingController =
spawn(
@@ -289,7 +289,7 @@ class DurableWorkPullingSpec
val durable = TestDurableProducerQueue[TestConsumer.Job](
Duration.Zero,
stateHolder,
- (_: DurableProducerQueue.Command[_]) => false)
+ (_: DurableProducerQueue.Command[?]) => false)
val workPullingController =
spawn(
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryRandomSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryRandomSpec.scala
index 99ec8e49c9..c50357cc76 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryRandomSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryRandomSpec.scala
@@ -105,7 +105,7 @@ class ReliableDeliveryRandomSpec(config: Config)
// RandomFlakyNetwork to simulate lost messages from producerController to consumerController
val consumerDrop: Any => Double = {
- case _: ConsumerController.SequencedMessage[_] => consumerDropProbability
+ case _: ConsumerController.SequencedMessage[?] => consumerDropProbability
case _ => 0.0
}
@@ -123,7 +123,7 @@ class ReliableDeliveryRandomSpec(config: Config)
val producerDrop: Any => Double = {
case _: ProducerControllerImpl.Request => producerDropProbability
case _: ProducerControllerImpl.Resend => producerDropProbability
- case _: ProducerController.RegisterConsumer[_] => producerDropProbability
+ case _: ProducerController.RegisterConsumer[?] => producerDropProbability
case _ => 0.0
}
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorSystemSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorSystemSpec.scala
index 38a181640d..3649f5b36d 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorSystemSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorSystemSpec.scala
@@ -191,8 +191,9 @@ class ActorSystemSpec
"guardian-mailbox",
Behaviors.receive[WhatsYourMailbox] {
case (context, WhatsYourMailbox(replyTo)) =>
- replyTo ! context
- .asInstanceOf[ActorContextImpl[_]]
+ replyTo !
+ context
+ .asInstanceOf[ActorContextImpl[?]]
.classicActorContext
.asInstanceOf[Dispatch]
.mailbox
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionistSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionistSpec.scala
index 57b531b07f..a0c66951ba 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionistSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionistSpec.scala
@@ -208,7 +208,7 @@ class LocalReceptionistSpec extends ScalaTestWithActorTestKit with AnyWordSpecLi
class LocalReceptionistBehaviorSpec extends AnyWordSpec with Matchers with LogCapturing {
import LocalReceptionistSpec._
- def assertEmpty(inboxes: TestInbox[_]*): Unit = {
+ def assertEmpty(inboxes: TestInbox[?]*): Unit = {
inboxes.foreach(i => withClue(s"inbox $i had messages")(i.hasMessages should be(false)))
}
diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MailboxSelectorSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MailboxSelectorSpec.scala
index 0f9b6a42c7..5699459454 100644
--- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MailboxSelectorSpec.scala
+++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MailboxSelectorSpec.scala
@@ -73,9 +73,9 @@ class MailboxSelectorSpec(config: Config)
case class WhatsYourMailbox(replyTo: ActorRef[MessageQueue]) extends Command
case class WhatsYourDispatcher(replyTo: ActorRef[String]) extends Command
- private def extract[R](context: ActorContext[_], f: ActorCell => R): R = {
+ private def extract[R](context: ActorContext[?], f: ActorCell => R): R = {
context match {
- case adapter: ActorContextAdapter[_] =>
+ case adapter: ActorContextAdapter[?] =>
adapter.classicActorContext match {
case cell: ActorCell => f(cell)
case unexpected => throw new RuntimeException(s"Unexpected: $unexpected")
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorRef.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorRef.scala
index b25f056018..3d369223b9 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorRef.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorRef.scala
@@ -32,7 +32,7 @@ import pekko.annotation.DoNotInherit
* Not for user extension
*/
@DoNotInherit
-trait ActorRef[-T] extends RecipientRef[T] with java.lang.Comparable[ActorRef[_]] with java.io.Serializable {
+trait ActorRef[-T] extends RecipientRef[T] with java.lang.Comparable[ActorRef[?]] with java.io.Serializable {
this: InternalRecipientRef[T] =>
/**
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorRefResolver.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorRefResolver.scala
index aa9769d343..ffa931d938 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorRefResolver.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorRefResolver.scala
@@ -18,9 +18,9 @@ import pekko.actor.{ ActorRefWithCell, ExtendedActorSystem }
import pekko.annotation.{ DoNotInherit, InternalApi }
object ActorRefResolver extends ExtensionId[ActorRefResolver] {
- def get(system: ActorSystem[_]): ActorRefResolver = apply(system)
+ def get(system: ActorSystem[?]): ActorRefResolver = apply(system)
- override def createExtension(system: ActorSystem[_]): ActorRefResolver =
+ override def createExtension(system: ActorSystem[?]): ActorRefResolver =
new ActorRefResolverImpl(system)
}
@@ -53,7 +53,7 @@ abstract class ActorRefResolver extends Extension {
/**
* INTERNAL API
*/
-@InternalApi private[pekko] class ActorRefResolverImpl(system: ActorSystem[_]) extends ActorRefResolver {
+@InternalApi private[pekko] class ActorRefResolverImpl(system: ActorSystem[?]) extends ActorRefResolver {
import pekko.actor.typed.scaladsl.adapter._
private val classicSystem = system.toClassic.asInstanceOf[ExtendedActorSystem]
@@ -93,7 +93,7 @@ abstract class ActorRefResolver extends Extension {
}
object ActorRefResolverSetup {
- def apply[T <: Extension](createExtension: ActorSystem[_] => ActorRefResolver): ActorRefResolverSetup =
+ def apply[T <: Extension](createExtension: ActorSystem[?] => ActorRefResolver): ActorRefResolverSetup =
new ActorRefResolverSetup(sys => createExtension(sys))
}
@@ -103,5 +103,5 @@ object ActorRefResolverSetup {
* to replace the default implementation of the [[ActorRefResolver]] extension. Intended
* for tests that need to replace extension with stub/mock implementations.
*/
-final class ActorRefResolverSetup(createExtension: java.util.function.Function[ActorSystem[_], ActorRefResolver])
+final class ActorRefResolverSetup(createExtension: java.util.function.Function[ActorSystem[?], ActorRefResolver])
extends ExtensionSetup[ActorRefResolver](ActorRefResolver, createExtension)
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/BehaviorInterceptor.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/BehaviorInterceptor.scala
index b25a24a50a..421b2a11fe 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/BehaviorInterceptor.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/BehaviorInterceptor.scala
@@ -102,7 +102,7 @@ object BehaviorInterceptor {
*/
@DoNotInherit
trait PreStartTarget[T] {
- def start(ctx: TypedActorContext[_]): Behavior[T]
+ def start(ctx: TypedActorContext[?]): Behavior[T]
}
/**
@@ -112,7 +112,7 @@ object BehaviorInterceptor {
*/
@DoNotInherit
trait ReceiveTarget[T] {
- def apply(ctx: TypedActorContext[_], msg: T): Behavior[T]
+ def apply(ctx: TypedActorContext[?], msg: T): Behavior[T]
/**
* INTERNAL API
@@ -123,7 +123,7 @@ object BehaviorInterceptor {
* is taking place.
*/
@InternalApi
- private[pekko] def signalRestart(ctx: TypedActorContext[_]): Unit
+ private[pekko] def signalRestart(ctx: TypedActorContext[?]): Unit
}
/**
@@ -133,7 +133,7 @@ object BehaviorInterceptor {
*/
@DoNotInherit
trait SignalTarget[T] {
- def apply(ctx: TypedActorContext[_], signal: Signal): Behavior[T]
+ def apply(ctx: TypedActorContext[?], signal: Signal): Behavior[T]
}
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/Extensions.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/Extensions.scala
index e1cfa9e880..92a6c112e9 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/Extensions.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/Extensions.scala
@@ -120,12 +120,12 @@ abstract class ExtensionId[T <: Extension] {
/**
* Create the extension, will be invoked at most one time per actor system where the extension is registered.
*/
- def createExtension(system: ActorSystem[_]): T
+ def createExtension(system: ActorSystem[?]): T
/**
* Lookup or create an instance of the extension identified by this id.
*/
- final def apply(system: ActorSystem[_]): T = system.registerExtension(this)
+ final def apply(system: ActorSystem[?]): T = system.registerExtension(this)
override final def hashCode: Int = System.identityHashCode(this)
override final def equals(other: Any): Boolean = this eq other.asInstanceOf[AnyRef]
@@ -163,7 +163,7 @@ trait Extensions {
* Returns whether the specified extension is already registered, this method can potentially block, waiting for the initialization
* of the payload, if is in the process of registration from another Thread of execution
*/
- def hasExtension(ext: ExtensionId[_ <: Extension]): Boolean
+ def hasExtension(ext: ExtensionId[? <: Extension]): Boolean
}
/**
@@ -174,7 +174,7 @@ trait Extensions {
*/
abstract class ExtensionSetup[T <: Extension](
val extId: ExtensionId[T],
- val createExtension: java.util.function.Function[ActorSystem[_], T])
+ val createExtension: java.util.function.Function[ActorSystem[?], T])
extends Setup
/**
@@ -183,5 +183,5 @@ abstract class ExtensionSetup[T <: Extension](
* implementation of the extension. Intended for tests that need to replace
* extension with stub/mock implementations.
*/
-abstract class AbstractExtensionSetup[T <: Extension](extId: ExtensionId[T], createExtension: ActorSystem[_] => T)
+abstract class AbstractExtensionSetup[T <: Extension](extId: ExtensionId[T], createExtension: ActorSystem[?] => T)
extends ExtensionSetup[T](extId, createExtension.apply)
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ConsumerController.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ConsumerController.scala
index 3ff6e20801..e09feab683 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ConsumerController.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ConsumerController.scala
@@ -204,7 +204,7 @@ object ConsumerController {
* Scala API: Factory method from config `pekko.reliable-delivery.consumer-controller`
* of the `ActorSystem`.
*/
- def apply(system: ActorSystem[_]): Settings =
+ def apply(system: ActorSystem[?]): Settings =
apply(system.settings.config.getConfig("pekko.reliable-delivery.consumer-controller"))
/**
@@ -223,7 +223,7 @@ object ConsumerController {
* Java API: Factory method from config `pekko.reliable-delivery.producer-controller`
* of the `ActorSystem`.
*/
- def create(system: ActorSystem[_]): Settings =
+ def create(system: ActorSystem[?]): Settings =
apply(system)
/**
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/DurableProducerQueue.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/DurableProducerQueue.scala
index cd69940cd8..82665b917f 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/DurableProducerQueue.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/DurableProducerQueue.scala
@@ -173,9 +173,11 @@ object DurableProducerQueue {
override def equals(obj: Any): Boolean = {
obj match {
- case other: MessageSent[_] =>
- seqNr == other.seqNr && message == other.message && ack == other.ack && confirmationQualifier == other
- .confirmationQualifier && timestampMillis == other.timestampMillis
+ case other: MessageSent[?] =>
+ seqNr == other.seqNr && message == other.message && ack == other.ack &&
+ confirmationQualifier ==
+ other
+ .confirmationQualifier && timestampMillis == other.timestampMillis
case _ => false
}
}
@@ -225,7 +227,7 @@ object DurableProducerQueue {
new MessageSent(seqNr, message, ack, confirmationQualifier, timestampMillis)
def unapply(
- sent: MessageSent[_]): Option[(SeqNr, MessageOrChunk, Boolean, ConfirmationQualifier, TimestampMillis)] =
+ sent: MessageSent[?]): Option[(SeqNr, MessageOrChunk, Boolean, ConfirmationQualifier, TimestampMillis)] =
Some((sent.seqNr, sent.message, sent.ack, sent.confirmationQualifier, sent.timestampMillis))
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ProducerController.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ProducerController.scala
index 65e525d0a1..205b190089 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ProducerController.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ProducerController.scala
@@ -157,7 +157,7 @@ object ProducerController {
* Scala API: Factory method from config `pekko.reliable-delivery.producer-controller`
* of the `ActorSystem`.
*/
- def apply(system: ActorSystem[_]): Settings =
+ def apply(system: ActorSystem[?]): Settings =
apply(system.settings.config.getConfig("pekko.reliable-delivery.producer-controller"))
/**
@@ -181,7 +181,7 @@ object ProducerController {
* Java API: Factory method from config `pekko.reliable-delivery.producer-controller`
* of the `ActorSystem`.
*/
- def create(system: ActorSystem[_]): Settings =
+ def create(system: ActorSystem[?]): Settings =
apply(system)
/**
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/WorkPullingProducerController.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/WorkPullingProducerController.scala
index bbe094f3c2..f9c7db9c94 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/WorkPullingProducerController.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/WorkPullingProducerController.scala
@@ -154,7 +154,7 @@ object WorkPullingProducerController {
* Scala API: Factory method from config `pekko.reliable-delivery.work-pulling.producer-controller`
* of the `ActorSystem`.
*/
- def apply(system: ActorSystem[_]): Settings =
+ def apply(system: ActorSystem[?]): Settings =
apply(system.settings.config.getConfig("pekko.reliable-delivery.work-pulling.producer-controller"))
/**
@@ -172,7 +172,7 @@ object WorkPullingProducerController {
* Java API: Factory method from config `pekko.reliable-delivery.work-pulling.producer-controller`
* of the `ActorSystem`.
*/
- def create(system: ActorSystem[_]): Settings =
+ def create(system: ActorSystem[?]): Settings =
apply(system)
/**
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ConsumerControllerImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ConsumerControllerImpl.scala
index 613b403173..a20c7c4bf0 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ConsumerControllerImpl.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ConsumerControllerImpl.scala
@@ -89,7 +89,7 @@ import pekko.util.ConstantFun.scalaIdentityFunction
private case object Retry extends InternalCommand
- private final case class ConsumerTerminated(consumer: ActorRef[_]) extends InternalCommand
+ private final case class ConsumerTerminated(consumer: ActorRef[?]) extends InternalCommand
private final case class State[A](
producerController: ActorRef[ProducerControllerImpl.InternalCommand],
@@ -170,7 +170,7 @@ import pekko.util.ConstantFun.scalaIdentityFunction
}
Behaviors.same
- case _: DeliverThenStop[_] =>
+ case _: DeliverThenStop[?] =>
if (stashBuffer.isEmpty) {
Behaviors.stopped
} else {
@@ -203,7 +203,7 @@ import pekko.util.ConstantFun.scalaIdentityFunction
private def mdcForMessage(msg: InternalCommand): Map[String, String] = {
msg match {
- case seqMsg: SequencedMessage[_] => Map("producerId" -> seqMsg.producerId)
+ case seqMsg: SequencedMessage[?] => Map("producerId" -> seqMsg.producerId)
case _ => Map.empty
}
}
@@ -225,7 +225,7 @@ import pekko.util.ConstantFun.scalaIdentityFunction
stopping)
}
- def enforceLocalConsumer(ref: ActorRef[_]): Unit = {
+ def enforceLocalConsumer(ref: ActorRef[?]): Unit = {
if (ref.path.address.hasGlobalScope)
throw new IllegalArgumentException(s"Consumer [$ref] should be local.")
}
@@ -359,7 +359,7 @@ private class ConsumerControllerImpl[A] private (
case reg: RegisterToProducerController[A @unchecked] =>
receiveRegisterToProducerController(s, reg, newState => active(newState))
- case _: DeliverThenStop[_] =>
+ case _: DeliverThenStop[?] =>
receiveDeliverThenStop(s, newState => active(newState))
case _: UnsealedInternalCommand =>
@@ -484,7 +484,7 @@ private class ConsumerControllerImpl[A] private (
case reg: RegisterToProducerController[A @unchecked] =>
receiveRegisterToProducerController(s, reg, newState => active(newState))
- case _: DeliverThenStop[_] =>
+ case _: DeliverThenStop[?] =>
receiveDeliverThenStop(s, newState => resending(newState))
case _: UnsealedInternalCommand =>
@@ -604,7 +604,7 @@ private class ConsumerControllerImpl[A] private (
scalaIdentityFunction)
}
- case msg: SequencedMessage[_] =>
+ case msg: SequencedMessage[?] =>
flightRecorder.consumerReceivedPreviousInProgress(msg.producerId, msg.seqNr, stashBuffer.size + 1)
val expectedSeqNr = seqMsg.seqNr + stashBuffer.size + 1
if (msg.seqNr < expectedSeqNr && msg.producerController == seqMsg.producerController) {
@@ -642,7 +642,7 @@ private class ConsumerControllerImpl[A] private (
case reg: RegisterToProducerController[A @unchecked] =>
receiveRegisterToProducerController(s, reg, newState => waitingForConfirmation(newState, seqMsg))
- case _: DeliverThenStop[_] =>
+ case _: DeliverThenStop[?] =>
receiveDeliverThenStop(s, newState => waitingForConfirmation(newState, seqMsg))
case _: UnsealedInternalCommand =>
@@ -708,7 +708,7 @@ private class ConsumerControllerImpl[A] private (
}
}
- private def receiveConsumerTerminated(c: ActorRef[_]): Behavior[InternalCommand] = {
+ private def receiveConsumerTerminated(c: ActorRef[?]): Behavior[InternalCommand] = {
context.log.debug("Consumer [{}] terminated.", c)
Behaviors.stopped
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala
index b733c4d765..46860168b7 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala
@@ -344,7 +344,7 @@ object ProducerControllerImpl {
}
}
- def enforceLocalProducer(ref: ActorRef[_]): Unit = {
+ def enforceLocalProducer(ref: ActorRef[?]): Unit = {
if (ref.path.address.hasGlobalScope)
throw new IllegalArgumentException(s"Consumer [$ref] should be local.")
}
@@ -713,7 +713,8 @@ private class ProducerControllerImpl[A: ClassTag](
}
def receiveSendChunk(): Behavior[InternalCommand] = {
- if (s.remainingChunks.nonEmpty && s.remainingChunks.head.seqNr <= s.requestedSeqNr && s
+ if (s.remainingChunks.nonEmpty && s.remainingChunks.head.seqNr <= s.requestedSeqNr &&
+ s
.storeMessageSentInProgress == 0) {
if (traceEnabled)
context.log.trace("Send next chunk seqNr [{}].", s.remainingChunks.head.seqNr)
@@ -806,7 +807,7 @@ private class ProducerControllerImpl[A: ClassTag](
active(s.copy(remainingChunks = chunks, storeMessageSentInProgress = seqMsg.seqNr))
}
- case StoreMessageSentCompleted(sent: MessageSent[_]) =>
+ case StoreMessageSentCompleted(sent: MessageSent[?]) =>
receiveStoreMessageSentCompleted(sent.seqNr)
case f: StoreMessageSentFailed[A @unchecked] =>
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/eventstream/EventStream.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/eventstream/EventStream.scala
index 9b39cfd1b9..a37d2120ad 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/eventstream/EventStream.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/eventstream/EventStream.scala
@@ -63,7 +63,7 @@ object EventStream {
/**
* INTERNAL API
*/
- @InternalApi private[pekko] def topic: Class[_] = classTag.runtimeClass
+ @InternalApi private[pekko] def topic: Class[?] = classTag.runtimeClass
}
/**
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorContextImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorContextImpl.scala
index f16c1e7f47..54a763df8e 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorContextImpl.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorContextImpl.scala
@@ -46,7 +46,7 @@ import scala.util.Success
// single context for logging as there are a few things that are initialized
// together that we can cache as long as the actor is alive
object LoggingContext {
- def apply(logger: Logger, tags: Set[String], ctx: ActorContextImpl[_]): LoggingContext = {
+ def apply(logger: Logger, tags: Set[String], ctx: ActorContextImpl[?]): LoggingContext = {
val tagsString =
// "" means no tags
if (tags.isEmpty) ""
@@ -59,7 +59,7 @@ import scala.util.Success
val pekkoAddress =
ctx.system match {
- case adapter: ActorSystemAdapter[_] => adapter.provider.addressString
+ case adapter: ActorSystemAdapter[?] => adapter.provider.addressString
case _ => Address("pekko", ctx.system.name).toString
}
@@ -103,7 +103,7 @@ import scala.util.Success
private var _logging: OptionVal[LoggingContext] = OptionVal.None
private var messageAdapterRef: OptionVal[ActorRef[Any]] = OptionVal.None
- private var _messageAdapters: List[(Class[_], Any => T)] = Nil
+ private var _messageAdapters: List[(Class[?], Any => T)] = Nil
private var _timer: OptionVal[TimerSchedulerCrossDslSupport[T]] = OptionVal.None
// _currentActorThread is on purpose not volatile. Used from `checkCurrentActorThread`.
@@ -162,7 +162,7 @@ import scala.util.Success
_logging match {
case OptionVal.Some(l) => l
case _ =>
- val logClass = LoggerClass.detectLoggerClassFromStack(classOf[Behavior[_]])
+ val logClass = LoggerClass.detectLoggerClassFromStack(classOf[Behavior[?]])
val logger = LoggerFactory.getLogger(logClass.getName)
val l = LoggingContext(logger, classicActorContext.props.deploy.tags, this)
_logging = OptionVal.Some(l)
@@ -184,7 +184,7 @@ import scala.util.Success
_logging = OptionVal.Some(loggingContext().withLogger(LoggerFactory.getLogger(name)))
}
- override def setLoggerName(clazz: Class[_]): Unit =
+ override def setLoggerName(clazz: Class[?]): Unit =
setLoggerName(clazz.getName)
def hasCustomLoggerName: Boolean = loggingContext().hasCustomName
@@ -236,7 +236,7 @@ import scala.util.Success
ask(target, createRequest) {
case Success(StatusReply.Success(t: Res)) => mapResponse(Success(t))
case Success(StatusReply.Error(why)) => mapResponse(Failure(why))
- case fail: Failure[_] => mapResponse(fail.asInstanceOf[Failure[Res]])
+ case fail: Failure[?] => mapResponse(fail.asInstanceOf[Failure[Res]])
case _ => throw new RuntimeException() // won't happen, compiler exhaustiveness check pleaser
}
@@ -333,7 +333,7 @@ import scala.util.Success
/**
* INTERNAL API
*/
- @InternalApi private[pekko] def messageAdapters: List[(Class[_], Any => T)] = _messageAdapters
+ @InternalApi private[pekko] def messageAdapters: List[(Class[?], Any => T)] = _messageAdapters
/**
* INTERNAL API
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorFlightRecorder.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorFlightRecorder.scala
index 163650e3bf..5b093a9653 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorFlightRecorder.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorFlightRecorder.scala
@@ -25,7 +25,7 @@ import pekko.util.FlightRecorderLoader
@InternalApi
object ActorFlightRecorder extends ExtensionId[ActorFlightRecorder] {
- override def createExtension(system: ActorSystem[_]): ActorFlightRecorder =
+ override def createExtension(system: ActorSystem[?]): ActorFlightRecorder =
FlightRecorderLoader.load[ActorFlightRecorder](
system,
"org.apache.pekko.actor.typed.internal.jfr.JFRActorFlightRecorder",
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorRefImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorRefImpl.scala
index 33dd5ae1de..89a3772c77 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorRefImpl.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorRefImpl.scala
@@ -33,7 +33,7 @@ private[pekko] trait ActorRefImpl[-T] extends ActorRef[T] { this: InternalRecipi
/**
* Comparison takes path and the unique id of the actor cell into account.
*/
- final override def compareTo(other: ActorRef[_]) = {
+ final override def compareTo(other: ActorRef[?]) = {
val x = this.path.compareTo(other.path)
if (x == 0) if (this.path.uid < other.path.uid) -1 else if (this.path.uid == other.path.uid) 0 else 1
else x
@@ -45,7 +45,7 @@ private[pekko] trait ActorRefImpl[-T] extends ActorRef[T] { this: InternalRecipi
* Equals takes path and the unique id of the actor cell into account.
*/
final override def equals(that: Any): Boolean = that match {
- case other: ActorRef[_] => path.uid == other.path.uid && path == other.path
+ case other: ActorRef[?] => path.uid == other.path.uid && path == other.path
case _ => false
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/EventStreamExtension.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/EventStreamExtension.scala
index 059f857663..899b951465 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/EventStreamExtension.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/EventStreamExtension.scala
@@ -27,11 +27,11 @@ import pekko.annotation.InternalApi
*
* It is used as an extension to ensure a single instance per actor system.
*/
-@InternalApi private[pekko] final class EventStreamExtension(actorSystem: ActorSystem[_]) extends Extension {
+@InternalApi private[pekko] final class EventStreamExtension(actorSystem: ActorSystem[?]) extends Extension {
val ref: ActorRef[EventStream.Command] =
actorSystem.internalSystemActorOf(EventStreamAdapter.behavior, "eventstream", Props.empty)
}
private[pekko] object EventStreamExtension extends ExtensionId[EventStreamExtension] {
- override def createExtension(system: ActorSystem[_]): EventStreamExtension = new EventStreamExtension(system)
+ override def createExtension(system: ActorSystem[?]): EventStreamExtension = new EventStreamExtension(system)
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ExtensionsImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ExtensionsImpl.scala
index 5df8cf615a..5f886df5ba 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ExtensionsImpl.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ExtensionsImpl.scala
@@ -30,9 +30,9 @@ import pekko.util.ccompat.JavaConverters._
* Actor system extensions registry
*/
@InternalApi
-private[pekko] trait ExtensionsImpl extends Extensions { self: ActorSystem[_] with InternalRecipientRef[_] =>
+private[pekko] trait ExtensionsImpl extends Extensions { self: ActorSystem[?] with InternalRecipientRef[?] =>
- private val extensions = new ConcurrentHashMap[ExtensionId[_], AnyRef]
+ private val extensions = new ConcurrentHashMap[ExtensionId[?], AnyRef]
/**
* Hook for ActorSystem to load extensions on startup
@@ -54,7 +54,7 @@ private[pekko] trait ExtensionsImpl extends Extensions { self: ActorSystem[_] wi
}
idTry match {
- case Success(id: ExtensionId[_]) => registerExtension(id)
+ case Success(id: ExtensionId[?]) => registerExtension(id)
case Success(_) =>
if (!throwOnLoadFail) log.error("[{}] is not an 'ExtensionId', skipping...", extensionIdFQCN)
else throw new RuntimeException(s"[$extensionIdFQCN] is not an 'ExtensionId'")
@@ -68,14 +68,14 @@ private[pekko] trait ExtensionsImpl extends Extensions { self: ActorSystem[_] wi
private def idFromJavaSingletonAccessor(extensionIdFQCN: String): Try[ExtensionId[Extension]] =
dynamicAccess.getClassFor[ExtensionId[Extension]](extensionIdFQCN).flatMap[ExtensionId[Extension]] {
- (clazz: Class[_]) =>
+ (clazz: Class[?]) =>
Try {
val singletonAccessor = clazz.getDeclaredMethod("getInstance")
singletonAccessor.invoke(null).asInstanceOf[ExtensionId[Extension]]
}
}
- final override def hasExtension(ext: ExtensionId[_ <: Extension]): Boolean = findExtension(ext) != null
+ final override def hasExtension(ext: ExtensionId[? <: Extension]): Boolean = findExtension(ext) != null
final override def extension[T <: Extension](ext: ExtensionId[T]): T = findExtension(ext) match {
case null => throw new IllegalArgumentException(s"Trying to get non-registered extension [$ext]")
@@ -96,7 +96,7 @@ private[pekko] trait ExtensionsImpl extends Extensions { self: ActorSystem[_] wi
// Create and initialize the extension, first look for ExtensionSetup
val instance = self.settings.setup.setups
.collectFirst {
- case (_, extSetup: ExtensionSetup[_]) if extSetup.extId == ext => extSetup.createExtension(self)
+ case (_, extSetup: ExtensionSetup[?]) if extSetup.extId == ext => extSetup.createExtension(self)
}
.getOrElse(ext.createExtension(self))
instance match {
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala
index 0763b22487..b6b6ff25b3 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala
@@ -56,24 +56,24 @@ private[pekko] final class InterceptorImpl[O, I](
import BehaviorInterceptor._
private val preStartTarget: PreStartTarget[I] = new PreStartTarget[I] {
- override def start(ctx: TypedActorContext[_]): Behavior[I] = {
+ override def start(ctx: TypedActorContext[?]): Behavior[I] = {
Behavior.start[I](nestedBehavior, ctx.asInstanceOf[TypedActorContext[I]])
}
override def toString: String = s"PreStartTarget($nestedBehavior)"
}
private val receiveTarget: ReceiveTarget[I] = new ReceiveTarget[I] {
- override def apply(ctx: TypedActorContext[_], msg: I): Behavior[I] =
+ override def apply(ctx: TypedActorContext[?], msg: I): Behavior[I] =
Behavior.interpretMessage(nestedBehavior, ctx.asInstanceOf[TypedActorContext[I]], msg)
- override def signalRestart(ctx: TypedActorContext[_]): Unit =
+ override def signalRestart(ctx: TypedActorContext[?]): Unit =
Behavior.interpretSignal(nestedBehavior, ctx.asInstanceOf[TypedActorContext[I]], PreRestart)
override def toString: String = s"ReceiveTarget($nestedBehavior)"
}
private val signalTarget = new SignalTarget[I] {
- override def apply(ctx: TypedActorContext[_], signal: Signal): Behavior[I] =
+ override def apply(ctx: TypedActorContext[?], signal: Signal): Behavior[I] =
Behavior.interpretSignal(nestedBehavior, ctx.asInstanceOf[TypedActorContext[I]], signal)
override def toString: String = s"SignalTarget($nestedBehavior)"
}
@@ -111,7 +111,7 @@ private[pekko] final class InterceptorImpl[O, I](
} else {
// returned behavior could be nested in setups, so we need to start before we deduplicate
val duplicateInterceptExists = Behavior.existsInStack(started) {
- case i: InterceptorImpl[_, _]
+ case i: InterceptorImpl[?, ?]
if interceptor.isSame(i.interceptor.asInstanceOf[BehaviorInterceptor[Any, Any]]) =>
true
case _ => false
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/LoggerClass.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/LoggerClass.scala
index b73d46b43f..02122e2a59 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/LoggerClass.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/LoggerClass.scala
@@ -27,7 +27,7 @@ private[pekko] object LoggerClass {
// just to get access to the class context
private final class TrickySecurityManager extends SecurityManager {
- def getClassStack: Array[Class[_]] = getClassContext
+ def getClassStack: Array[Class[?]] = getClassContext
}
private val defaultPrefixesToSkip = List("scala.runtime", "org.apache.pekko.actor.typed.internal")
@@ -35,7 +35,7 @@ private[pekko] object LoggerClass {
/**
* Try to extract a logger class from the call stack, if not possible the provided default is used
*/
- def detectLoggerClassFromStack(default: Class[_], additionalPrefixesToSkip: List[String] = Nil): Class[_] = {
+ def detectLoggerClassFromStack(default: Class[?], additionalPrefixesToSkip: List[String] = Nil): Class[?] = {
// TODO use stack walker API when we no longer need to support Java 8
try {
def skip(name: String): Boolean = {
@@ -50,7 +50,7 @@ private[pekko] object LoggerClass {
}
val trace = new TrickySecurityManager().getClassStack
- var suitableClass: OptionVal[Class[_]] = OptionVal.None
+ var suitableClass: OptionVal[Class[?]] = OptionVal.None
var idx = 1 // skip this method/class and right away
while (suitableClass.isEmpty && idx < trace.length) {
val clazz = trace(idx)
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/MiscMessageSerializer.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/MiscMessageSerializer.scala
index 45b9f1be22..5de797568f 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/MiscMessageSerializer.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/MiscMessageSerializer.scala
@@ -34,13 +34,13 @@ import pekko.serialization.{ BaseSerializer, SerializerWithStringManifest }
private val ActorRefManifest = "a"
def manifest(o: AnyRef): String = o match {
- case _: ActorRef[_] => ActorRefManifest
+ case _: ActorRef[?] => ActorRefManifest
case _ =>
throw new IllegalArgumentException(s"Can't serialize object of type ${o.getClass} in [${getClass.getName}]")
}
def toBinary(o: AnyRef): Array[Byte] = o match {
- case ref: ActorRef[_] => resolver.toSerializationFormat(ref).getBytes(StandardCharsets.UTF_8)
+ case ref: ActorRef[?] => resolver.toSerializationFormat(ref).getBytes(StandardCharsets.UTF_8)
case _ =>
throw new IllegalArgumentException(s"Cannot serialize object of type [${o.getClass.getName}]")
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/PoisonPill.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/PoisonPill.scala
index 66a74f76ad..76372e913e 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/PoisonPill.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/PoisonPill.scala
@@ -61,5 +61,5 @@ import pekko.annotation.InternalApi
override def isSame(other: BehaviorInterceptor[Any, Any]): Boolean =
// only one interceptor per behavior stack is needed
- other.isInstanceOf[PoisonPillInterceptor[_]]
+ other.isInstanceOf[PoisonPillInterceptor[?]]
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala
index bbc4366cb2..a18cea5b63 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala
@@ -43,8 +43,9 @@ import scala.util.Try
*/
@InternalApi private[pekko] object Supervisor {
def apply[T, Thr <: Throwable: ClassTag](initialBehavior: Behavior[T], strategy: SupervisorStrategy): Behavior[T] = {
- if (initialBehavior.isInstanceOf[scaladsl.AbstractBehavior[_]] || initialBehavior
- .isInstanceOf[javadsl.AbstractBehavior[_]]) {
+ if (initialBehavior.isInstanceOf[scaladsl.AbstractBehavior[?]] ||
+ initialBehavior
+ .isInstanceOf[javadsl.AbstractBehavior[?]]) {
throw new IllegalArgumentException(
"The supervised Behavior must not be a AbstractBehavior instance directly," +
"because a different instance should be created when it is restarted. Wrap in Behaviors.setup.")
@@ -77,7 +78,7 @@ private abstract class AbstractSupervisor[I, Thr <: Throwable](strategy: Supervi
override def isSame(other: BehaviorInterceptor[Any, Any]): Boolean = {
other match {
- case as: AbstractSupervisor[_, _] if throwableClass == as.throwableClass => true
+ case as: AbstractSupervisor[?, ?] if throwableClass == as.throwableClass => true
case _ => false
}
}
@@ -94,10 +95,10 @@ private abstract class AbstractSupervisor[I, Thr <: Throwable](strategy: Supervi
} catch handleSignalException(ctx, target)
}
- def log(ctx: TypedActorContext[_], t: Throwable): Unit =
+ def log(ctx: TypedActorContext[?], t: Throwable): Unit =
log(ctx, t, errorCount = -1)
- def log(ctx: TypedActorContext[_], t: Throwable, errorCount: Int): Unit = {
+ def log(ctx: TypedActorContext[?], t: Throwable, errorCount: Int): Unit = {
if (strategy.loggingEnabled) {
val unwrapped = UnstashException.unwrap(t)
val errorCountStr = if (errorCount >= 0) s" [$errorCount]" else ""
@@ -117,7 +118,7 @@ private abstract class AbstractSupervisor[I, Thr <: Throwable](strategy: Supervi
}
}
- def dropped(ctx: TypedActorContext[_], signalOrMessage: Any): Unit = {
+ def dropped(ctx: TypedActorContext[?], signalOrMessage: Any): Unit = {
import pekko.actor.typed.scaladsl.adapter._
ctx.asScala.system.toClassic.eventStream
.publish(Dropped(signalOrMessage, s"Stash is full in [${getClass.getSimpleName}]", ctx.asScala.self.toClassic))
@@ -195,10 +196,10 @@ private object RestartSupervisor {
}
}
- final case class ScheduledRestart(owner: RestartSupervisor[_, _ <: Throwable])
+ final case class ScheduledRestart(owner: RestartSupervisor[?, ? <: Throwable])
extends Signal
with DeadLetterSuppression
- final case class ResetRestartCount(current: Int, owner: RestartSupervisor[_, _ <: Throwable])
+ final case class ResetRestartCount(current: Int, owner: RestartSupervisor[?, ? <: Throwable])
extends Signal
with DeadLetterSuppression
}
@@ -418,7 +419,7 @@ private class RestartSupervisor[T, Thr <: Throwable: ClassTag](initial: Behavior
})
}
- private def stopChildren(ctx: TypedActorContext[_], children: Set[ActorRef[Nothing]]): Unit = {
+ private def stopChildren(ctx: TypedActorContext[?], children: Set[ActorRef[Nothing]]): Unit = {
children.foreach { child =>
// Unwatch in case the actor being restarted used watchWith to watch the child.
ctx.asScala.unwatch(child)
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/WithMdcBehaviorInterceptor.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/WithMdcBehaviorInterceptor.scala
index cf7b371e24..56d05a213c 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/WithMdcBehaviorInterceptor.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/WithMdcBehaviorInterceptor.scala
@@ -59,7 +59,7 @@ import pekko.annotation.InternalApi
// so we need to look through the stack and eliminate any MCD already existing
def loop(next: Behavior[T]): Behavior[T] = {
next match {
- case i: InterceptorImpl[_, T @unchecked]
+ case i: InterceptorImpl[?, T @unchecked]
if i.interceptor.isSame(this.asInstanceOf[BehaviorInterceptor[Any, Any]]) =>
// eliminate that interceptor
loop(i.nestedBehavior)
@@ -83,7 +83,7 @@ import pekko.annotation.InternalApi
// in the normal case, a new withMDC replaces the previous one
override def isSame(other: BehaviorInterceptor[Any, Any]): Boolean = other match {
- case _: WithMdcBehaviorInterceptor[_] => true
+ case _: WithMdcBehaviorInterceptor[?] => true
case _ => false
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorAdapter.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorAdapter.scala
index 3800116a76..67a1e30861 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorAdapter.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorAdapter.scala
@@ -180,7 +180,7 @@ import pekko.util.OptionVal
}
private def adaptAndHandle(msg: Any): Unit = {
- @tailrec def handle(adapters: List[(Class[_], Any => T)]): Unit = {
+ @tailrec def handle(adapters: List[(Class[?], Any => T)]): Unit = {
adapters match {
case Nil =>
// no adapter function registered for message class
@@ -240,7 +240,7 @@ import pekko.util.OptionVal
case _ =>
val isTypedActor = sender() match {
case afwc: ActorRefWithCell =>
- afwc.underlying.props.producer.actorClass == classOf[ActorAdapter[_]]
+ afwc.underlying.props.producer.actorClass == classOf[ActorAdapter[?]]
case _ =>
false
}
@@ -326,7 +326,7 @@ import pekko.util.OptionVal
try {
ctx.cancelAllTimers()
behavior match {
- case _: DeferredBehavior[_] =>
+ case _: DeferredBehavior[?] =>
// Do not undefer a DeferredBehavior as that may cause creation side-effects, which we do not want on termination.
case b => Behavior.interpretSignal(b, ctx, PostStop)
}
@@ -352,7 +352,7 @@ import pekko.util.OptionVal
// first pass the signal to the previous behavior, so that it and potential interceptors
// will get the PostStop signal, unless it is deferred, we don't start a behavior while stopping
lastBehavior match {
- case _: DeferredBehavior[_] => // no starting of behaviors on actor stop
+ case _: DeferredBehavior[?] => // no starting of behaviors on actor stop
case nonDeferred => Behavior.interpretSignal(nonDeferred, ctx, PostStop)
}
// and then to the potential stop hook, which can have a call back or not
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorContextAdapter.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorContextAdapter.scala
index bb438c7bb3..4d537baf1c 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorContextAdapter.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorContextAdapter.scala
@@ -25,19 +25,19 @@ import pekko.annotation.InternalApi
@InternalApi
private[pekko] object ActorContextAdapter {
- private def toClassicImp[U](context: TypedActorContext[_]): classic.ActorContext =
+ private def toClassicImp[U](context: TypedActorContext[?]): classic.ActorContext =
context match {
- case adapter: ActorContextAdapter[_] => adapter.classicContext
+ case adapter: ActorContextAdapter[?] => adapter.classicContext
case _ =>
throw new UnsupportedOperationException(
"Only adapted classic ActorContext permissible " +
s"($context of class ${context.getClass.getName})")
}
- def toClassic[U](context: scaladsl.ActorContext[_]): classic.ActorContext =
+ def toClassic[U](context: scaladsl.ActorContext[?]): classic.ActorContext =
toClassicImp(context)
- def toClassic[U](context: javadsl.ActorContext[_]): classic.ActorContext =
+ def toClassic[U](context: javadsl.ActorContext[?]): classic.ActorContext =
toClassicImp(context)
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorRefAdapter.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorRefAdapter.scala
index 5b8986c8ad..05e76a921d 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorRefAdapter.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorRefAdapter.scala
@@ -59,8 +59,8 @@ private[pekko] object ActorRefAdapter {
def toClassic[U](ref: ActorRef[U]): pekko.actor.InternalActorRef =
ref match {
- case adapter: ActorRefAdapter[_] => adapter.classicRef
- case adapter: ActorSystemAdapter[_] => adapter.system.guardian
+ case adapter: ActorRefAdapter[?] => adapter.classicRef
+ case adapter: ActorSystemAdapter[?] => adapter.system.guardian
case _ =>
throw new UnsupportedOperationException(
"Only adapted classic ActorRefs permissible " +
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorSystemAdapter.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorSystemAdapter.scala
index 87307b8b51..4e484f3bbe 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorSystemAdapter.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorSystemAdapter.scala
@@ -104,7 +104,7 @@ import pekko.util.FutureConverters._
}
override def dynamicAccess: classic.DynamicAccess = system.dynamicAccess
implicit override def executionContext: scala.concurrent.ExecutionContextExecutor = classicSystem.dispatcher
- override val log: Logger = LoggerFactory.getLogger(classOf[ActorSystem[_]])
+ override val log: Logger = LoggerFactory.getLogger(classOf[ActorSystem[?]])
override def logConfiguration(): Unit = classicSystem.logConfiguration()
override def name: String = classicSystem.name
override val scheduler: Scheduler = new SchedulerAdapter(classicSystem.scheduler)
@@ -167,10 +167,10 @@ private[pekko] object ActorSystemAdapter {
}
object LoadTypedExtensions extends classic.ExtensionId[LoadTypedExtensions] with classic.ExtensionIdProvider {
- override def lookup: actor.ExtensionId[_ <: actor.Extension] = this
+ override def lookup: actor.ExtensionId[? <: actor.Extension] = this
override def createExtension(system: ExtendedActorSystem): LoadTypedExtensions =
new LoadTypedExtensions(system)
}
- def toClassic[U](sys: ActorSystem[_]): classic.ActorSystem = sys.classicSystem
+ def toClassic[U](sys: ActorSystem[?]): classic.ActorSystem = sys.classicSystem
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionist.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionist.scala
index 5cc5a0b1d8..38269c7e42 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionist.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionist.scala
@@ -71,9 +71,9 @@ private[pekko] object LocalReceptionist extends ReceptionistBehaviorProvider {
*/
private final case class State(
services: TypedMultiMap[AbstractServiceKey, Service],
- servicesPerActor: Map[ActorRef[_], Set[AbstractServiceKey]],
+ servicesPerActor: Map[ActorRef[?], Set[AbstractServiceKey]],
subscriptions: TypedMultiMap[AbstractServiceKey, Subscriber],
- subscriptionsPerActor: Map[ActorRef[_], Set[AbstractServiceKey]]) {
+ subscriptionsPerActor: Map[ActorRef[?], Set[AbstractServiceKey]]) {
def serviceInstanceAdded[Key <: AbstractServiceKey](key: Key)(serviceInstance: ActorRef[key.Protocol]): State = {
val newServices = services.inserted(key)(serviceInstance)
@@ -101,7 +101,7 @@ private[pekko] object LocalReceptionist extends ReceptionistBehaviorProvider {
copy(services = newServices, servicesPerActor = newServicePerActor)
}
- def serviceInstanceRemoved(serviceInstance: ActorRef[_]): State = {
+ def serviceInstanceRemoved(serviceInstance: ActorRef[?]): State = {
val keys = servicesPerActor.getOrElse(serviceInstance, Set.empty)
val newServices =
if (keys.isEmpty) services
@@ -140,7 +140,7 @@ private[pekko] object LocalReceptionist extends ReceptionistBehaviorProvider {
copy(subscriptions = newSubscriptions, subscriptionsPerActor = newSubscriptionsPerActor)
}
- def subscriberRemoved(subscriber: ActorRef[_]): State = {
+ def subscriberRemoved(subscriber: ActorRef[?]): State = {
val keys = subscriptionsPerActor.getOrElse(subscriber, Set.empty)
if (keys.isEmpty) this
else {
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistImpl.scala
index 9dfcff1577..762e660fee 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistImpl.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistImpl.scala
@@ -24,7 +24,7 @@ import pekko.annotation.InternalApi
/**
* INTERNAL API
*/
-@InternalApi private[pekko] class ReceptionistImpl(system: ActorSystem[_]) extends Receptionist {
+@InternalApi private[pekko] class ReceptionistImpl(system: ActorSystem[?]) extends Receptionist {
override val ref: ActorRef[Receptionist.Command] = {
val provider: ReceptionistBehaviorProvider =
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistMessages.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistMessages.scala
index 175a9debae..2caf00bb94 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistMessages.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistMessages.scala
@@ -45,7 +45,7 @@ private[pekko] object ReceptionistMessages {
final case class Registered[T] private[pekko] (key: ServiceKey[T], _serviceInstance: ActorRef[T])
extends Receptionist.Registered {
- def isForKey(key: ServiceKey[_]): Boolean = key == this.key
+ def isForKey(key: ServiceKey[?]): Boolean = key == this.key
def serviceInstance[M](key: ServiceKey[M]): ActorRef[M] = {
if (key != this.key)
throw new IllegalArgumentException(s"Wrong key [$key] used, must use listing key [${this.key}]")
@@ -58,7 +58,7 @@ private[pekko] object ReceptionistMessages {
final case class Deregistered[T] private[pekko] (key: ServiceKey[T], _serviceInstance: ActorRef[T])
extends Receptionist.Deregistered {
- def isForKey(key: ServiceKey[_]): Boolean = key == this.key
+ def isForKey(key: ServiceKey[?]): Boolean = key == this.key
def serviceInstance[M](key: ServiceKey[M]): ActorRef[M] = {
if (key != this.key)
throw new IllegalArgumentException(s"Wrong key [$key] used, must use listing key [${this.key}]")
@@ -78,7 +78,7 @@ private[pekko] object ReceptionistMessages {
servicesWereAddedOrRemoved: Boolean)
extends Receptionist.Listing {
- def isForKey(key: ServiceKey[_]): Boolean = key == this.key
+ def isForKey(key: ServiceKey[?]): Boolean = key == this.key
def serviceInstances[M](key: ServiceKey[M]): Set[ActorRef[M]] = {
if (key != this.key)
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ServiceKeySerializer.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ServiceKeySerializer.scala
index 282f2a5c26..9316e45b54 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ServiceKeySerializer.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ServiceKeySerializer.scala
@@ -28,13 +28,13 @@ final class ServiceKeySerializer(val system: pekko.actor.ExtendedActorSystem)
extends SerializerWithStringManifest
with BaseSerializer {
def manifest(o: AnyRef): String = o match {
- case key: DefaultServiceKey[_] => key.typeName
+ case key: DefaultServiceKey[?] => key.typeName
case _ =>
throw new IllegalArgumentException(s"Can't serialize object of type ${o.getClass} in [${getClass.getName}]")
}
def toBinary(o: AnyRef): Array[Byte] = o match {
- case serviceKey: DefaultServiceKey[_] => serviceKey.id.getBytes(StandardCharsets.UTF_8)
+ case serviceKey: DefaultServiceKey[?] => serviceKey.id.getBytes(StandardCharsets.UTF_8)
case _ =>
throw new IllegalArgumentException(s"Cannot serialize object of type [${o.getClass.getName}]")
}
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/GroupRouterImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/GroupRouterImpl.scala
index a7c35b348b..4d006cf2e3 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/GroupRouterImpl.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/GroupRouterImpl.scala
@@ -33,7 +33,7 @@ import pekko.annotation.InternalApi
private[pekko] final case class GroupRouterBuilder[T] private[pekko] (
key: ServiceKey[T],
preferLocalRoutees: Boolean = false,
- logicFactory: ActorSystem[_] => RoutingLogic[T] = (_: ActorSystem[_]) => new RoutingLogics.RandomLogic[T]())
+ logicFactory: ActorSystem[?] => RoutingLogic[T] = (_: ActorSystem[?]) => new RoutingLogics.RandomLogic[T]())
extends javadsl.GroupRouter[T]
with scaladsl.GroupRouter[T] {
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterImpl.scala
index 8789052ad6..37e692e053 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterImpl.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterImpl.scala
@@ -30,7 +30,7 @@ import java.util.function.Predicate
private[pekko] final case class PoolRouterBuilder[T](
poolSize: Int,
behavior: Behavior[T],
- logicFactory: ActorSystem[_] => RoutingLogic[T] = (_: ActorSystem[_]) => new RoutingLogics.RoundRobinLogic[T],
+ logicFactory: ActorSystem[?] => RoutingLogic[T] = (_: ActorSystem[?]) => new RoutingLogics.RoundRobinLogic[T],
broadcastPredicate: T => Boolean = ConstantFun.anyToFalse,
routeeProps: Props = Props.empty)
extends javadsl.PoolRouter[T]
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ActorContext.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ActorContext.scala
index 7dab2e674f..c83440e8bd 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ActorContext.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ActorContext.scala
@@ -103,7 +103,7 @@ trait ActorContext[T] extends TypedActorContext[T] with ClassicActorContextProvi
* *Warning*: This method is not thread-safe and must not be accessed from threads other
* than the ordinary actor message processing thread, such as [[java.util.concurrent.CompletionStage]] callbacks.
*/
- def setLoggerName(clazz: Class[_]): Unit
+ def setLoggerName(clazz: Class[?]): Unit
/**
* The list of child Actors created by this Actor during its lifetime that
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Adapter.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Adapter.scala
index dc8a88e3a2..ce32ba369a 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Adapter.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Adapter.scala
@@ -110,10 +110,10 @@ object Adapter {
def toTyped(sys: pekko.actor.ActorSystem): ActorSystem[Void] =
sys.toTyped.asInstanceOf[ActorSystem[Void]]
- def toClassic(sys: ActorSystem[_]): pekko.actor.ActorSystem =
+ def toClassic(sys: ActorSystem[?]): pekko.actor.ActorSystem =
sys.toClassic
- def toClassic(ctx: ActorContext[_]): actor.ActorContext =
+ def toClassic(ctx: ActorContext[?]): actor.ActorContext =
ActorContextAdapter.toClassic(ctx)
def watch[U](ctx: pekko.actor.ActorContext, other: ActorRef[U]): Unit =
@@ -122,25 +122,25 @@ object Adapter {
def unwatch[U](ctx: pekko.actor.ActorContext, other: ActorRef[U]): Unit =
ctx.unwatch(other)
- def stop(ctx: pekko.actor.ActorContext, child: ActorRef[_]): Unit =
+ def stop(ctx: pekko.actor.ActorContext, child: ActorRef[?]): Unit =
ctx.stop(child)
- def watch[U](ctx: ActorContext[_], other: pekko.actor.ActorRef): Unit =
+ def watch[U](ctx: ActorContext[?], other: pekko.actor.ActorRef): Unit =
ctx.watch(other)
- def unwatch[U](ctx: ActorContext[_], other: pekko.actor.ActorRef): Unit =
+ def unwatch[U](ctx: ActorContext[?], other: pekko.actor.ActorRef): Unit =
ctx.unwatch(other)
- def stop(ctx: ActorContext[_], child: pekko.actor.ActorRef): Unit =
+ def stop(ctx: ActorContext[?], child: pekko.actor.ActorRef): Unit =
ctx.stop(child)
- def actorOf(ctx: ActorContext[_], props: pekko.actor.Props): pekko.actor.ActorRef =
+ def actorOf(ctx: ActorContext[?], props: pekko.actor.Props): pekko.actor.ActorRef =
ActorContextAdapter.toClassic(ctx).actorOf(props)
- def actorOf(ctx: ActorContext[_], props: pekko.actor.Props, name: String): pekko.actor.ActorRef =
+ def actorOf(ctx: ActorContext[?], props: pekko.actor.Props, name: String): pekko.actor.ActorRef =
ActorContextAdapter.toClassic(ctx).actorOf(props, name)
- def toClassic(ref: ActorRef[_]): pekko.actor.ActorRef =
+ def toClassic(ref: ActorRef[?]): pekko.actor.ActorRef =
ref.toClassic
def toTyped[T](ref: pekko.actor.ActorRef): ActorRef[T] =
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/BehaviorBuilder.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/BehaviorBuilder.scala
index 96b4047742..a8e4a5dd56 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/BehaviorBuilder.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/BehaviorBuilder.scala
@@ -81,7 +81,7 @@ final class BehaviorBuilder[T] private (messageHandlers: List[Case[T, T]], signa
* @param handler action to apply when the type matches
* @return a new behavior builder with the specified handling appended
*/
- def onMessageUnchecked[M <: T](`type`: Class[_ <: T], handler: JFunction[M, Behavior[T]]): BehaviorBuilder[T] =
+ def onMessageUnchecked[M <: T](`type`: Class[? <: T], handler: JFunction[M, Behavior[T]]): BehaviorBuilder[T] =
withMessage[M](OptionVal.Some(`type`.asInstanceOf[Class[M]]), OptionVal.None, handler)
/**
@@ -173,7 +173,7 @@ object BehaviorBuilder {
/** INTERNAL API */
@InternalApi
private[javadsl] final case class Case[BT, MT](
- `type`: OptionVal[Class[_ <: MT]],
+ `type`: OptionVal[Class[? <: MT]],
test: OptionVal[MT => Boolean],
handler: JFunction[MT, Behavior[BT]])
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ReceiveBuilder.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ReceiveBuilder.scala
index ec60a85f74..0e0b2419e2 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ReceiveBuilder.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ReceiveBuilder.scala
@@ -76,7 +76,7 @@ final class ReceiveBuilder[T] private (
* @param handler action to apply when the type matches
* @return this behavior builder
*/
- def onMessageUnchecked[M <: T](`type`: Class[_ <: T], handler: JFunction[M, Behavior[T]]): ReceiveBuilder[T] =
+ def onMessageUnchecked[M <: T](`type`: Class[? <: T], handler: JFunction[M, Behavior[T]]): ReceiveBuilder[T] =
withMessage[M](OptionVal.Some(`type`.asInstanceOf[Class[M]]), OptionVal.None, handler)
/**
@@ -173,7 +173,7 @@ object ReceiveBuilder {
/** INTERNAL API */
@InternalApi
private[javadsl] final case class Case[BT, MT](
- `type`: OptionVal[Class[_ <: MT]],
+ `type`: OptionVal[Class[? <: MT]],
test: OptionVal[JPredicate[MT]],
handler: JFunction[MT, Behavior[BT]])
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/receptionist/Receptionist.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/receptionist/Receptionist.scala
index 57c995d00a..f96cb94d8b 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/receptionist/Receptionist.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/receptionist/Receptionist.scala
@@ -104,8 +104,8 @@ abstract class ServiceKey[T] extends AbstractServiceKey { key =>
* The receptionist is easiest accessed through the system: [[ActorSystem.receptionist]]
*/
object Receptionist extends ExtensionId[Receptionist] {
- def createExtension(system: ActorSystem[_]): Receptionist = new ReceptionistImpl(system)
- def get(system: ActorSystem[_]): Receptionist = apply(system)
+ def createExtension(system: ActorSystem[?]): Receptionist = new ReceptionistImpl(system)
+ def get(system: ActorSystem[?]): Receptionist = apply(system)
/**
* The set of commands accepted by a Receptionist.
@@ -172,13 +172,13 @@ object Receptionist extends ExtensionId[Receptionist] {
@DoNotInherit
trait Registered {
- def isForKey(key: ServiceKey[_]): Boolean
+ def isForKey(key: ServiceKey[?]): Boolean
/** Scala API */
- def key: ServiceKey[_]
+ def key: ServiceKey[?]
/** Java API */
- def getKey: ServiceKey[_] = key
+ def getKey: ServiceKey[?] = key
/**
* Scala API
@@ -255,13 +255,13 @@ object Receptionist extends ExtensionId[Receptionist] {
@DoNotInherit
trait Deregistered {
- def isForKey(key: ServiceKey[_]): Boolean
+ def isForKey(key: ServiceKey[?]): Boolean
/** Scala API */
- def key: ServiceKey[_]
+ def key: ServiceKey[?]
/** Java API */
- def getKey: ServiceKey[_] = key
+ def getKey: ServiceKey[?] = key
/**
* Scala API
@@ -354,12 +354,12 @@ object Receptionist extends ExtensionId[Receptionist] {
trait Listing {
/** Scala API */
- def key: ServiceKey[_]
+ def key: ServiceKey[?]
/** Java API */
- def getKey: ServiceKey[_] = key
+ def getKey: ServiceKey[?] = key
- def isForKey(key: ServiceKey[_]): Boolean
+ def isForKey(key: ServiceKey[?]): Boolean
/**
* Scala API: Return the reachable service instances.
@@ -463,7 +463,7 @@ object Receptionist extends ExtensionId[Receptionist] {
}
object ReceptionistSetup {
- def apply[T <: Extension](createExtension: ActorSystem[_] => Receptionist): ReceptionistSetup =
+ def apply[T <: Extension](createExtension: ActorSystem[?] => Receptionist): ReceptionistSetup =
new ReceptionistSetup(createExtension(_))
}
@@ -473,5 +473,5 @@ object ReceptionistSetup {
* to replace the default implementation of the [[Receptionist]] extension. Intended
* for tests that need to replace extension with stub/mock implementations.
*/
-final class ReceptionistSetup(createExtension: java.util.function.Function[ActorSystem[_], Receptionist])
+final class ReceptionistSetup(createExtension: java.util.function.Function[ActorSystem[?], Receptionist])
extends ExtensionSetup[Receptionist](Receptionist, createExtension)
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/ActorContext.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/ActorContext.scala
index b8448cc2a7..6fdaf31225 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/ActorContext.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/ActorContext.scala
@@ -103,7 +103,7 @@ trait ActorContext[T] extends TypedActorContext[T] with ClassicActorContextProvi
* *Warning*: This method is not thread-safe and must not be accessed from threads other
* than the ordinary actor message processing thread, such as [[scala.concurrent.Future]] callbacks.
*/
- def setLoggerName(clazz: Class[_]): Unit
+ def setLoggerName(clazz: Class[?]): Unit
/**
* The list of child Actors created by this Actor during its lifetime that
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/AskPattern.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/AskPattern.scala
index 709d7a730f..192912178a 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/AskPattern.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/AskPattern.scala
@@ -40,7 +40,7 @@ object AskPattern {
* Provides a scheduler from an actor system (that will likely already be implicit in the scope) to minimize ask
* boilerplate.
*/
- implicit def schedulerFromActorSystem(implicit system: ActorSystem[_]): Scheduler = system.scheduler
+ implicit def schedulerFromActorSystem(implicit system: ActorSystem[?]): Scheduler = system.scheduler
/**
* See [[ask]]
@@ -140,7 +140,7 @@ object AskPattern {
private val onTimeout: String => Throwable = msg => new TimeoutException(msg)
- private final class PromiseRef[U](target: InternalRecipientRef[_], timeout: Timeout) {
+ private final class PromiseRef[U](target: InternalRecipientRef[?], timeout: Timeout) {
// Note: _promiseRef mustn't have a type pattern, since it can be null
private[this] val (_ref: ActorRef[U], _future: Future[U], _promiseRef) =
diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/adapter/package.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/adapter/package.scala
index 18e6583eea..99b1039c54 100644
--- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/adapter/package.scala
+++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/adapter/package.scala
@@ -83,7 +83,7 @@ package object adapter {
/**
* Extension methods added to [[pekko.actor.typed.ActorSystem]].
*/
- implicit class TypedActorSystemOps(val sys: ActorSystem[_]) extends AnyVal {
+ implicit class TypedActorSystemOps(val sys: ActorSystem[?]) extends AnyVal {
def toClassic: pekko.actor.ActorSystem = sys.classicSystem
/**
@@ -132,14 +132,14 @@ package object adapter {
def watch[U](other: ActorRef[U]): Unit = ctx.watch(ActorRefAdapter.toClassic(other))
def unwatch[U](other: ActorRef[U]): Unit = ctx.unwatch(ActorRefAdapter.toClassic(other))
- def stop(child: ActorRef[_]): Unit =
+ def stop(child: ActorRef[?]): Unit =
ctx.stop(ActorRefAdapter.toClassic(child))
}
/**
* Extension methods added to [[pekko.actor.typed.scaladsl.ActorContext]].
*/
- implicit class TypedActorContextOps(val ctx: scaladsl.ActorContext[_]) extends AnyVal {
+ implicit class TypedActorContextOps(val ctx: scaladsl.ActorContext[?]) extends AnyVal {
def actorOf(props: pekko.actor.Props): pekko.actor.ActorRef =
ActorContextAdapter.toClassic(ctx).actorOf(props)
@@ -154,7 +154,7 @@ package object adapter {
/**
* Extension methods added to [[pekko.actor.typed.ActorRef]].
*/
- implicit class TypedActorRefOps(val ref: ActorRef[_]) extends AnyVal {
+ implicit class TypedActorRefOps(val ref: ActorRef[?]) extends AnyVal {
def toClassic: pekko.actor.ActorRef = ActorRefAdapter.toClassic(ref)
}
diff --git a/actor/src/main/scala-2.12/org/apache/pekko/util/ByteString.scala b/actor/src/main/scala-2.12/org/apache/pekko/util/ByteString.scala
index 21326e4140..748fbee0ed 100644
--- a/actor/src/main/scala-2.12/org/apache/pekko/util/ByteString.scala
+++ b/actor/src/main/scala-2.12/org/apache/pekko/util/ByteString.scala
@@ -1317,7 +1317,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
_builder += ByteString.ByteString1(copied)
_length += seq.length
}
- case seq: collection.IndexedSeq[_] =>
+ case seq: collection.IndexedSeq[?] =>
if (seq.nonEmpty) {
ensureTempSize(_tempLength + xs.size)
xs.copyToArray(_temp, _tempLength)
diff --git a/actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala b/actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala
index 42d1d83e6a..f5e78f941c 100644
--- a/actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala
+++ b/actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala
@@ -46,7 +46,7 @@ object ByteIterator {
final def head: Byte = array(from)
final def next(): Byte = {
- if (!hasNext) EmptyImmutableSeq.iterator.next()
+ if !hasNext then EmptyImmutableSeq.iterator.next()
else {
val i = from; from = from + 1; array(i)
}
@@ -58,12 +58,12 @@ object ByteIterator {
final override def ++(that: IterableOnce[Byte]): ByteIterator = that match {
case that: ByteIterator =>
- if (that.isEmpty) this
- else if (this.isEmpty) that
+ if that.isEmpty then this
+ else if this.isEmpty then that
else
that match {
case that: ByteArrayIterator =>
- if ((this.array eq that.array) && (this.until == that.from)) {
+ if (this.array eq that.array) && (this.until == that.from) then {
this.until = that.until
that.clear()
this
@@ -80,12 +80,12 @@ object ByteIterator {
final override def clone: ByteArrayIterator = new ByteArrayIterator(array, from, until)
final override def take(n: Int): this.type = {
- if (n < len) until = { if (n > 0) from + n else from }
+ if n < len then until = { if n > 0 then from + n else from }
this
}
final override def drop(n: Int): this.type = {
- if (n > 0) from = { if (n < len) from + n else until }
+ if n > 0 then from = { if n < len then from + n else until }
this
}
@@ -98,8 +98,8 @@ object ByteIterator {
final override def dropWhile(p: Byte => Boolean): this.type = {
var stop = false
- while (!stop && hasNext) {
- if (p(array(from))) {
+ while !stop && hasNext do {
+ if p(array(from)) then {
from = from + 1
} else {
stop = true
@@ -123,7 +123,7 @@ object ByteIterator {
final override def toByteString: ByteString = {
val result =
- if ((from == 0) && (until == array.length)) ByteString.ByteString1C(array)
+ if (from == 0) && (until == array.length) then ByteString.ByteString1C(array)
else ByteString.ByteString1(array, from, len)
clear()
result
@@ -131,7 +131,7 @@ object ByteIterator {
@throws[NoSuchElementException]
def getBytes(xs: Array[Byte], offset: Int, n: Int): this.type = {
- if (n <= this.len) {
+ if n <= this.len then {
System.arraycopy(this.array, this.from, xs, offset, n)
this.drop(n)
} else throw new NoSuchElementException("next on empty iterator")
@@ -161,7 +161,7 @@ object ByteIterator {
def copyToBuffer(buffer: ByteBuffer): Int = {
val copyLength = math.min(buffer.remaining, len)
- if (copyLength > 0) {
+ if copyLength > 0 then {
buffer.put(array, from, copyLength)
drop(copyLength)
}
@@ -171,12 +171,12 @@ object ByteIterator {
def asInputStream: java.io.InputStream = new java.io.InputStream {
override def available: Int = iterator.len
- def read: Int = if (hasNext) next().toInt & 0xFF else -1
+ def read: Int = if hasNext then next().toInt & 0xFF else -1
override def read(b: Array[Byte], off: Int, len: Int): Int = {
- if ((off < 0) || (len < 0) || (off + len > b.length)) throw new IndexOutOfBoundsException
- if (len == 0) 0
- else if (!isEmpty) {
+ if (off < 0) || (len < 0) || (off + len > b.length) then throw new IndexOutOfBoundsException
+ if len == 0 then 0
+ else if !isEmpty then {
val nRead = math.min(available(), len)
copyToArray(b, off, nRead)
nRead
@@ -206,8 +206,8 @@ object ByteIterator {
// * (!iterator.head.isEmpty || iterators.tail.isEmpty) == true
private def normalize(): this.type = {
@tailrec def norm(xs: LinearSeq[ByteArrayIterator]): LinearSeq[ByteArrayIterator] = {
- if (xs.isEmpty) MultiByteArrayIterator.clearedList
- else if (xs.head.isEmpty) norm(xs.tail)
+ if xs.isEmpty then MultiByteArrayIterator.clearedList
+ else if xs.head.isEmpty then norm(xs.tail)
else xs
}
iterators = norm(iterators)
@@ -244,8 +244,8 @@ object ByteIterator {
final override def ++(that: IterableOnce[Byte]): ByteIterator = that match {
case that: ByteIterator =>
- if (that.isEmpty) this
- else if (this.isEmpty) that
+ if that.isEmpty then this
+ else if this.isEmpty then that
else {
that match {
case that: ByteArrayIterator =>
@@ -270,9 +270,9 @@ object ByteIterator {
final override def take(n: Int): this.type = {
var rest = n
val builder = new ListBuffer[ByteArrayIterator]
- while ((rest > 0) && !iterators.isEmpty) {
+ while (rest > 0) && !iterators.isEmpty do {
current.take(rest)
- if (current.hasNext) {
+ if current.hasNext then {
rest -= current.len
builder += current
}
@@ -284,7 +284,7 @@ object ByteIterator {
/** For performance sensitive code, call drop() directly on ByteString (it's optimised there) */
final override def drop(n: Int): this.type =
- if ((n > 0) && !isEmpty) {
+ if (n > 0) && !isEmpty then {
val nCurrent = math.min(n, current.len)
current.drop(n)
val rest = n - nCurrent
@@ -296,11 +296,11 @@ object ByteIterator {
final override def takeWhile(p: Byte => Boolean): this.type = {
var stop = false
val builder = new ListBuffer[ByteArrayIterator]
- while (!stop && !iterators.isEmpty) {
+ while !stop && !iterators.isEmpty do {
val lastLen = current.len
current.takeWhile(p)
- if (current.hasNext) builder += current
- if (current.len < lastLen) stop = true
+ if current.hasNext then builder += current
+ if current.len < lastLen then stop = true
dropCurrent()
}
iterators = builder.result()
@@ -308,22 +308,22 @@ object ByteIterator {
}
@tailrec final override def dropWhile(p: Byte => Boolean): this.type =
- if (!isEmpty) {
+ if !isEmpty then {
current.dropWhile(p)
val dropMore = current.isEmpty
normalize()
- if (dropMore) dropWhile(p) else this
+ if dropMore then dropWhile(p) else this
} else this
final override def copyToArray[B >: Byte](xs: Array[B], start: Int, len: Int): Int = {
var pos = start
var rest = len
- while ((rest > 0) && !iterators.isEmpty && pos < xs.length) {
+ while (rest > 0) && !iterators.isEmpty && pos < xs.length do {
val n = 0 max ((xs.length - pos) min current.len min rest)
current.copyToArray(xs, pos, n)
pos += n
rest -= n
- if (current.isEmpty) {
+ if current.isEmpty then {
dropCurrent()
}
}
@@ -337,7 +337,7 @@ object ByteIterator {
}
final override def toByteString: ByteString = {
- if (iterators.tail.isEmpty) iterators.head.toByteString
+ if iterators.tail.isEmpty then iterators.head.toByteString
else {
val result = iterators.foldLeft(ByteString.empty) { _ ++ _.toByteString }
clear()
@@ -347,10 +347,10 @@ object ByteIterator {
@tailrec protected final def getToArray[A](xs: Array[A], offset: Int, n: Int, elemSize: Int)(getSingle: => A)(
getMult: (Array[A], Int, Int) => Unit): this.type =
- if (n <= 0) this
+ if n <= 0 then this
else {
- if (isEmpty) EmptyImmutableSeq.iterator.next()
- val nDone = if (current.len >= elemSize) {
+ if isEmpty then EmptyImmutableSeq.iterator.next()
+ val nDone = if current.len >= elemSize then {
val nCurrent = math.min(n, current.len / elemSize)
getMult(xs, offset, nCurrent)
nCurrent
@@ -391,7 +391,7 @@ object ByteIterator {
def asInputStream: java.io.InputStream = new java.io.InputStream {
override def available: Int = current.len
- def read: Int = if (hasNext) next().toInt & 0xFF else -1
+ def read: Int = if hasNext then next().toInt & 0xFF else -1
override def read(b: Array[Byte], off: Int, len: Int): Int = {
val nRead = current.asInputStream.read(b, off, len)
@@ -401,13 +401,13 @@ object ByteIterator {
override def skip(n: Long): Long = {
@tailrec def skipImpl(n: Long, skipped: Long): Long =
- if (n > 0) {
- if (!isEmpty) {
+ if n > 0 then {
+ if !isEmpty then {
val m = current.asInputStream.skip(n)
normalize()
val newN = n - m
val newSkipped = skipped + m
- if (newN > 0) skipImpl(newN, newSkipped)
+ if newN > 0 then skipImpl(newN, newSkipped)
else newSkipped
} else 0
} else 0
@@ -432,7 +432,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
def ++(that: IterableOnce[Byte]): ByteIterator = {
val it = that.iterator
- if (it.isEmpty) this
+ if it.isEmpty then this
else ByteIterator.ByteArrayIterator(it.toArray)
}
@@ -457,7 +457,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
throw new UnsupportedOperationException("Method drop is not implemented in ByteIterator")
override def slice(from: Int, until: Int): this.type = {
- if (from > 0) drop(from).take(until - from)
+ if from > 0 then drop(from).take(until - from)
else take(until)
}
@@ -482,17 +482,18 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
override def indexWhere(p: Byte => Boolean, from: Int = 0): Int = {
var index = 0
- while (index < from && hasNext) {
+ while index < from && hasNext do {
next()
index += 1
}
var found = false
- while (!found && hasNext) if (p(next())) {
- found = true
- } else {
- index += 1
- }
- if (found) index else -1
+ while !found && hasNext do
+ if p(next()) then {
+ found = true
+ } else {
+ index += 1
+ }
+ if found then index else -1
}
def indexOf(elem: Byte): Int = indexOf(elem, 0)
@@ -506,7 +507,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
override def toSeq: ByteString = toByteString
override def foreach[@specialized U](f: Byte => U): Unit =
- while (hasNext) f(next())
+ while hasNext do f(next())
override def foldLeft[@specialized B](z: B)(op: (B, Byte) => B): B = {
var acc = z
@@ -531,9 +532,9 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
* Get a single Short from this iterator.
*/
def getShort(implicit byteOrder: ByteOrder): Short = {
- if (byteOrder == ByteOrder.BIG_ENDIAN)
+ if byteOrder == ByteOrder.BIG_ENDIAN then
((next() & 0xFF) << 8 | (next() & 0xFF) << 0).toShort
- else if (byteOrder == ByteOrder.LITTLE_ENDIAN)
+ else if byteOrder == ByteOrder.LITTLE_ENDIAN then
((next() & 0xFF) << 0 | (next() & 0xFF) << 8).toShort
else throw new IllegalArgumentException("Unknown byte order " + byteOrder)
}
@@ -542,12 +543,12 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
* Get a single Int from this iterator.
*/
def getInt(implicit byteOrder: ByteOrder): Int = {
- if (byteOrder == ByteOrder.BIG_ENDIAN)
+ if byteOrder == ByteOrder.BIG_ENDIAN then
((next() & 0xFF) << 24
| (next() & 0xFF) << 16
| (next() & 0xFF) << 8
| (next() & 0xFF) << 0)
- else if (byteOrder == ByteOrder.LITTLE_ENDIAN)
+ else if byteOrder == ByteOrder.LITTLE_ENDIAN then
((next() & 0xFF) << 0
| (next() & 0xFF) << 8
| (next() & 0xFF) << 16
@@ -559,7 +560,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
* Get a single Long from this iterator.
*/
def getLong(implicit byteOrder: ByteOrder): Long = {
- if (byteOrder == ByteOrder.BIG_ENDIAN)
+ if byteOrder == ByteOrder.BIG_ENDIAN then
((next().toLong & 0xFF) << 56
| (next().toLong & 0xFF) << 48
| (next().toLong & 0xFF) << 40
@@ -568,7 +569,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
| (next().toLong & 0xFF) << 16
| (next().toLong & 0xFF) << 8
| (next().toLong & 0xFF) << 0)
- else if (byteOrder == ByteOrder.LITTLE_ENDIAN)
+ else if byteOrder == ByteOrder.LITTLE_ENDIAN then
((next().toLong & 0xFF) << 0
| (next().toLong & 0xFF) << 8
| (next().toLong & 0xFF) << 16
@@ -585,11 +586,11 @@ abstract class ByteIterator extends BufferedIterator[Byte] {
* bytes were encoded.
*/
def getLongPart(n: Int)(implicit byteOrder: ByteOrder): Long = {
- if (byteOrder == ByteOrder.BIG_ENDIAN) {
+ if byteOrder == ByteOrder.BIG_ENDIAN then {
var x = 0L
(1 to n).foreach(_ => x = (x << 8) | (next() & 0xFF))
x
- } else if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
+ } else if byteOrder == ByteOrder.LITTLE_ENDIAN then {
var x = 0L
(0 until n).foreach(i => x |= (next() & 0xFF) << 8 * i)
x
diff --git a/actor/src/main/scala-3/org/apache/pekko/util/ByteString.scala b/actor/src/main/scala-3/org/apache/pekko/util/ByteString.scala
index 2c219e1c19..85da617dd9 100644
--- a/actor/src/main/scala-3/org/apache/pekko/util/ByteString.scala
+++ b/actor/src/main/scala-3/org/apache/pekko/util/ByteString.scala
@@ -14,7 +14,7 @@
package org.apache.pekko.util
import java.io.{ InputStream, ObjectInputStream, ObjectOutputStream, SequenceInputStream }
-import java.lang.{ Iterable => JIterable }
+import java.lang.Iterable as JIterable
import java.nio.{ ByteBuffer, ByteOrder }
import java.nio.charset.{ Charset, StandardCharsets }
import java.util.Base64
@@ -25,7 +25,7 @@ import scala.annotation.{ nowarn, tailrec, varargs }
import scala.collection.{ immutable, mutable }
import scala.collection.immutable.{ IndexedSeq, IndexedSeqOps, StrictOptimizedSeqOps, VectorBuilder }
import scala.collection.mutable.{ Builder, WrappedArray }
-import scala.jdk.CollectionConverters._
+import scala.jdk.CollectionConverters.*
import scala.reflect.ClassTag
object ByteString {
@@ -38,7 +38,7 @@ object ByteString {
/**
* Creates a new ByteString by copying bytes.
*/
- def apply(bytes: Byte*): ByteString = CompactByteString(bytes: _*)
+ def apply(bytes: Byte*): ByteString = CompactByteString(bytes*)
/**
* Creates a new ByteString by iterating over bytes.
@@ -49,7 +49,7 @@ object ByteString {
* Creates a new ByteString by converting from integral numbers to bytes.
*/
def apply[T](bytes: T*)(implicit num: Integral[T]): ByteString =
- CompactByteString(bytes: _*)(num)
+ CompactByteString(bytes*)(num)
/**
* Creates a new ByteString by copying bytes from a ByteBuffer.
@@ -123,7 +123,7 @@ object ByteString {
*/
@varargs
def fromInts(array: Int*): ByteString =
- apply(array: _*)(scala.math.Numeric.IntIsIntegral)
+ apply(array*)(scala.math.Numeric.IntIsIntegral)
/**
* Creates a new ByteString which will contain the UTF-8 representation of the given String
@@ -203,42 +203,42 @@ object ByteString {
override def asByteBuffers: scala.collection.immutable.Iterable[ByteBuffer] = List(asByteBuffer)
override def decodeString(charset: String): String =
- if (isEmpty) "" else new String(bytes, charset)
+ if isEmpty then "" else new String(bytes, charset)
override def decodeString(charset: Charset): String =
- if (isEmpty) "" else new String(bytes, charset)
+ if isEmpty then "" else new String(bytes, charset)
override def decodeBase64: ByteString =
- if (isEmpty) this else ByteString1C(Base64.getDecoder.decode(bytes))
+ if isEmpty then this else ByteString1C(Base64.getDecoder.decode(bytes))
override def encodeBase64: ByteString =
- if (isEmpty) this else ByteString1C(Base64.getEncoder.encode(bytes))
+ if isEmpty then this else ByteString1C(Base64.getEncoder.encode(bytes))
override def ++(that: ByteString): ByteString = {
- if (that.isEmpty) this
- else if (this.isEmpty) that
+ if that.isEmpty then this
+ else if this.isEmpty then that
else toByteString1 ++ that
}
override def take(n: Int): ByteString =
- if (n <= 0) ByteString.empty
- else if (n >= length) this
+ if n <= 0 then ByteString.empty
+ else if n >= length then this
else toByteString1.take(n)
override def dropRight(n: Int): ByteString =
- if (n <= 0) this
+ if n <= 0 then this
else toByteString1.dropRight(n)
override def drop(n: Int): ByteString =
- if (n <= 0) this
+ if n <= 0 then this
else toByteString1.drop(n)
override def indexOf[B >: Byte](elem: B, from: Int): Int = {
- if (from >= length) -1
+ if from >= length then -1
else {
var i = math.max(from, 0)
- while (i < length) {
- if (bytes(i) == elem) return i
+ while i < length do {
+ if bytes(i) == elem then return i
i += 1
}
-1
@@ -246,11 +246,11 @@ object ByteString {
}
override def indexOf(elem: Byte, from: Int): Int = {
- if (from >= length) -1
+ if from >= length then -1
else {
var i = math.max(from, 0)
- while (i < length) {
- if (bytes(i) == elem) return i
+ while i < length do {
+ if bytes(i) == elem then return i
i += 1
}
-1
@@ -258,12 +258,12 @@ object ByteString {
}
override def indexOf(elem: Byte, from: Int, to: Int): Int = {
- if (from >= length || to <= from) -1
+ if from >= length || to <= from then -1
else {
val upto = math.min(to, length)
var i = math.max(from, 0)
- while (i < upto) {
- if (bytes(i) == elem) return i
+ while i < upto do {
+ if bytes(i) == elem then return i
i += 1
}
-1
@@ -271,8 +271,8 @@ object ByteString {
}
override def slice(from: Int, until: Int): ByteString =
- if (from <= 0 && until >= length) this
- else if (from >= length || until <= 0 || from >= until) ByteString.empty
+ if from <= 0 && until >= length then this
+ else if from >= length || until <= 0 || from >= until then ByteString.empty
else toByteString1.slice(from, until)
private[pekko] override def writeToOutputStream(os: ObjectOutputStream): Unit =
@@ -284,7 +284,7 @@ object ByteString {
/** INTERNAL API: Specialized for internal use, writing multiple ByteString1C into the same ByteBuffer. */
private[pekko] def writeToBuffer(buffer: ByteBuffer, offset: Int): Int = {
val copyLength = Math.min(buffer.remaining, offset + length)
- if (copyLength > 0) {
+ if copyLength > 0 then {
buffer.put(bytes, offset, copyLength)
}
copyLength
@@ -297,7 +297,7 @@ object ByteString {
override def copyToArray[B >: Byte](dest: Array[B], start: Int, len: Int): Int = {
val toCopy = math.min(math.min(len, bytes.length), dest.length - start)
- if (toCopy > 0) {
+ if toCopy > 0 then {
Array.copy(bytes, 0, dest, start, toCopy)
}
toCopy
@@ -314,7 +314,7 @@ object ByteString {
def fromString(s: String): ByteString1 = apply(s.getBytes(StandardCharsets.UTF_8))
def apply(bytes: Array[Byte]): ByteString1 = apply(bytes, 0, bytes.length)
def apply(bytes: Array[Byte], startIndex: Int, length: Int): ByteString1 =
- if (length == 0) empty
+ if length == 0 then empty
else new ByteString1(bytes, Math.max(0, startIndex), Math.max(0, length))
val SerializationIdentity = 0.toByte
@@ -337,7 +337,7 @@ object ByteString {
ByteIterator.ByteArrayIterator(bytes, startIndex, startIndex + length)
private def checkRangeConvert(index: Int): Int = {
- if (0 <= index && length > index)
+ if 0 <= index && length > index then
index + startIndex
else
throw new IndexOutOfBoundsException(index.toString)
@@ -357,25 +357,25 @@ object ByteString {
/** INTERNAL API */
private[pekko] def dropRight1(n: Int): ByteString1 =
- if (n <= 0) this
- else if (length - n <= 0) ByteString1.empty
+ if n <= 0 then this
+ else if length - n <= 0 then ByteString1.empty
else new ByteString1(bytes, startIndex, length - n)
override def drop(n: Int): ByteString =
- if (n <= 0) this else drop1(n)
+ if n <= 0 then this else drop1(n)
/** INTERNAL API */
private[pekko] def drop1(n: Int): ByteString1 = {
val nextStartIndex = startIndex + n
- if (nextStartIndex >= bytes.length) ByteString1.empty
+ if nextStartIndex >= bytes.length then ByteString1.empty
else ByteString1(bytes, nextStartIndex, length - n)
}
override def take(n: Int): ByteString =
- if (n <= 0) ByteString.empty else take1(n)
+ if n <= 0 then ByteString.empty else take1(n)
private[pekko] def take1(n: Int): ByteString1 =
- if (n >= length) this
+ if n >= length then this
else ByteString1(bytes, startIndex, n)
override def slice(from: Int, until: Int): ByteString =
@@ -387,61 +387,61 @@ object ByteString {
/** INTERNAL API: Specialized for internal use, writing multiple ByteString1C into the same ByteBuffer. */
private[pekko] def writeToBuffer(buffer: ByteBuffer): Int = {
val copyLength = Math.min(buffer.remaining, length)
- if (copyLength > 0) {
+ if copyLength > 0 then {
buffer.put(bytes, startIndex, copyLength)
}
copyLength
}
def compact: CompactByteString =
- if (isCompact) ByteString1C(bytes) else ByteString1C(toArray)
+ if isCompact then ByteString1C(bytes) else ByteString1C(toArray)
def asByteBuffer: ByteBuffer = {
val buffer = ByteBuffer.wrap(bytes, startIndex, length).asReadOnlyBuffer
- if (buffer.remaining < bytes.length) buffer.slice
+ if buffer.remaining < bytes.length then buffer.slice
else buffer
}
def asByteBuffers: scala.collection.immutable.Iterable[ByteBuffer] = List(asByteBuffer)
override def decodeString(charset: String): String =
- if (isEmpty) ""
+ if isEmpty then ""
else new String(bytes, startIndex, length, charset)
override def decodeString(charset: Charset): String = // avoids Charset.forName lookup in String internals
- if (isEmpty) ""
+ if isEmpty then ""
else new String(bytes, startIndex, length, charset)
override def decodeBase64: ByteString =
- if (isEmpty) this
- else if (isCompact) ByteString1C(Base64.getDecoder.decode(bytes))
+ if isEmpty then this
+ else if isCompact then ByteString1C(Base64.getDecoder.decode(bytes))
else {
val dst = Base64.getDecoder.decode(ByteBuffer.wrap(bytes, startIndex, length))
- if (dst.hasArray) {
- if (dst.array.length == dst.remaining) ByteString1C(dst.array)
+ if dst.hasArray then {
+ if dst.array.length == dst.remaining then ByteString1C(dst.array)
else ByteString1(dst.array, dst.arrayOffset + dst.position(), dst.remaining)
} else CompactByteString(dst)
}
override def encodeBase64: ByteString =
- if (isEmpty) this
- else if (isCompact) ByteString1C(Base64.getEncoder.encode(bytes))
+ if isEmpty then this
+ else if isCompact then ByteString1C(Base64.getEncoder.encode(bytes))
else {
val dst = Base64.getEncoder.encode(ByteBuffer.wrap(bytes, startIndex, length))
- if (dst.hasArray) {
- if (dst.array.length == dst.remaining) ByteString1C(dst.array)
+ if dst.hasArray then {
+ if dst.array.length == dst.remaining then ByteString1C(dst.array)
else ByteString1(dst.array, dst.arrayOffset + dst.position(), dst.remaining)
} else CompactByteString(dst)
}
def ++(that: ByteString): ByteString = {
- if (that.isEmpty) this
- else if (this.isEmpty) that
+ if that.isEmpty then this
+ else if this.isEmpty then that
else
that match {
case b: ByteString1C => ByteStrings(this, b.toByteString1)
case b: ByteString1 =>
- if ((bytes eq b.bytes) && (startIndex + length == b.startIndex))
+ if (bytes eq b.bytes) && (startIndex + length == b.startIndex) then
new ByteString1(bytes, startIndex, length + b.length)
else ByteStrings(this, b)
case bs: ByteStrings => ByteStrings(this, bs)
@@ -449,11 +449,11 @@ object ByteString {
}
override def indexOf[B >: Byte](elem: B, from: Int): Int = {
- if (from >= length) -1
+ if from >= length then -1
else {
var i = math.max(from, 0)
- while (i < length) {
- if (bytes(startIndex + i) == elem) return i
+ while i < length do {
+ if bytes(startIndex + i) == elem then return i
i += 1
}
-1
@@ -461,11 +461,11 @@ object ByteString {
}
override def indexOf(elem: Byte, from: Int): Int = {
- if (from >= length) -1
+ if from >= length then -1
else {
var i = math.max(from, 0)
- while (i < length) {
- if (bytes(startIndex + i) == elem) return i
+ while i < length do {
+ if bytes(startIndex + i) == elem then return i
i += 1
}
-1
@@ -473,12 +473,12 @@ object ByteString {
}
override def indexOf(elem: Byte, from: Int, to: Int): Int = {
- if (from >= length || to <= from) -1
+ if from >= length || to <= from then -1
else {
val upto = math.min(to, length)
var i = math.max(from, 0)
- while (i < upto) {
- if (bytes(startIndex + i) == elem) return i
+ while i < upto do {
+ if bytes(startIndex + i) == elem then return i
i += 1
}
-1
@@ -488,7 +488,7 @@ object ByteString {
override def copyToArray[B >: Byte](dest: Array[B], start: Int, len: Int): Int = {
// min of the bytes available to copy, bytes there is room for in dest and the requested number of bytes
val toCopy = math.min(math.min(len, length), dest.length - start)
- if (toCopy > 0) {
+ if toCopy > 0 then {
Array.copy(bytes, startIndex, dest, start, toCopy)
}
toCopy
@@ -497,7 +497,7 @@ object ByteString {
protected def writeReplace(): AnyRef = new SerializationProxy(this)
override def toArrayUnsafe(): Array[Byte] = {
- if (startIndex == 0 && length == bytes.length) bytes
+ if startIndex == 0 && length == bytes.length then bytes
else toArray
}
@@ -541,9 +541,9 @@ object ByteString {
// 0: both empty, 1: 2nd empty, 2: 1st empty, 3: neither empty
def compare(b1: ByteString, b2: ByteString): Int =
- if (b1.isEmpty)
- if (b2.isEmpty) 0 else 2
- else if (b2.isEmpty) 1
+ if b1.isEmpty then
+ if b2.isEmpty then 0 else 2
+ else if b2.isEmpty then 1
else 3
val SerializationIdentity = 2.toByte
@@ -556,7 +556,7 @@ object ByteString {
builder.sizeHint(nByteStrings)
- for (_ <- 0 until nByteStrings) {
+ for _ <- 0 until nByteStrings do {
val bs = ByteString1.readFromInputStream(is)
builder += bs
length += bs.length
@@ -572,15 +572,15 @@ object ByteString {
final class ByteStrings private (private[pekko] val bytestrings: Vector[ByteString1], val length: Int)
extends ByteString
with Serializable {
- if (bytestrings.isEmpty) throw new IllegalArgumentException("bytestrings must not be empty")
- if (bytestrings.head.isEmpty) throw new IllegalArgumentException("bytestrings.head must not be empty")
+ if bytestrings.isEmpty then throw new IllegalArgumentException("bytestrings must not be empty")
+ if bytestrings.head.isEmpty then throw new IllegalArgumentException("bytestrings.head must not be empty")
def apply(idx: Int): Byte = {
- if (0 <= idx && idx < length) {
+ if 0 <= idx && idx < length then {
var pos = 0
var seen = 0
var frag = bytestrings(pos)
- while (idx >= seen + frag.length) {
+ while idx >= seen + frag.length do {
seen += frag.length
pos += 1
frag = bytestrings(pos)
@@ -594,8 +594,8 @@ object ByteString {
ByteIterator.MultiByteArrayIterator(bytestrings.to(LazyList).map { _.iterator })
def ++(that: ByteString): ByteString = {
- if (that.isEmpty) this
- else if (this.isEmpty) that
+ if that.isEmpty then this
+ else if this.isEmpty then that
else
that match {
case b: ByteString1C => ByteStrings(this, b.toByteString1)
@@ -606,18 +606,18 @@ object ByteString {
private[pekko] def byteStringCompanion = ByteStrings
- def isCompact: Boolean = if (bytestrings.length == 1) bytestrings.head.isCompact else false
+ def isCompact: Boolean = if bytestrings.length == 1 then bytestrings.head.isCompact else false
override def copyToBuffer(buffer: ByteBuffer): Int = {
@tailrec def copyItToTheBuffer(buffer: ByteBuffer, i: Int, written: Int): Int =
- if (i < bytestrings.length) copyItToTheBuffer(buffer, i + 1, written + bytestrings(i).writeToBuffer(buffer))
+ if i < bytestrings.length then copyItToTheBuffer(buffer, i + 1, written + bytestrings(i).writeToBuffer(buffer))
else written
copyItToTheBuffer(buffer, 0, 0)
}
def compact: CompactByteString = {
- if (isCompact) bytestrings.head.compact
+ if isCompact then bytestrings.head.compact
else {
val ar = new Array[Byte](length)
var pos = 0
@@ -650,37 +650,37 @@ object ByteString {
}
override def take(n: Int): ByteString =
- if (n <= 0) ByteString.empty
- else if (n >= length) this
+ if n <= 0 then ByteString.empty
+ else if n >= length then this
else take0(n)
private[pekko] def take0(n: Int): ByteString = {
@tailrec def go(last: Int, restToTake: Int): (Int, Int) = {
val bs = bytestrings(last)
- if (bs.length > restToTake) (last, restToTake)
+ if bs.length > restToTake then (last, restToTake)
else go(last + 1, restToTake - bs.length)
}
val (last, restToTake) = go(0, n)
- if (last == 0) bytestrings(last).take(restToTake)
- else if (restToTake == 0) new ByteStrings(bytestrings.take(last), n)
+ if last == 0 then bytestrings(last).take(restToTake)
+ else if restToTake == 0 then new ByteStrings(bytestrings.take(last), n)
else new ByteStrings(bytestrings.take(last) :+ bytestrings(last).take1(restToTake), n)
}
override def dropRight(n: Int): ByteString =
- if (0 < n && n < length) dropRight0(n)
- else if (n >= length) ByteString.empty
+ if 0 < n && n < length then dropRight0(n)
+ else if n >= length then ByteString.empty
else this
private def dropRight0(n: Int): ByteString = {
val byteStringsSize = bytestrings.length
@tailrec def dropRightWithFullDropsAndRemainig(fullDrops: Int, remainingToDrop: Int): ByteString = {
val bs = bytestrings(byteStringsSize - fullDrops - 1)
- if (bs.length > remainingToDrop) {
- if (fullDrops == byteStringsSize - 1)
+ if bs.length > remainingToDrop then {
+ if fullDrops == byteStringsSize - 1 then
bytestrings(0).dropRight(remainingToDrop)
- else if (remainingToDrop == 0)
+ else if remainingToDrop == 0 then
new ByteStrings(bytestrings.dropRight(fullDrops), length - n)
else
new ByteStrings(
@@ -696,13 +696,13 @@ object ByteString {
}
override def slice(from: Int, until: Int): ByteString =
- if (from <= 0 && until >= length) this
- else if (from > length || until <= from) ByteString.empty
+ if from <= 0 && until >= length then this
+ else if from > length || until <= from then ByteString.empty
else drop(from).dropRight(length - until)
override def drop(n: Int): ByteString =
- if (n <= 0) this
- else if (n >= length) ByteString.empty
+ if n <= 0 then this
+ else if n >= length then ByteString.empty
else drop0(n)
private def drop0(n: Int): ByteString = {
@@ -712,36 +712,36 @@ object ByteString {
// but let's not go into calling private APIs here just yet.
@tailrec def findSplit(fullDrops: Int, remainingToDrop: Int): (Int, Int) = {
val bs = bytestrings(fullDrops)
- if (bs.length > remainingToDrop) (fullDrops, remainingToDrop)
+ if bs.length > remainingToDrop then (fullDrops, remainingToDrop)
else findSplit(fullDrops + 1, remainingToDrop - bs.length)
}
val (fullDrops, remainingToDrop) = findSplit(0, n)
- if (remainingToDrop == 0)
+ if remainingToDrop == 0 then
new ByteStrings(bytestrings.drop(fullDrops), length - n)
- else if (fullDrops == bytestrings.length - 1)
+ else if fullDrops == bytestrings.length - 1 then
bytestrings(fullDrops).drop(remainingToDrop)
else
new ByteStrings(bytestrings(fullDrops).drop1(remainingToDrop) +: bytestrings.drop(fullDrops + 1), length - n)
}
override def indexOf[B >: Byte](elem: B, from: Int): Int = {
- if (from >= length) -1
+ if from >= length then -1
else {
val byteStringsSize = bytestrings.size
@tailrec
def find(bsIdx: Int, relativeIndex: Int, bytesPassed: Int): Int = {
- if (bsIdx >= byteStringsSize) -1
+ if bsIdx >= byteStringsSize then -1
else {
val bs = bytestrings(bsIdx)
- if (bs.length <= relativeIndex) {
+ if bs.length <= relativeIndex then {
find(bsIdx + 1, relativeIndex - bs.length, bytesPassed + bs.length)
} else {
val subIndexOf = bs.indexOf(elem, relativeIndex)
- if (subIndexOf < 0) {
+ if subIndexOf < 0 then {
find(bsIdx + 1, relativeIndex - bs.length, bytesPassed + bs.length)
} else subIndexOf + bytesPassed
}
@@ -753,21 +753,21 @@ object ByteString {
}
override def indexOf(elem: Byte, from: Int): Int = {
- if (from >= length) -1
+ if from >= length then -1
else {
val byteStringsSize = bytestrings.size
@tailrec
def find(bsIdx: Int, relativeIndex: Int, bytesPassed: Int): Int = {
- if (bsIdx >= byteStringsSize) -1
+ if bsIdx >= byteStringsSize then -1
else {
val bs = bytestrings(bsIdx)
- if (bs.length <= relativeIndex) {
+ if bs.length <= relativeIndex then {
find(bsIdx + 1, relativeIndex - bs.length, bytesPassed + bs.length)
} else {
val subIndexOf = bs.indexOf(elem, relativeIndex)
- if (subIndexOf < 0) {
+ if subIndexOf < 0 then {
find(bsIdx + 1, relativeIndex - bs.length, bytesPassed + bs.length)
} else subIndexOf + bytesPassed
}
@@ -779,21 +779,21 @@ object ByteString {
}
override def indexOf(elem: Byte, from: Int, to: Int): Int = {
- if (from >= length || to <= from) -1
+ if from >= length || to <= from then -1
else {
val byteStringsSize = bytestrings.size
@tailrec
def find(bsIdx: Int, relativeIndex: Int, bytesPassed: Int): Int = {
- if (bsIdx >= byteStringsSize) -1
+ if bsIdx >= byteStringsSize then -1
else {
val bs = bytestrings(bsIdx)
- if (bs.length <= relativeIndex) {
+ if bs.length <= relativeIndex then {
find(bsIdx + 1, relativeIndex - bs.length, bytesPassed + bs.length)
} else {
val subIndexOf = bs.indexOf(elem, relativeIndex, to - bytesPassed)
- if (subIndexOf < 0) {
+ if subIndexOf < 0 then {
find(bsIdx + 1, relativeIndex - bs.length, bytesPassed + bs.length)
} else subIndexOf + bytesPassed
}
@@ -805,14 +805,14 @@ object ByteString {
}
override def copyToArray[B >: Byte](dest: Array[B], start: Int, len: Int): Int = {
- if (bytestrings.size == 1) bytestrings.head.copyToArray(dest, start, len)
+ if bytestrings.size == 1 then bytestrings.head.copyToArray(dest, start, len)
else {
// min of the bytes available to copy, bytes there is room for in dest and the requested number of bytes
val totalToCopy = math.min(math.min(len, length), dest.length - start)
- if (totalToCopy > 0) {
+ if totalToCopy > 0 then {
val bsIterator = bytestrings.iterator
var copied = 0
- while (copied < totalToCopy) {
+ while copied < totalToCopy do {
val current = bsIterator.next()
copied += current.copyToArray(dest, start + copied, totalToCopy - copied)
}
@@ -971,8 +971,8 @@ sealed abstract class ByteString
var i = startPos + 1
var j = 1
// Bounds are guaranteed by the indexOf call limiting the search range, so startPos + slice.length <= length.
- while (j < slice.length) {
- if (apply(i) != slice(j)) return false
+ while j < slice.length do {
+ if apply(i) != slice(j) then return false
i += 1
j += 1
}
@@ -981,20 +981,20 @@ sealed abstract class ByteString
val headByte = slice.head.asInstanceOf[Byte]
@tailrec def rec(from: Int): Int = {
val startPos = indexOf(headByte, from, length - slice.length + 1)
- if (startPos == -1) -1
- else if (check(startPos)) startPos
+ if startPos == -1 then -1
+ else if check(startPos) then startPos
else rec(startPos + 1)
}
val sliceLength = slice.length
- if (sliceLength == 0) 0
- else if (sliceLength == 1) indexOf(headByte, from)
+ if sliceLength == 0 then 0
+ else if sliceLength == 1 then indexOf(headByte, from)
else rec(math.max(0, from))
}
override def contains[B >: Byte](elem: B): Boolean = indexOf(elem, 0) != -1
override def grouped(size: Int): Iterator[ByteString] = {
- if (size <= 0) {
+ if size <= 0 then {
throw new IllegalArgumentException(s"size=$size must be positive")
}
@@ -1003,7 +1003,7 @@ sealed abstract class ByteString
override def toString(): String = {
val maxSize = 100
- if (size > maxSize)
+ if size > maxSize then
take(maxSize).toString + s"... and [${size - maxSize}] more"
else
super.toString
@@ -1167,13 +1167,13 @@ object CompactByteString {
* Creates a new CompactByteString by copying a byte array.
*/
def apply(bytes: Array[Byte]): CompactByteString =
- if (bytes.isEmpty) empty else ByteString.ByteString1C(bytes.clone)
+ if bytes.isEmpty then empty else ByteString.ByteString1C(bytes.clone)
/**
* Creates a new CompactByteString by copying bytes.
*/
def apply(bytes: Byte*): CompactByteString = {
- if (bytes.isEmpty) empty
+ if bytes.isEmpty then empty
else {
val ar = new Array[Byte](bytes.size)
bytes.copyToArray(ar)
@@ -1186,7 +1186,7 @@ object CompactByteString {
*/
def apply(bytes: IterableOnce[Byte]): CompactByteString = {
val it = bytes.iterator
- if (it.isEmpty) empty
+ if it.isEmpty then empty
else ByteString.ByteString1C(it.toArray)
}
@@ -1194,7 +1194,7 @@ object CompactByteString {
* Creates a new CompactByteString by converting from integral numbers to bytes.
*/
def apply[T](bytes: T*)(implicit num: Integral[T]): CompactByteString = {
- if (bytes.isEmpty) empty
+ if bytes.isEmpty then empty
else ByteString.ByteString1C(bytes.iterator.map(x => num.toInt(x).toByte).to(Array))
}
@@ -1202,7 +1202,7 @@ object CompactByteString {
* Creates a new CompactByteString by copying bytes from a ByteBuffer.
*/
def apply(bytes: ByteBuffer): CompactByteString = {
- if (bytes.remaining < 1) empty
+ if bytes.remaining < 1 then empty
else {
val ar = new Array[Byte](bytes.remaining)
bytes.get(ar)
@@ -1219,13 +1219,13 @@ object CompactByteString {
* Creates a new CompactByteString by encoding a String with a charset.
*/
def apply(string: String, charset: String): CompactByteString =
- if (string.isEmpty) empty else ByteString.ByteString1C(string.getBytes(charset))
+ if string.isEmpty then empty else ByteString.ByteString1C(string.getBytes(charset))
/**
* Creates a new CompactByteString by encoding a String with a charset.
*/
def apply(string: String, charset: Charset): CompactByteString =
- if (string.isEmpty) empty else ByteString.ByteString1C(string.getBytes(charset))
+ if string.isEmpty then empty else ByteString.ByteString1C(string.getBytes(charset))
/**
* Creates a new CompactByteString by copying length bytes starting at offset from
@@ -1234,7 +1234,7 @@ object CompactByteString {
def fromArray(array: Array[Byte], offset: Int, length: Int): CompactByteString = {
val copyOffset = Math.max(offset, 0)
val copyLength = Math.max(Math.min(array.length - copyOffset, length), 0)
- if (copyLength == 0) empty
+ if copyLength == 0 then empty
else {
val copyArray = new Array[Byte](copyLength)
System.arraycopy(array, copyOffset, copyArray, 0, copyLength)
@@ -1295,7 +1295,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
}
private def clearTemp(): Unit = {
- if (_tempLength > 0) {
+ if _tempLength > 0 then {
val arr = new Array[Byte](_tempLength)
System.arraycopy(_temp, 0, arr, 0, _tempLength)
_builder += ByteString1(arr)
@@ -1305,7 +1305,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
private def resizeTemp(size: Int): Unit = {
val newtemp = new Array[Byte](size)
- if (_tempLength > 0) System.arraycopy(_temp, 0, newtemp, 0, _tempLength)
+ if _tempLength > 0 then System.arraycopy(_temp, 0, newtemp, 0, _tempLength)
_temp = newtemp
_tempCapacity = _temp.length
}
@@ -1313,9 +1313,9 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
private def shouldResizeTempFor(size: Int): Boolean = _tempCapacity < size || _tempCapacity == 0
private def ensureTempSize(size: Int): Unit = {
- if (shouldResizeTempFor(size)) {
- var newSize = if (_tempCapacity == 0) 16 else _tempCapacity * 2
- while (newSize < size) newSize *= 2
+ if shouldResizeTempFor(size) then {
+ var newSize = if _tempCapacity == 0 then 16 else _tempCapacity * 2
+ while newSize < size do newSize *= 2
resizeTemp(newSize)
}
}
@@ -1334,7 +1334,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
def ++=(bytes: ByteString): this.type = addAll(bytes)
def addAll(bytes: ByteString): this.type = {
- if (bytes.nonEmpty) {
+ if bytes.nonEmpty then {
clearTemp()
bytes match {
case b: ByteString1C =>
@@ -1355,9 +1355,9 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
xs match {
case bs: ByteString => addAll(bs)
case xs: WrappedArray.ofByte =>
- if (xs.nonEmpty) putByteArrayUnsafe(xs.array.clone)
+ if xs.nonEmpty then putByteArrayUnsafe(xs.array.clone)
case seq: collection.IndexedSeq[Byte] if shouldResizeTempFor(seq.length) =>
- if (seq.nonEmpty) {
+ if seq.nonEmpty then {
val copied = Array.from(xs)
clearTemp()
@@ -1365,7 +1365,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
_length += seq.length
}
case seq: collection.IndexedSeq[Byte] =>
- if (seq.nonEmpty) {
+ if seq.nonEmpty then {
ensureTempSize(_tempLength + seq.size)
seq.copyToArray(_temp, _tempLength)
_tempLength += seq.length
@@ -1387,7 +1387,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
/**
* Java API: append a ByteString to this builder.
*/
- def append(bs: ByteString): this.type = if (bs.isEmpty) this else this ++= bs
+ def append(bs: ByteString): this.type = if bs.isEmpty then this else this ++= bs
/**
* Add a single Byte to this builder.
@@ -1398,10 +1398,10 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
* Add a single Short to this builder.
*/
def putShort(x: Int)(implicit byteOrder: ByteOrder): this.type = {
- if (byteOrder == ByteOrder.BIG_ENDIAN) {
+ if byteOrder == ByteOrder.BIG_ENDIAN then {
this += (x >>> 8).toByte
this += (x >>> 0).toByte
- } else if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
+ } else if byteOrder == ByteOrder.LITTLE_ENDIAN then {
this += (x >>> 0).toByte
this += (x >>> 8).toByte
} else throw new IllegalArgumentException("Unknown byte order " + byteOrder)
@@ -1412,12 +1412,12 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
*/
def putInt(x: Int)(implicit byteOrder: ByteOrder): this.type = {
fillArray(4) { (target, offset) =>
- if (byteOrder == ByteOrder.BIG_ENDIAN) {
+ if byteOrder == ByteOrder.BIG_ENDIAN then {
target(offset + 0) = (x >>> 24).toByte
target(offset + 1) = (x >>> 16).toByte
target(offset + 2) = (x >>> 8).toByte
target(offset + 3) = (x >>> 0).toByte
- } else if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
+ } else if byteOrder == ByteOrder.LITTLE_ENDIAN then {
target(offset + 0) = (x >>> 0).toByte
target(offset + 1) = (x >>> 8).toByte
target(offset + 2) = (x >>> 16).toByte
@@ -1432,7 +1432,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
*/
def putLong(x: Long)(implicit byteOrder: ByteOrder): this.type = {
fillArray(8) { (target, offset) =>
- if (byteOrder == ByteOrder.BIG_ENDIAN) {
+ if byteOrder == ByteOrder.BIG_ENDIAN then {
target(offset + 0) = (x >>> 56).toByte
target(offset + 1) = (x >>> 48).toByte
target(offset + 2) = (x >>> 40).toByte
@@ -1441,7 +1441,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
target(offset + 5) = (x >>> 16).toByte
target(offset + 6) = (x >>> 8).toByte
target(offset + 7) = (x >>> 0).toByte
- } else if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
+ } else if byteOrder == ByteOrder.LITTLE_ENDIAN then {
target(offset + 0) = (x >>> 0).toByte
target(offset + 1) = (x >>> 8).toByte
target(offset + 2) = (x >>> 16).toByte
@@ -1460,12 +1460,12 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
*/
def putLongPart(x: Long, n: Int)(implicit byteOrder: ByteOrder): this.type = {
fillArray(n) { (target, offset) =>
- if (byteOrder == ByteOrder.BIG_ENDIAN) {
+ if byteOrder == ByteOrder.BIG_ENDIAN then {
val start = n * 8 - 8
(0 until n).foreach { i =>
target(offset + i) = (x >>> start - 8 * i).toByte
}
- } else if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
+ } else if byteOrder == ByteOrder.LITTLE_ENDIAN then {
(0 until n).foreach { i =>
target(offset + i) = (x >>> 8 * i).toByte
}
@@ -1564,11 +1564,11 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
}
def result(): ByteString =
- if (_length == 0) ByteString.empty
+ if _length == 0 then ByteString.empty
else {
clearTemp()
val bytestrings = _builder.result()
- if (bytestrings.size == 1)
+ if bytestrings.size == 1 then
bytestrings.head
else
ByteStrings(bytestrings, _length)
diff --git a/actor/src/main/scala-3/org/apache/pekko/util/JavaDurationConverters.scala b/actor/src/main/scala-3/org/apache/pekko/util/JavaDurationConverters.scala
index d8f941dcc3..97a1a561f7 100644
--- a/actor/src/main/scala-3/org/apache/pekko/util/JavaDurationConverters.scala
+++ b/actor/src/main/scala-3/org/apache/pekko/util/JavaDurationConverters.scala
@@ -13,7 +13,7 @@
package org.apache.pekko.util
-import java.time.{ Duration => JDuration }
+import java.time.Duration as JDuration
import scala.concurrent.duration.{ Duration, FiniteDuration }
diff --git a/actor/src/main/scala-3/org/apache/pekko/util/OptionConverters.scala b/actor/src/main/scala-3/org/apache/pekko/util/OptionConverters.scala
index 6ead358e19..262f7ac12b 100644
--- a/actor/src/main/scala-3/org/apache/pekko/util/OptionConverters.scala
+++ b/actor/src/main/scala-3/org/apache/pekko/util/OptionConverters.scala
@@ -11,7 +11,7 @@ package org.apache.pekko.util
import org.apache.pekko.annotation.InternalStableApi
-import java.util._
+import java.util.*
import scala.jdk.OptionShape
/**
diff --git a/actor/src/main/scala-jdk-9/org/apache/pekko/dispatch/PekkoJdk9ForkJoinPool.scala b/actor/src/main/scala-jdk-9/org/apache/pekko/dispatch/PekkoJdk9ForkJoinPool.scala
index 8e089d16a3..c51110731b 100644
--- a/actor/src/main/scala-jdk-9/org/apache/pekko/dispatch/PekkoJdk9ForkJoinPool.scala
+++ b/actor/src/main/scala-jdk-9/org/apache/pekko/dispatch/PekkoJdk9ForkJoinPool.scala
@@ -43,7 +43,7 @@ private[dispatch] final class PekkoJdk9ForkJoinPool(
override def execute(r: Runnable): Unit =
if (r ne null)
super.execute(
- (if (r.isInstanceOf[ForkJoinTask[_]]) r else new PekkoForkJoinTask(r)).asInstanceOf[ForkJoinTask[Any]])
+ (if (r.isInstanceOf[ForkJoinTask[?]]) r else new PekkoForkJoinTask(r)).asInstanceOf[ForkJoinTask[Any]])
else
throw new NullPointerException("Runnable was null")
diff --git a/actor/src/main/scala/org/apache/pekko/actor/AbstractProps.scala b/actor/src/main/scala/org/apache/pekko/actor/AbstractProps.scala
index bc365a8c66..8ee03a25a0 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/AbstractProps.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/AbstractProps.scala
@@ -30,7 +30,7 @@ private[pekko] trait AbstractProps {
/**
* INTERNAL API
*/
- private[pekko] def validate(clazz: Class[_]): Unit = {
+ private[pekko] def validate(clazz: Class[?]): Unit = {
if (Modifier.isAbstract(clazz.getModifiers)) {
throw new IllegalArgumentException(s"Actor class [${clazz.getName}] must not be abstract")
} else if (!classOf[Actor].isAssignableFrom(clazz) &&
@@ -44,7 +44,7 @@ private[pekko] trait AbstractProps {
* Java API: create a Props given a class and its constructor arguments.
*/
@varargs
- def create(clazz: Class[_], args: AnyRef*): Props =
+ def create(clazz: Class[?], args: AnyRef*): Props =
new Props(deploy = Props.defaultDeploy, clazz = clazz, args = args.toList)
/**
@@ -62,16 +62,16 @@ private[pekko] trait AbstractProps {
checkCreatorClosingOver(cc)
val ac = classOf[Actor]
- val coc = classOf[Creator[_]]
+ val coc = classOf[Creator[?]]
val actorClass = Reflect.findMarker(cc, coc) match {
case t: ParameterizedType =>
t.getActualTypeArguments.head match {
- case c: Class[_] => c // since T <: Actor
- case v: TypeVariable[_] =>
- v.getBounds.collectFirst { case c: Class[_] if ac.isAssignableFrom(c) && c != ac => c }.getOrElse(ac)
+ case c: Class[?] => c // since T <: Actor
+ case v: TypeVariable[?] =>
+ v.getBounds.collectFirst { case c: Class[?] if ac.isAssignableFrom(c) && c != ac => c }.getOrElse(ac)
case x => throw new IllegalArgumentException(s"unsupported type found in Creator argument [$x]")
}
- case c: Class[_] if c == coc =>
+ case c: Class[?] if c == coc =>
throw new IllegalArgumentException(
"erased Creator types (e.g. lambdas) are unsupported, use Props.create(actorClass, creator) instead")
case unexpected =>
@@ -89,10 +89,10 @@ private[pekko] trait AbstractProps {
create(classOf[CreatorConsumer], actorClass, creator)
}
- private def checkCreatorClosingOver(clazz: Class[_]): Unit = {
+ private def checkCreatorClosingOver(clazz: Class[?]): Unit = {
val enclosingClass = clazz.getEnclosingClass
- def hasDeclaredConstructorWithEmptyParams(declaredConstructors: Array[Constructor[_]]): Boolean = {
+ def hasDeclaredConstructorWithEmptyParams(declaredConstructors: Array[Constructor[?]]): Boolean = {
@tailrec def loop(i: Int): Boolean = {
if (i == declaredConstructors.length) false
else {
@@ -105,7 +105,7 @@ private[pekko] trait AbstractProps {
loop(0)
}
- def hasDeclaredConstructorWithEnclosingClassParam(declaredConstructors: Array[Constructor[_]]): Boolean = {
+ def hasDeclaredConstructorWithEnclosingClassParam(declaredConstructors: Array[Constructor[?]]): Boolean = {
@tailrec def loop(i: Int): Boolean = {
if (i == declaredConstructors.length) false
else {
diff --git a/actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala b/actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala
index f5d5b326b8..0fc72c94f9 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala
@@ -730,5 +730,5 @@ private[pekko] class ActorCell(
try system.eventStream.publish(e)
catch { case NonFatal(_) => }
- protected final def clazz(o: AnyRef): Class[_] = if (o eq null) this.getClass else o.getClass
+ protected final def clazz(o: AnyRef): Class[?] = if (o eq null) this.getClass else o.getClass
}
diff --git a/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala b/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala
index f2509559c5..a180ff1c83 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala
@@ -128,10 +128,15 @@ object ActorPath {
if (s.isEmpty) EmptyPathCode
else {
def isValidChar(c: Char): Boolean =
- (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || (ValidSymbols.indexOf(c) != -1)
+ (c >= 'a' && c <= 'z') ||
+ (c >= 'A' && c <= 'Z') ||
+ (c >= '0' && c <= '9') ||
+ (ValidSymbols.indexOf(c) != -1)
def isHexChar(c: Char): Boolean =
- (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') || (c >= '0' && c <= '9')
+ (c >= 'a' && c <= 'f') ||
+ (c >= 'A' && c <= 'F') ||
+ (c >= '0' && c <= '9')
val len = s.length
def validate(pos: Int): Int =
diff --git a/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala b/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala
index 1f10d2163b..ff7bf7b2df 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala
@@ -349,8 +349,10 @@ object ActorSystem {
val configuredLoggingFilter = config.getString(loggingFilterConfKey)
val loggingFilterAlreadyConfigured =
- configuredLoggingFilter == slf4jLoggingFilterClassName || configuredLoggingFilter != classOf[
- DefaultLoggingFilter].getName
+ configuredLoggingFilter == slf4jLoggingFilterClassName ||
+ configuredLoggingFilter !=
+ classOf[
+ DefaultLoggingFilter].getName
def newLoggingFilterConfStr = s"""$loggingFilterConfKey = "$slf4jLoggingFilterClassName""""
@@ -739,7 +741,7 @@ abstract class ActorSystem extends ActorRefFactory with ClassicActorSystemProvid
* Returns whether the specified extension is already registered, this method can potentially block, waiting for the initialization
* of the payload, if is in the process of registration from another Thread of execution
*/
- def hasExtension(ext: ExtensionId[_ <: Extension]): Boolean
+ def hasExtension(ext: ExtensionId[? <: Extension]): Boolean
}
/**
@@ -1168,7 +1170,7 @@ private[pekko] class ActorSystemImpl(
// 1) a CountDownLatch (if it's still in the process of being registered),
// 2) a Throwable (if it failed initializing), or
// 3) the registered extension.
- private val extensions = new ConcurrentHashMap[ExtensionId[_], AnyRef]
+ private val extensions = new ConcurrentHashMap[ExtensionId[?], AnyRef]
/**
* Returns any extension registered to the specified Extension or returns null if not registered
@@ -1225,7 +1227,7 @@ private[pekko] class ActorSystemImpl(
case some => some.asInstanceOf[T]
}
- def hasExtension(ext: ExtensionId[_ <: Extension]): Boolean = findExtension(ext) != null
+ def hasExtension(ext: ExtensionId[? <: Extension]): Boolean = findExtension(ext) != null
private def loadExtensions(): Unit = {
@@ -1243,7 +1245,7 @@ private[pekko] class ActorSystemImpl(
} match {
case Success(p: ExtensionIdProvider) =>
registerExtension(p.lookup)
- case Success(p: ExtensionId[_]) =>
+ case Success(p: ExtensionId[?]) =>
registerExtension(p)
case Success(_) =>
if (!throwOnLoadFail) log.error("[{}] is not an 'ExtensionIdProvider' or 'ExtensionId', skipping...", fqcn)
@@ -1278,7 +1280,8 @@ private[pekko] class ActorSystemImpl(
case real: ActorCell => " status=" + real.mailbox.currentStatus
case _ => ""
}) +
- " " + (cell.childrenRefs match {
+ " " +
+ (cell.childrenRefs match {
case ChildrenContainer.TerminatingChildrenContainer(_, toDie, reason) =>
"Terminating(" + reason + ")" +
(toDie.toSeq.sorted.mkString("\n" + indent + " | toDie: ", "\n" + indent + " | ", ""))
diff --git a/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala b/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala
index b2d09e5cf5..24ed825c1a 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala
@@ -319,7 +319,7 @@ object CoordinatedShutdown extends ExtensionId[CoordinatedShutdown] with Extensi
depends-on = []
""")
phasesConf.root.unwrapped.asScala.toMap.map {
- case (k, _: java.util.Map[_, _]) =>
+ case (k, _: java.util.Map[?, ?]) =>
val c = phasesConf.getConfig(k).withFallback(defaultPhaseConfig)
val dependsOn = c.getStringList("depends-on").asScala.toSet
val timeout = c.getDuration("timeout", MILLISECONDS).millis
diff --git a/actor/src/main/scala/org/apache/pekko/actor/Deployer.scala b/actor/src/main/scala/org/apache/pekko/actor/Deployer.scala
index c4e5c03a55..833f713201 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/Deployer.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/Deployer.scala
@@ -293,7 +293,7 @@ private[pekko] class Deployer(val settings: ActorSystem.Settings, val dynamicAcc
val fqn = routerTypeMapping.getOrElse(routerType, routerType)
- def throwCannotInstantiateRouter(args: Seq[(Class[_], AnyRef)], cause: Throwable) =
+ def throwCannotInstantiateRouter(args: Seq[(Class[?], AnyRef)], cause: Throwable) =
throw new IllegalArgumentException(
s"Cannot instantiate router [$fqn], defined in [$key], " +
s"make sure it extends [${classOf[RouterConfig]}] and has constructor with " +
diff --git a/actor/src/main/scala/org/apache/pekko/actor/DynamicAccess.scala b/actor/src/main/scala/org/apache/pekko/actor/DynamicAccess.scala
index 0797c4444b..dd89062f80 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/DynamicAccess.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/DynamicAccess.scala
@@ -40,13 +40,13 @@ import pekko.annotation.DoNotInherit
* val obj = DynamicAccess.createInstanceFor(clazz, Seq(classOf[Config] -> config, classOf[String] -> name))
* }}}
*/
- def createInstanceFor[T: ClassTag](clazz: Class[_], args: immutable.Seq[(Class[_], AnyRef)]): Try[T]
+ def createInstanceFor[T: ClassTag](clazz: Class[?], args: immutable.Seq[(Class[?], AnyRef)]): Try[T]
/**
* Obtain a `Class[_]` object loaded with the right class loader (i.e. the one
* returned by `classLoader`).
*/
- def getClassFor[T: ClassTag](fqcn: String): Try[Class[_ <: T]]
+ def getClassFor[T: ClassTag](fqcn: String): Try[Class[? <: T]]
def classIsOnClasspath(fqcn: String): Boolean
@@ -57,7 +57,7 @@ import pekko.annotation.DoNotInherit
* `args` argument. The exact usage of args depends on which type is requested,
* see the relevant requesting code for details.
*/
- def createInstanceFor[T: ClassTag](fqcn: String, args: immutable.Seq[(Class[_], AnyRef)]): Try[T]
+ def createInstanceFor[T: ClassTag](fqcn: String, args: immutable.Seq[(Class[?], AnyRef)]): Try[T]
/**
* Obtain the Scala “object” instance for the given fully-qualified class name, if there is one.
diff --git a/actor/src/main/scala/org/apache/pekko/actor/Extension.scala b/actor/src/main/scala/org/apache/pekko/actor/Extension.scala
index 00dc881af3..4c34ede55c 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/Extension.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/Extension.scala
@@ -139,5 +139,5 @@ trait ExtensionIdProvider {
/**
* Returns the canonical ExtensionId for this Extension
*/
- def lookup: ExtensionId[_ <: Extension]
+ def lookup: ExtensionId[? <: Extension]
}
diff --git a/actor/src/main/scala/org/apache/pekko/actor/FSM.scala b/actor/src/main/scala/org/apache/pekko/actor/FSM.scala
index 856629aed7..f8fb60d6d3 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/FSM.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/FSM.scala
@@ -229,13 +229,13 @@ object FSM {
def canEqual(that: Any): Boolean = {
that match {
- case _: State[_, _] => true
+ case _: State[?, ?] => true
case _ => false
}
}
override def equals(that: Any) = that match {
- case other: State[_, _] =>
+ case other: State[?, ?] =>
other.canEqual(this) &&
this.stateName == other.stateName &&
this.stateData == other.stateData &&
diff --git a/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala b/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala
index 5eab032c45..b950f9570d 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala
@@ -246,18 +246,18 @@ object SupervisorStrategy extends SupervisorStrategyLowPriorityImplicits {
* Implicit conversion from `Seq` of Throwables to a `Decider`.
* This maps the given Throwables to restarts, otherwise escalates.
*/
- implicit def seqThrowable2Decider(trapExit: immutable.Seq[Class[_ <: Throwable]]): Decider = makeDecider(trapExit)
+ implicit def seqThrowable2Decider(trapExit: immutable.Seq[Class[? <: Throwable]]): Decider = makeDecider(trapExit)
type Decider = PartialFunction[Throwable, Directive]
@nowarn("msg=deprecated")
type JDecider = pekko.japi.Function[Throwable, Directive]
- type CauseDirective = (Class[_ <: Throwable], Directive)
+ type CauseDirective = (Class[? <: Throwable], Directive)
/**
* Decider builder which just checks whether one of
* the given Throwables matches the cause and restarts, otherwise escalates.
*/
- def makeDecider(trapExit: immutable.Seq[Class[_ <: Throwable]]): Decider = {
+ def makeDecider(trapExit: immutable.Seq[Class[? <: Throwable]]): Decider = {
case x => if (trapExit.exists(_.isInstance(x))) Restart else Escalate
}
@@ -265,7 +265,7 @@ object SupervisorStrategy extends SupervisorStrategyLowPriorityImplicits {
* Decider builder which just checks whether one of
* the given Throwables matches the cause and restarts, otherwise escalates.
*/
- def makeDecider(trapExit: JIterable[Class[_ <: Throwable]]): Decider = makeDecider(immutableSeq(trapExit))
+ def makeDecider(trapExit: JIterable[Class[? <: Throwable]]): Decider = makeDecider(immutableSeq(trapExit))
/**
* Decider builder for Iterables of cause-directive pairs, e.g. a map obtained
@@ -508,13 +508,13 @@ case class AllForOneStrategy(
/**
* Java API
*/
- def this(maxNrOfRetries: Int, withinTimeRange: Duration, trapExit: JIterable[Class[_ <: Throwable]]) =
+ def this(maxNrOfRetries: Int, withinTimeRange: Duration, trapExit: JIterable[Class[? <: Throwable]]) =
this(maxNrOfRetries, withinTimeRange)(SupervisorStrategy.makeDecider(trapExit))
/**
* Java API
*/
- def this(maxNrOfRetries: Int, withinTimeRange: java.time.Duration, trapExit: JIterable[Class[_ <: Throwable]]) =
+ def this(maxNrOfRetries: Int, withinTimeRange: java.time.Duration, trapExit: JIterable[Class[? <: Throwable]]) =
this(maxNrOfRetries, withinTimeRange.asScala)(SupervisorStrategy.makeDecider(trapExit))
/**
@@ -620,13 +620,13 @@ case class OneForOneStrategy(
/**
* Java API
*/
- def this(maxNrOfRetries: Int, withinTimeRange: Duration, trapExit: JIterable[Class[_ <: Throwable]]) =
+ def this(maxNrOfRetries: Int, withinTimeRange: Duration, trapExit: JIterable[Class[? <: Throwable]]) =
this(maxNrOfRetries, withinTimeRange)(SupervisorStrategy.makeDecider(trapExit))
/**
* Java API
*/
- def this(maxNrOfRetries: Int, withinTimeRange: java.time.Duration, trapExit: JIterable[Class[_ <: Throwable]]) =
+ def this(maxNrOfRetries: Int, withinTimeRange: java.time.Duration, trapExit: JIterable[Class[? <: Throwable]]) =
this(maxNrOfRetries, withinTimeRange.asScala)(SupervisorStrategy.makeDecider(trapExit))
/**
diff --git a/actor/src/main/scala/org/apache/pekko/actor/IndirectActorProducer.scala b/actor/src/main/scala/org/apache/pekko/actor/IndirectActorProducer.scala
index 64e6949900..59b63f884a 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/IndirectActorProducer.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/IndirectActorProducer.scala
@@ -45,7 +45,7 @@ trait IndirectActorProducer {
* that the instance created for calling `actorClass` is not necessarily reused
* later to produce the actor.
*/
- def actorClass: Class[_ <: Actor]
+ def actorClass: Class[? <: Actor]
}
private[pekko] object IndirectActorProducer {
@@ -53,7 +53,7 @@ private[pekko] object IndirectActorProducer {
val CreatorConsumerClass = classOf[CreatorConsumer]
val TypedCreatorFunctionConsumerClass = classOf[TypedCreatorFunctionConsumer]
@nowarn
- def apply(clazz: Class[_], args: immutable.Seq[Any]): IndirectActorProducer = {
+ def apply(clazz: Class[?], args: immutable.Seq[Any]): IndirectActorProducer = {
if (classOf[IndirectActorProducer].isAssignableFrom(clazz)) {
def get1stArg[T]: T = args.head.asInstanceOf[T]
def get2ndArg[T]: T = args.tail.head.asInstanceOf[T]
@@ -70,8 +70,8 @@ private[pekko] object IndirectActorProducer {
Reflect.instantiate(clazz, args).asInstanceOf[IndirectActorProducer]
}
} else if (classOf[Actor].isAssignableFrom(clazz)) {
- if (args.isEmpty) new NoArgsReflectConstructor(clazz.asInstanceOf[Class[_ <: Actor]])
- else new ArgsReflectConstructor(clazz.asInstanceOf[Class[_ <: Actor]], args)
+ if (args.isEmpty) new NoArgsReflectConstructor(clazz.asInstanceOf[Class[? <: Actor]])
+ else new ArgsReflectConstructor(clazz.asInstanceOf[Class[? <: Actor]], args)
} else throw new IllegalArgumentException(s"unknown actor creator [$clazz]")
}
}
@@ -88,7 +88,7 @@ private[pekko] class CreatorFunctionConsumer(creator: () => Actor) extends Indir
* INTERNAL API
*/
@nowarn("msg=deprecated")
-private[pekko] class CreatorConsumer(clazz: Class[_ <: Actor], creator: Creator[Actor]) extends IndirectActorProducer {
+private[pekko] class CreatorConsumer(clazz: Class[? <: Actor], creator: Creator[Actor]) extends IndirectActorProducer {
override def actorClass = clazz
override def produce() = creator.create()
}
@@ -96,7 +96,7 @@ private[pekko] class CreatorConsumer(clazz: Class[_ <: Actor], creator: Creator[
/**
* INTERNAL API
*/
-private[pekko] class TypedCreatorFunctionConsumer(clz: Class[_ <: Actor], creator: () => Actor)
+private[pekko] class TypedCreatorFunctionConsumer(clz: Class[? <: Actor], creator: () => Actor)
extends IndirectActorProducer {
override def actorClass = clz
override def produce() = creator()
@@ -105,7 +105,7 @@ private[pekko] class TypedCreatorFunctionConsumer(clz: Class[_ <: Actor], creato
/**
* INTERNAL API
*/
-private[pekko] class ArgsReflectConstructor(clz: Class[_ <: Actor], args: immutable.Seq[Any])
+private[pekko] class ArgsReflectConstructor(clz: Class[? <: Actor], args: immutable.Seq[Any])
extends IndirectActorProducer {
private[this] val constructor = Reflect.findConstructor(clz, args)
override def actorClass = clz
@@ -115,7 +115,7 @@ private[pekko] class ArgsReflectConstructor(clz: Class[_ <: Actor], args: immuta
/**
* INTERNAL API
*/
-private[pekko] class NoArgsReflectConstructor(clz: Class[_ <: Actor]) extends IndirectActorProducer {
+private[pekko] class NoArgsReflectConstructor(clz: Class[? <: Actor]) extends IndirectActorProducer {
Reflect.findConstructor(clz, List.empty)
override def actorClass = clz
override def produce() = Reflect.instantiate(clz)
diff --git a/actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala b/actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala
index 2f05d48680..3cc711b511 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala
@@ -270,11 +270,12 @@ class LightArrayRevolverScheduler(config: Config, log: LoggingAdapter, threadFac
node.value.ticks match {
case 0 => node.value.executeTask()
case ticks =>
- val futureTick = ((
- time - start + // calculate the nanos since timer start
- (ticks * tickNanos) + // adding the desired delay
- tickNanos - 1 // rounding up
- ) / tickNanos).toInt // and converting to slot number
+ val futureTick =
+ ((
+ time - start + // calculate the nanos since timer start
+ (ticks * tickNanos) + // adding the desired delay
+ tickNanos - 1 // rounding up
+ ) / tickNanos).toInt // and converting to slot number
// tick is an Int that will wrap around, but toInt of futureTick gives us modulo operations
// and the difference (offset) will be correct in any case
val offset = futureTick - tick
diff --git a/actor/src/main/scala/org/apache/pekko/actor/Props.scala b/actor/src/main/scala/org/apache/pekko/actor/Props.scala
index 80637e04fe..69f2ef1f79 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/Props.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/Props.scala
@@ -87,13 +87,13 @@ object Props extends AbstractProps {
def apply[T <: Actor: ClassTag](creator: => T): Props =
mkProps(implicitly[ClassTag[T]].runtimeClass, () => creator)
- private def mkProps(classOfActor: Class[_], ctor: () => Actor): Props =
+ private def mkProps(classOfActor: Class[?], ctor: () => Actor): Props =
Props(classOf[TypedCreatorFunctionConsumer], classOfActor, ctor)
/**
* Scala API: create a Props given a class and its constructor arguments.
*/
- def apply(clazz: Class[_], args: Any*): Props = apply(defaultDeploy, clazz, args.toList)
+ def apply(clazz: Class[?], args: Any*): Props = apply(defaultDeploy, clazz, args.toList)
}
@@ -121,7 +121,7 @@ object Props extends AbstractProps {
* }}}
*/
@SerialVersionUID(2L)
-final case class Props(deploy: Deploy, clazz: Class[_], args: immutable.Seq[Any]) {
+final case class Props(deploy: Deploy, clazz: Class[?], args: immutable.Seq[Any]) {
Props.validate(clazz)
@@ -131,7 +131,7 @@ final case class Props(deploy: Deploy, clazz: Class[_], args: immutable.Seq[Any]
// derived property, does not need to be serialized
@transient
- private[this] var _cachedActorClass: Class[_ <: Actor] = _
+ private[this] var _cachedActorClass: Class[? <: Actor] = _
/**
* INTERNAL API
@@ -143,7 +143,7 @@ final case class Props(deploy: Deploy, clazz: Class[_], args: immutable.Seq[Any]
_producer
}
- private[this] def cachedActorClass: Class[_ <: Actor] = {
+ private[this] def cachedActorClass: Class[? <: Actor] = {
if (_cachedActorClass eq null)
_cachedActorClass = producer.actorClass
@@ -223,7 +223,7 @@ final case class Props(deploy: Deploy, clazz: Class[_], args: immutable.Seq[Any]
* the actor system to select special dispatchers or mailboxes in case
* dependencies are encoded in the actor type.
*/
- def actorClass(): Class[_ <: Actor] = cachedActorClass
+ def actorClass(): Class[? <: Actor] = cachedActorClass
/**
* INTERNAL API
diff --git a/actor/src/main/scala/org/apache/pekko/actor/ReflectiveDynamicAccess.scala b/actor/src/main/scala/org/apache/pekko/actor/ReflectiveDynamicAccess.scala
index 1bd02406a3..a35feafce5 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/ReflectiveDynamicAccess.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/ReflectiveDynamicAccess.scala
@@ -34,14 +34,14 @@ import pekko.annotation.DoNotInherit
@DoNotInherit
class ReflectiveDynamicAccess(val classLoader: ClassLoader) extends DynamicAccess {
- override def getClassFor[T: ClassTag](fqcn: String): Try[Class[_ <: T]] =
- Try[Class[_ <: T]] {
- val c = Class.forName(fqcn, false, classLoader).asInstanceOf[Class[_ <: T]]
+ override def getClassFor[T: ClassTag](fqcn: String): Try[Class[? <: T]] =
+ Try[Class[? <: T]] {
+ val c = Class.forName(fqcn, false, classLoader).asInstanceOf[Class[? <: T]]
val t = implicitly[ClassTag[T]].runtimeClass
if (t.isAssignableFrom(c)) c else throw new ClassCastException(t.toString + " is not assignable from " + c)
}
- override def createInstanceFor[T: ClassTag](clazz: Class[_], args: immutable.Seq[(Class[_], AnyRef)]): Try[T] =
+ override def createInstanceFor[T: ClassTag](clazz: Class[?], args: immutable.Seq[(Class[?], AnyRef)]): Try[T] =
Try {
val types = args.map(_._1).toArray
val values = args.map(_._2).toArray
@@ -53,7 +53,7 @@ class ReflectiveDynamicAccess(val classLoader: ClassLoader) extends DynamicAcces
else throw new ClassCastException(clazz.getName + " is not a subtype of " + t)
}.recover { case i: InvocationTargetException if i.getTargetException ne null => throw i.getTargetException }
- override def createInstanceFor[T: ClassTag](fqcn: String, args: immutable.Seq[(Class[_], AnyRef)]): Try[T] =
+ override def createInstanceFor[T: ClassTag](fqcn: String, args: immutable.Seq[(Class[?], AnyRef)]): Try[T] =
getClassFor(fqcn).flatMap { c =>
createInstanceFor(c, args)
}
diff --git a/actor/src/main/scala/org/apache/pekko/actor/TypedActor.scala b/actor/src/main/scala/org/apache/pekko/actor/TypedActor.scala
index 12b3009332..d540e5b83d 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/TypedActor.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/TypedActor.scala
@@ -148,9 +148,9 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
final case class MethodCall(method: Method, parameters: Array[AnyRef]) {
def isOneWay = method.getReturnType == java.lang.Void.TYPE
- def returnsFuture = classOf[Future[_]].isAssignableFrom(method.getReturnType)
- def returnsJOption = classOf[pekko.japi.Option[_]].isAssignableFrom(method.getReturnType)
- def returnsOption = classOf[scala.Option[_]].isAssignableFrom(method.getReturnType)
+ def returnsFuture = classOf[Future[?]].isAssignableFrom(method.getReturnType)
+ def returnsJOption = classOf[pekko.japi.Option[?]].isAssignableFrom(method.getReturnType)
+ def returnsOption = classOf[scala.Option[?]].isAssignableFrom(method.getReturnType)
/**
* Invokes the Method on the supplied instance
@@ -190,9 +190,9 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
* Represents the serialized form of a MethodCall, uses readResolve and writeReplace to marshall the call
*/
private[pekko] final case class SerializedMethodCall(
- ownerType: Class[_],
+ ownerType: Class[?],
methodName: String,
- parameterTypes: Array[Class[_]],
+ parameterTypes: Array[Class[?]],
serializedParameters: Array[(Int, String, Array[Byte])]) {
// TODO implement writeObject and readObject to serialize
@@ -274,7 +274,7 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
private[pekko] class TypedActor[R <: AnyRef, T <: R](
val proxyVar: AtomVar[R],
createInstance: => T,
- interfaces: immutable.Seq[Class[_]])
+ interfaces: immutable.Seq[Class[?]])
extends Actor {
self =>
// if we were remote deployed we need to create a local proxy
@@ -349,7 +349,7 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
try {
val s = sender()
m(me) match {
- case f: Future[_] if m.returnsFuture =>
+ case f: Future[?] if m.returnsFuture =>
implicit val dispatcher = this.context.dispatcher
f.onComplete {
case Success(result) =>
@@ -487,7 +487,7 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
} catch { case _: TimeoutException => None }) match {
case None | Some(Success(NullResponse)) | Some(Failure(_: AskTimeoutException)) =>
if (m.returnsJOption) JOption.none[Any] else None
- case Some(t: Try[_]) =>
+ case Some(t: Try[?]) =>
t.get.asInstanceOf[AnyRef]
}
case m =>
@@ -537,7 +537,7 @@ object TypedProps {
* @return a sequence of interfaces that the specified class implements,
* or a sequence containing only itself, if itself is an interface.
*/
- def extractInterfaces(clazz: Class[_]): immutable.Seq[Class[_]] =
+ def extractInterfaces(clazz: Class[?]): immutable.Seq[Class[?]] =
if (clazz.isInterface) immutableSingletonSeq(clazz) else immutableSeq(clazz.getInterfaces)
/**
@@ -557,7 +557,7 @@ object TypedProps {
*
* Scala API
*/
- def apply[T <: AnyRef](interface: Class[_ >: T], implementation: Class[T]): TypedProps[T] =
+ def apply[T <: AnyRef](interface: Class[? >: T], implementation: Class[T]): TypedProps[T] =
new TypedProps[T](extractInterfaces(interface), instantiator(implementation))
/**
@@ -568,7 +568,7 @@ object TypedProps {
*
* Scala API
*/
- def apply[T <: AnyRef](interface: Class[_ >: T], creator: => T): TypedProps[T] =
+ def apply[T <: AnyRef](interface: Class[? >: T], creator: => T): TypedProps[T] =
new TypedProps[T](extractInterfaces(interface), () => creator)
/**
@@ -583,7 +583,7 @@ object TypedProps {
/**
* INTERNAL API
*/
- private[pekko] def apply[T <: AnyRef](interfaces: immutable.Seq[Class[_]], creator: => T): TypedProps[T] =
+ private[pekko] def apply[T <: AnyRef](interfaces: immutable.Seq[Class[?]], creator: => T): TypedProps[T] =
new TypedProps[T](interfaces, () => creator)
}
@@ -593,7 +593,7 @@ object TypedProps {
*/
@SerialVersionUID(1L)
final case class TypedProps[T <: AnyRef] protected[TypedProps] (
- interfaces: immutable.Seq[Class[_]],
+ interfaces: immutable.Seq[Class[?]],
creator: () => T,
dispatcher: String = TypedProps.defaultDispatcherId,
deploy: Deploy = Props.defaultDeploy,
@@ -616,7 +616,7 @@ final case class TypedProps[T <: AnyRef] protected[TypedProps] (
* appended in the sequence of interfaces.
*/
@nowarn("msg=deprecated")
- def this(interface: Class[_ >: T], implementation: Creator[T]) =
+ def this(interface: Class[? >: T], implementation: Creator[T]) =
this(interfaces = TypedProps.extractInterfaces(interface), creator = implementation.create _)
/**
@@ -625,7 +625,7 @@ final case class TypedProps[T <: AnyRef] protected[TypedProps] (
* or if the interface class is not an interface, all the interfaces it implements,
* appended in the sequence of interfaces.
*/
- def this(interface: Class[_ >: T], implementation: Class[T]) =
+ def this(interface: Class[? >: T], implementation: Class[T]) =
this(interfaces = TypedProps.extractInterfaces(interface), creator = instantiator(implementation))
/**
@@ -669,14 +669,14 @@ final case class TypedProps[T <: AnyRef] protected[TypedProps] (
* or if the interface class is not an interface, all the interfaces it implements,
* appended in the sequence of interfaces.
*/
- def withInterface(interface: Class[_ >: T]): TypedProps[T] =
+ def withInterface(interface: Class[? >: T]): TypedProps[T] =
this.copy(interfaces = interfaces ++ TypedProps.extractInterfaces(interface))
/**
* Returns a new TypedProps without the specified interface,
* or if the interface class is not an interface, all the interfaces it implements.
*/
- def withoutInterface(interface: Class[_ >: T]): TypedProps[T] =
+ def withoutInterface(interface: Class[? >: T]): TypedProps[T] =
this.copy(interfaces = interfaces.diff(TypedProps.extractInterfaces(interface)))
/**
diff --git a/actor/src/main/scala/org/apache/pekko/actor/dungeon/ChildrenContainer.scala b/actor/src/main/scala/org/apache/pekko/actor/dungeon/ChildrenContainer.scala
index c433d4170d..bbba764ed9 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/dungeon/ChildrenContainer.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/dungeon/ChildrenContainer.scala
@@ -59,14 +59,14 @@ private[pekko] object ChildrenContainer {
final case class Creation() extends SuspendReason with WaitingForChildren
case object Termination extends SuspendReason
- class ChildRestartsIterable(stats: immutable.Map[_, ChildStats])
+ class ChildRestartsIterable(stats: immutable.Map[?, ChildStats])
extends PartialImmutableValuesIterable[ChildStats, ChildRestartStats] {
override final def apply(c: ChildStats) = c.asInstanceOf[ChildRestartStats]
override final def isDefinedAt(c: ChildStats) = c.isInstanceOf[ChildRestartStats]
override final def valuesIterator = stats.valuesIterator
}
- class ChildrenIterable(stats: immutable.Map[_, ChildStats])
+ class ChildrenIterable(stats: immutable.Map[?, ChildStats])
extends PartialImmutableValuesIterable[ChildStats, ActorRef] {
override final def apply(c: ChildStats) = c.asInstanceOf[ChildRestartStats].child
override final def isDefinedAt(c: ChildStats) = c.isInstanceOf[ChildRestartStats]
diff --git a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala
index 495b4a782d..d2ad8d6204 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala
@@ -92,7 +92,7 @@ private[pekko] trait Dispatch { this: ActorCell =>
// it properly in the normal way
val actorClass = props.actorClass()
val createMessage = mailboxType match {
- case _: ProducesMessageQueue[_] if system.mailboxes.hasRequiredType(actorClass) =>
+ case _: ProducesMessageQueue[?] if system.mailboxes.hasRequiredType(actorClass) =>
val req = system.mailboxes.getRequiredType(actorClass)
if (req.isInstance(mbox.messageQueue)) Create(None)
else {
diff --git a/actor/src/main/scala/org/apache/pekko/actor/setup/ActorSystemSetup.scala b/actor/src/main/scala/org/apache/pekko/actor/setup/ActorSystemSetup.scala
index db01928379..e60b0eb21c 100644
--- a/actor/src/main/scala/org/apache/pekko/actor/setup/ActorSystemSetup.scala
+++ b/actor/src/main/scala/org/apache/pekko/actor/setup/ActorSystemSetup.scala
@@ -61,7 +61,7 @@ object ActorSystemSetup {
* Constructor is *Internal API*. Use the factory methods [[ActorSystemSetup#create]] and [[ActorSystemSetup#apply]] to create
* instances.
*/
-final class ActorSystemSetup private[pekko] (@InternalApi private[pekko] val setups: Map[Class[_], AnyRef]) {
+final class ActorSystemSetup private[pekko] (@InternalApi private[pekko] val setups: Map[Class[?], AnyRef]) {
/**
* Java API: Extract a concrete [[pekko.actor.setup.Setup]] of type `T` if it is defined in the settings.
diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/CompletionStages.scala b/actor/src/main/scala/org/apache/pekko/dispatch/CompletionStages.scala
index 7479aba61c..46372090fa 100644
--- a/actor/src/main/scala/org/apache/pekko/dispatch/CompletionStages.scala
+++ b/actor/src/main/scala/org/apache/pekko/dispatch/CompletionStages.scala
@@ -49,10 +49,10 @@ object CompletionStages {
* @since 1.2.0
*/
def find[T <: AnyRef](
- stages: java.lang.Iterable[_ <: CompletionStage[_ <: T]],
+ stages: java.lang.Iterable[? <: CompletionStage[? <: T]],
predicate: pekko.japi.function.Function[T, java.lang.Boolean]
): CompletionStage[Optional[T]] = {
- def search(iterator: java.util.Iterator[_ <: CompletionStage[_ <: T]]): CompletionStage[Optional[T]] = {
+ def search(iterator: java.util.Iterator[? <: CompletionStage[? <: T]]): CompletionStage[Optional[T]] = {
if (iterator.hasNext) {
iterator.next().thenCompose { t =>
if (predicate.apply(t)) {
@@ -78,7 +78,7 @@ object CompletionStages {
* with the same value or exception.
* @since 1.2.0
*/
- def firstCompletedOf[T <: AnyRef](stages: java.lang.Iterable[_ <: CompletionStage[_ <: T]]): CompletionStage[T] = {
+ def firstCompletedOf[T <: AnyRef](stages: java.lang.Iterable[? <: CompletionStage[? <: T]]): CompletionStage[T] = {
val iterator = stages.iterator()
if (!iterator.hasNext) {
new CompletableFuture[T]() // never completes
@@ -101,7 +101,7 @@ object CompletionStages {
}
private def foldWithNext[T, R](
- iterator: java.util.Iterator[_ <: CompletionStage[_ <: T]],
+ iterator: java.util.Iterator[? <: CompletionStage[? <: T]],
previous: R,
function: pekko.japi.function.Function2[R, T, R]): CompletionStage[R] = {
if (iterator.hasNext) {
@@ -126,7 +126,7 @@ object CompletionStages {
*/
def fold[T <: AnyRef, R](
zero: R,
- stages: java.lang.Iterable[_ <: CompletionStage[_ <: T]],
+ stages: java.lang.Iterable[? <: CompletionStage[? <: T]],
function: pekko.japi.function.Function2[R, T, R]): CompletionStage[R] = {
foldWithNext[T, R](stages.iterator(), zero, function)
}
@@ -144,9 +144,9 @@ object CompletionStages {
*/
@nowarn("msg=deprecated")
def reduce[T <: AnyRef, R >: T](
- stages: java.lang.Iterable[_ <: CompletionStage[_ <: T]],
+ stages: java.lang.Iterable[? <: CompletionStage[? <: T]],
function: pekko.japi.function.Function2[R, T, R]): CompletionStage[R] = {
- val iterator: java.util.Iterator[_ <: CompletionStage[_ <: T]] = stages.iterator()
+ val iterator: java.util.Iterator[? <: CompletionStage[? <: T]] = stages.iterator()
if (iterator.hasNext) {
iterator.next().thenCompose { v => foldWithNext[T, R](iterator, v, function) }
} else {
@@ -164,7 +164,7 @@ object CompletionStages {
private def combineNext[T](
accumulate: CompletionStage[java.util.List[T]],
- next: CompletionStage[_ <: T],
+ next: CompletionStage[? <: T],
executor: Executor): CompletionStage[java.util.List[T]] = {
if (executor eq null) {
accumulate.thenCombine(next, addToListFunction())
@@ -184,7 +184,7 @@ object CompletionStages {
* @since 1.2.0
*/
def sequence[T](
- stages: java.lang.Iterable[_ <: CompletionStage[_ <: T]],
+ stages: java.lang.Iterable[? <: CompletionStage[? <: T]],
executor: Executor): CompletionStage[java.util.List[T]] = {
var result: CompletionStage[java.util.List[T]] = CompletableFuture.completedFuture(new java.util.ArrayList[T]())
val iterator = stages.iterator()
diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala b/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala
index c7d47ced32..8b335da91f 100644
--- a/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala
+++ b/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala
@@ -43,7 +43,7 @@ object ForkJoinExecutorConfigurator {
override def execute(r: Runnable): Unit =
if (r ne null)
super.execute(
- (if (r.isInstanceOf[ForkJoinTask[_]]) r else new PekkoForkJoinTask(r)).asInstanceOf[ForkJoinTask[Any]])
+ (if (r.isInstanceOf[ForkJoinTask[?]]) r else new PekkoForkJoinTask(r)).asInstanceOf[ForkJoinTask[Any]])
else
throw new NullPointerException("Runnable was null")
@@ -104,7 +104,7 @@ class ForkJoinExecutorConfigurator(config: Config, prerequisites: DispatcherPrer
parallelism: Int,
asyncMode: Boolean) = this(threadFactory, parallelism, asyncMode, ForkJoinPoolConstants.MaxCap)
- private def pekkoJdk9ForkJoinPoolClassOpt: Option[Class[_]] =
+ private def pekkoJdk9ForkJoinPoolClassOpt: Option[Class[?]] =
Try(Class.forName("org.apache.pekko.dispatch.PekkoJdk9ForkJoinPool")).toOption
private lazy val pekkoJdk9ForkJoinPoolHandleOpt: Option[MethodHandle] = {
diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala b/actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala
index f8df5240a5..8fb6bd5023 100644
--- a/actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala
+++ b/actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala
@@ -214,10 +214,10 @@ private[pekko] abstract class Mailbox(val messageQueue: MessageQueue)
protected final def systemQueuePut(_old: LatestFirstSystemMessageList, _new: LatestFirstSystemMessageList): Boolean =
(_old.head eq _new.head) ||
- // Note: calling .head is not actually existing on the bytecode level as the parameters _old and _new
- // are SystemMessage instances hidden during compile time behind the SystemMessageList value class.
- // Without calling .head the parameters would be boxed in SystemMessageList wrapper.
- Unsafe.instance.compareAndSwapObject(this, AbstractMailbox.systemMessageOffset, _old.head, _new.head): @nowarn(
+ // Note: calling .head is not actually existing on the bytecode level as the parameters _old and _new
+ // are SystemMessage instances hidden during compile time behind the SystemMessageList value class.
+ // Without calling .head the parameters would be boxed in SystemMessageList wrapper.
+ Unsafe.instance.compareAndSwapObject(this, AbstractMailbox.systemMessageOffset, _old.head, _new.head): @nowarn(
"cat=deprecation")
final def canBeScheduledForExecution(hasMessageHint: Boolean, hasSystemMessageHint: Boolean): Boolean =
diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala b/actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala
index 66fd12eb5e..1b4a35db13 100644
--- a/actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala
+++ b/actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala
@@ -73,7 +73,7 @@ private[pekko] class Mailboxes(
private val mailboxTypeConfigurators = new ConcurrentHashMap[String, MailboxType]
- private val mailboxBindings: Map[Class[_ <: Any], String] = {
+ private val mailboxBindings: Map[Class[? <: Any], String] = {
import pekko.util.ccompat.JavaConverters._
settings.config
.getConfig("pekko.actor.mailbox.requirements")
@@ -81,7 +81,7 @@ private[pekko] class Mailboxes(
.unwrapped
.asScala
.toMap
- .foldLeft(Map.empty[Class[_ <: Any], String]) {
+ .foldLeft(Map.empty[Class[? <: Any], String]) {
case (m, (k, v)) =>
dynamicAccess
.getClassFor[Any](k)
@@ -107,18 +107,18 @@ private[pekko] class Mailboxes(
/**
* Returns a mailbox type as specified in configuration, based on the type, or if not defined None.
*/
- def lookupByQueueType(queueType: Class[_ <: Any]): MailboxType = lookup(lookupId(queueType))
+ def lookupByQueueType(queueType: Class[? <: Any]): MailboxType = lookup(lookupId(queueType))
- private final val rmqClass = classOf[RequiresMessageQueue[_]]
+ private final val rmqClass = classOf[RequiresMessageQueue[?]]
/**
* Return the required message queue type for this class if any.
*/
- def getRequiredType(actorClass: Class[_ <: Actor]): Class[_] =
+ def getRequiredType(actorClass: Class[? <: Actor]): Class[?] =
Reflect.findMarker(actorClass, rmqClass) match {
case t: ParameterizedType =>
t.getActualTypeArguments.head match {
- case c: Class[_] => c
+ case c: Class[?] => c
case x =>
throw new IllegalArgumentException(s"no wildcard type allowed in RequireMessageQueue argument (was [$x])")
}
@@ -135,14 +135,14 @@ private[pekko] class Mailboxes(
case x => dynamicAccess.getClassFor[AnyRef](x).get
}
- def getProducedMessageQueueType(mailboxType: MailboxType): Class[_] = {
- val pmqClass = classOf[ProducesMessageQueue[_]]
+ def getProducedMessageQueueType(mailboxType: MailboxType): Class[?] = {
+ val pmqClass = classOf[ProducesMessageQueue[?]]
if (!pmqClass.isAssignableFrom(mailboxType.getClass)) classOf[MessageQueue]
else
Reflect.findMarker(mailboxType.getClass, pmqClass) match {
case t: ParameterizedType =>
t.getActualTypeArguments.head match {
- case c: Class[_] => c
+ case c: Class[?] => c
case x =>
throw new IllegalArgumentException(
s"no wildcard type allowed in ProducesMessageQueue argument (was [$x])")
@@ -161,7 +161,7 @@ private[pekko] class Mailboxes(
val actorClass = props.actorClass()
lazy val actorRequirement = getRequiredType(actorClass)
- val mailboxRequirement: Class[_] = getMailboxRequirement(dispatcherConfig)
+ val mailboxRequirement: Class[?] = getMailboxRequirement(dispatcherConfig)
val hasMailboxRequirement: Boolean = mailboxRequirement != classOf[MessageQueue]
@@ -180,7 +180,7 @@ private[pekko] class Mailboxes(
}
def verifyRequirements(mailboxType: MailboxType): MailboxType = {
- lazy val mqType: Class[_] = getProducedMessageQueueType(mailboxType)
+ lazy val mqType: Class[?] = getProducedMessageQueueType(mailboxType)
if (hasMailboxRequirement && !mailboxRequirement.isAssignableFrom(mqType))
throw new IllegalArgumentException(
s"produced message queue type [$mqType] does not fulfill requirement for dispatcher [$id]. " +
@@ -194,8 +194,10 @@ private[pekko] class Mailboxes(
if (deploy.mailbox != Deploy.NoMailboxGiven) {
verifyRequirements(lookup(deploy.mailbox))
- } else if (deploy.dispatcher != Deploy.NoDispatcherGiven && deploy.dispatcher != Deploy
- .DispatcherSameAsParent && hasMailboxType) {
+ } else if (deploy.dispatcher != Deploy.NoDispatcherGiven &&
+ deploy.dispatcher !=
+ Deploy
+ .DispatcherSameAsParent && hasMailboxType) {
verifyRequirements(lookup(dispatcherConfig.getString("id")))
} else if (hasRequiredType(actorClass)) {
try verifyRequirements(lookupByQueueType(getRequiredType(actorClass)))
@@ -212,9 +214,9 @@ private[pekko] class Mailboxes(
/**
* Check if this class can have a required message queue type.
*/
- def hasRequiredType(actorClass: Class[_ <: Actor]): Boolean = rmqClass.isAssignableFrom(actorClass)
+ def hasRequiredType(actorClass: Class[? <: Actor]): Boolean = rmqClass.isAssignableFrom(actorClass)
- private def lookupId(queueType: Class[_]): String =
+ private def lookupId(queueType: Class[?]): String =
mailboxBindings.get(queueType) match {
case None => throw new ConfigurationException(s"Mailbox Mapping for [$queueType] not configured")
case Some(s) => s
diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/ThreadPoolBuilder.scala b/actor/src/main/scala/org/apache/pekko/dispatch/ThreadPoolBuilder.scala
index bf6599679f..bd06df1b85 100644
--- a/actor/src/main/scala/org/apache/pekko/dispatch/ThreadPoolBuilder.scala
+++ b/actor/src/main/scala/org/apache/pekko/dispatch/ThreadPoolBuilder.scala
@@ -278,14 +278,14 @@ trait ExecutorServiceDelegate extends ExecutorService {
def submit(runnable: Runnable) = executor.submit(runnable)
- def invokeAll[T](callables: Collection[_ <: Callable[T]]) = executor.invokeAll(callables)
+ def invokeAll[T](callables: Collection[? <: Callable[T]]) = executor.invokeAll(callables)
- def invokeAll[T](callables: Collection[_ <: Callable[T]], l: Long, timeUnit: TimeUnit) =
+ def invokeAll[T](callables: Collection[? <: Callable[T]], l: Long, timeUnit: TimeUnit) =
executor.invokeAll(callables, l, timeUnit)
- def invokeAny[T](callables: Collection[_ <: Callable[T]]) = executor.invokeAny(callables)
+ def invokeAny[T](callables: Collection[? <: Callable[T]]) = executor.invokeAny(callables)
- def invokeAny[T](callables: Collection[_ <: Callable[T]], l: Long, timeUnit: TimeUnit) =
+ def invokeAny[T](callables: Collection[? <: Callable[T]], l: Long, timeUnit: TimeUnit) =
executor.invokeAny(callables, l, timeUnit)
}
diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/VirtualizedExecutorService.scala b/actor/src/main/scala/org/apache/pekko/dispatch/VirtualizedExecutorService.scala
index cefd5ab063..f9e29a37d4 100644
--- a/actor/src/main/scala/org/apache/pekko/dispatch/VirtualizedExecutorService.scala
+++ b/actor/src/main/scala/org/apache/pekko/dispatch/VirtualizedExecutorService.scala
@@ -90,24 +90,24 @@ final class VirtualizedExecutorService(
executor.submit(task, result)
}
- override def submit(task: Runnable): Future[_] = {
+ override def submit(task: Runnable): Future[?] = {
executor.submit(task)
}
- override def invokeAll[T](tasks: util.Collection[_ <: Callable[T]]): util.List[Future[T]] = {
+ override def invokeAll[T](tasks: util.Collection[? <: Callable[T]]): util.List[Future[T]] = {
executor.invokeAll(tasks)
}
override def invokeAll[T](
- tasks: util.Collection[_ <: Callable[T]], timeout: Long, unit: TimeUnit): util.List[Future[T]] = {
+ tasks: util.Collection[? <: Callable[T]], timeout: Long, unit: TimeUnit): util.List[Future[T]] = {
executor.invokeAll(tasks, timeout, unit)
}
- override def invokeAny[T](tasks: util.Collection[_ <: Callable[T]]): T = {
+ override def invokeAny[T](tasks: util.Collection[? <: Callable[T]]): T = {
executor.invokeAny(tasks)
}
- override def invokeAny[T](tasks: util.Collection[_ <: Callable[T]], timeout: Long, unit: TimeUnit): T = {
+ override def invokeAny[T](tasks: util.Collection[? <: Callable[T]], timeout: Long, unit: TimeUnit): T = {
executor.invokeAny(tasks, timeout, unit)
}
diff --git a/actor/src/main/scala/org/apache/pekko/event/EventStream.scala b/actor/src/main/scala/org/apache/pekko/event/EventStream.scala
index 90ace42e0e..5a9eff89ae 100644
--- a/actor/src/main/scala/org/apache/pekko/event/EventStream.scala
+++ b/actor/src/main/scala/org/apache/pekko/event/EventStream.scala
@@ -36,24 +36,24 @@ class EventStream(sys: ActorSystem, private val debug: Boolean) extends LoggingB
def this(sys: ActorSystem) = this(sys, debug = false)
type Event = Any
- type Classifier = Class[_]
+ type Classifier = Class[?]
/** Either the list of subscribed actors, or a ref to an [[pekko.event.EventStreamUnsubscriber]] */
private val initiallySubscribedOrUnsubscriber = new AtomicReference[Either[Set[ActorRef], ActorRef]](Left(Set.empty))
- protected implicit val subclassification: Subclassification[Classifier] = new Subclassification[Class[_]] {
- def isEqual(x: Class[_], y: Class[_]) = x == y
- def isSubclass(x: Class[_], y: Class[_]) = y.isAssignableFrom(x)
+ protected implicit val subclassification: Subclassification[Classifier] = new Subclassification[Class[?]] {
+ def isEqual(x: Class[?], y: Class[?]) = x == y
+ def isSubclass(x: Class[?], y: Class[?]) = y.isAssignableFrom(x)
}
- protected def classify(event: Any): Class[_] = event.getClass
+ protected def classify(event: Any): Class[?] = event.getClass
protected def publish(event: Any, subscriber: ActorRef) = {
if (sys == null && subscriber.isTerminated) unsubscribe(subscriber)
else subscriber ! event
}
- override def subscribe(subscriber: ActorRef, channel: Class[_]): Boolean = {
+ override def subscribe(subscriber: ActorRef, channel: Class[?]): Boolean = {
if (subscriber eq null) throw new IllegalArgumentException("subscriber is null")
if (debug)
publish(Logging.Debug(simpleName(this), this.getClass, "subscribing " + subscriber + " to channel " + channel))
@@ -61,7 +61,7 @@ class EventStream(sys: ActorSystem, private val debug: Boolean) extends LoggingB
super.subscribe(subscriber, channel)
}
- override def unsubscribe(subscriber: ActorRef, channel: Class[_]): Boolean = {
+ override def unsubscribe(subscriber: ActorRef, channel: Class[?]): Boolean = {
if (subscriber eq null) throw new IllegalArgumentException("subscriber is null")
val ret = super.unsubscribe(subscriber, channel)
unregisterIfNoMoreSubscribedChannels(subscriber)
@@ -103,7 +103,8 @@ class EventStream(sys: ActorSystem, private val debug: Boolean) extends LoggingB
Logging.Debug(
simpleName(this),
this.getClass,
- "initialized unsubscriber to: " + unsubscriber + ", registering " + subscribers
+ "initialized unsubscriber to: " + unsubscriber + ", registering " +
+ subscribers
.size + " initial subscribers with it"))
subscribers.foreach(registerWithUnsubscriber)
true
diff --git a/actor/src/main/scala/org/apache/pekko/event/Logging.scala b/actor/src/main/scala/org/apache/pekko/event/Logging.scala
index e8efd0271d..392772446f 100644
--- a/actor/src/main/scala/org/apache/pekko/event/Logging.scala
+++ b/actor/src/main/scala/org/apache/pekko/event/Logging.scala
@@ -44,7 +44,7 @@ import pekko.util.unused
trait LoggingBus extends ActorEventBus {
type Event >: Logging.LogEvent
- type Classifier >: Class[_]
+ type Classifier >: Class[?]
import Logging._
@@ -205,7 +205,7 @@ trait LoggingBus extends ActorEventBus {
*/
private def addLogger(
system: ActorSystemImpl,
- clazz: Class[_ <: Actor],
+ clazz: Class[? <: Actor],
level: LogLevel,
logName: String): ActorRef = {
val name = "log" + LogExt(system).id() + "-" + simpleName(clazz)
@@ -280,13 +280,13 @@ trait LoggingBus extends ActorEventBus {
-T] {
def genString(t: T): String
def genString(t: T, @unused system: ActorSystem): String = genString(t)
- def getClazz(t: T): Class[_] = t.getClass
+ def getClazz(t: T): Class[?] = t.getClass
}
/**
* INTERNAL API
*/
-@InternalApi private[pekko] final case class ActorWithLogClass(actor: Actor, logClass: Class[_])
+@InternalApi private[pekko] final case class ActorWithLogClass(actor: Actor, logClass: Class[?])
/**
* This is a “marker” class which is inserted as originator class into
@@ -344,14 +344,14 @@ object LogSource {
new LogSource[ActorWithLogClass] {
def genString(a: ActorWithLogClass) = fromActor.genString(a.actor)
override def genString(a: ActorWithLogClass, system: ActorSystem) = fromActor.genString(a.actor, system)
- override def getClazz(a: ActorWithLogClass): Class[_] = a.logClass
+ override def getClazz(a: ActorWithLogClass): Class[?] = a.logClass
}
// this one unfortunately does not work as implicit, because existential types have some weird behavior
- val fromClass: LogSource[Class[_]] = new LogSource[Class[_]] {
- def genString(c: Class[_]): String = Logging.simpleName(c)
- override def genString(c: Class[_], system: ActorSystem): String = genString(c) + "(" + system + ")"
- override def getClazz(c: Class[_]): Class[_] = c
+ val fromClass: LogSource[Class[?]] = new LogSource[Class[?]] {
+ def genString(c: Class[?]): String = Logging.simpleName(c)
+ override def genString(c: Class[?], system: ActorSystem): String = genString(c) + "(" + system + ")"
+ override def getClazz(c: Class[?]): Class[?] = c
}
implicit def fromAnyClass[T]: LogSource[Class[T]] = fromClass.asInstanceOf[LogSource[Class[T]]]
@@ -359,7 +359,7 @@ object LogSource {
* Convenience converter access: given an implicit `LogSource`, generate the
* string representation and originating class.
*/
- def apply[T: LogSource](o: T): (String, Class[_]) = {
+ def apply[T: LogSource](o: T): (String, Class[?]) = {
val ls = implicitly[LogSource[T]]
(ls.genString(o), ls.getClazz(o))
}
@@ -369,7 +369,7 @@ object LogSource {
* [[pekko.actor.ActorSystem]], generate the string representation and
* originating class.
*/
- def apply[T: LogSource](o: T, system: ActorSystem): (String, Class[_]) = {
+ def apply[T: LogSource](o: T, system: ActorSystem): (String, Class[?]) = {
val ls = implicitly[LogSource[T]]
(ls.genString(o, system), ls.getClazz(o))
}
@@ -378,9 +378,9 @@ object LogSource {
* construct string representation for any object according to
* rules above with fallback to its `Class`’s simple name.
*/
- def fromAnyRef(o: AnyRef): (String, Class[_]) =
+ def fromAnyRef(o: AnyRef): (String, Class[?]) =
o match {
- case c: Class[_] => apply(c)
+ case c: Class[?] => apply(c)
case a: Actor => apply(a)
case a: ActorRef => apply(a)
case s: String => apply(s)
@@ -392,9 +392,9 @@ object LogSource {
* rules above (including the actor system’s address) with fallback to its
* `Class`’s simple name.
*/
- def fromAnyRef(o: AnyRef, system: ActorSystem): (String, Class[_]) =
+ def fromAnyRef(o: AnyRef, system: ActorSystem): (String, Class[?]) =
o match {
- case c: Class[_] => apply(c)
+ case c: Class[?] => apply(c)
case a: Actor => apply(a)
case a: ActorRef => apply(a)
case s: String => apply(s)
@@ -447,7 +447,7 @@ object Logging {
* Returns a 'safe' getSimpleName for the provided Class
* @return the simple name of the given Class
*/
- def simpleName(clazz: Class[_]): String = {
+ def simpleName(clazz: Class[?]): String = {
val n = clazz.getName
val i = n.lastIndexOf('.')
n.substring(i + 1)
@@ -528,7 +528,7 @@ object Logging {
* Returns the LogLevel associated with the given event class.
* Defaults to DebugLevel.
*/
- def levelFor(eventClass: Class[_ <: LogEvent]): LogLevel = {
+ def levelFor(eventClass: Class[? <: LogEvent]): LogLevel = {
if (classOf[Error].isAssignableFrom(eventClass)) ErrorLevel
else if (classOf[Warning].isAssignableFrom(eventClass)) WarningLevel
else if (classOf[Info].isAssignableFrom(eventClass)) InfoLevel
@@ -539,7 +539,7 @@ object Logging {
/**
* Returns the event class associated with the given LogLevel
*/
- def classFor(level: LogLevel): Class[_ <: LogEvent] = level match {
+ def classFor(level: LogLevel): Class[? <: LogEvent] = level match {
case ErrorLevel => classOf[Error]
case WarningLevel => classOf[Warning]
case InfoLevel => classOf[Info]
@@ -747,7 +747,7 @@ object Logging {
/**
* The class of the source of this event
*/
- def logClass: Class[_]
+ def logClass: Class[?]
/**
* The message, may be any object or null.
@@ -769,7 +769,7 @@ object Logging {
}
object LogEvent {
- def apply(level: LogLevel, logSource: String, logClass: Class[_], message: Any): LogEvent = level match {
+ def apply(level: LogLevel, logSource: String, logClass: Class[?], message: Any): LogEvent = level match {
case ErrorLevel => Error(logSource, logClass, message)
case WarningLevel => Warning(logSource, logClass, message)
case InfoLevel => Info(logSource, logClass, message)
@@ -777,7 +777,7 @@ object Logging {
case level => throw new IllegalArgumentException(s"Unsupported log level [$level]")
}
- def apply(level: LogLevel, logSource: String, logClass: Class[_], message: Any, mdc: MDC): LogEvent = level match {
+ def apply(level: LogLevel, logSource: String, logClass: Class[?], message: Any, mdc: MDC): LogEvent = level match {
case ErrorLevel => Error(logSource, logClass, message, mdc)
case WarningLevel => Warning(logSource, logClass, message, mdc)
case InfoLevel => Info(logSource, logClass, message, mdc)
@@ -788,7 +788,7 @@ object Logging {
def apply(
level: LogLevel,
logSource: String,
- logClass: Class[_],
+ logClass: Class[?],
message: Any,
mdc: MDC,
marker: LogMarker): LogEvent = level match {
@@ -808,49 +808,49 @@ object Logging {
/**
* For ERROR Logging
*/
- case class Error(override val cause: Throwable, logSource: String, logClass: Class[_], message: Any = "")
+ case class Error(override val cause: Throwable, logSource: String, logClass: Class[?], message: Any = "")
extends LogEvent
with LogEventWithCause {
- def this(logSource: String, logClass: Class[_], message: Any) = this(Error.NoCause, logSource, logClass, message)
+ def this(logSource: String, logClass: Class[?], message: Any) = this(Error.NoCause, logSource, logClass, message)
override def level = ErrorLevel
}
class Error2(
override val cause: Throwable,
logSource: String,
- logClass: Class[_],
+ logClass: Class[?],
message: Any = "",
override val mdc: MDC)
extends Error(cause, logSource, logClass, message) {
- def this(logSource: String, logClass: Class[_], message: Any, mdc: MDC) =
+ def this(logSource: String, logClass: Class[?], message: Any, mdc: MDC) =
this(Error.NoCause, logSource, logClass, message, mdc)
}
class Error3(
override val cause: Throwable,
logSource: String,
- logClass: Class[_],
+ logClass: Class[?],
message: Any,
override val mdc: MDC,
override val marker: LogMarker)
extends Error2(cause, logSource, logClass, message, mdc)
with LogEventWithMarker {
- def this(logSource: String, logClass: Class[_], message: Any, mdc: MDC, marker: LogMarker) =
+ def this(logSource: String, logClass: Class[?], message: Any, mdc: MDC, marker: LogMarker) =
this(Error.NoCause, logSource, logClass, message, mdc, marker)
}
object Error {
- def apply(logSource: String, logClass: Class[_], message: Any) =
+ def apply(logSource: String, logClass: Class[?], message: Any) =
new Error(NoCause, logSource, logClass, message)
- def apply(logSource: String, logClass: Class[_], message: Any, marker: LogMarker) =
+ def apply(logSource: String, logClass: Class[?], message: Any, marker: LogMarker) =
new Error3(NoCause, logSource, logClass, message, Map.empty, marker)
- def apply(cause: Throwable, logSource: String, logClass: Class[_], message: Any, mdc: MDC) =
+ def apply(cause: Throwable, logSource: String, logClass: Class[?], message: Any, mdc: MDC) =
new Error2(cause, logSource, logClass, message, mdc)
- def apply(cause: Throwable, logSource: String, logClass: Class[_], message: Any, mdc: MDC, marker: LogMarker) =
+ def apply(cause: Throwable, logSource: String, logClass: Class[?], message: Any, mdc: MDC, marker: LogMarker) =
new Error3(cause, logSource, logClass, message, mdc, marker)
- def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) =
+ def apply(logSource: String, logClass: Class[?], message: Any, mdc: MDC) =
new Error2(NoCause, logSource, logClass, message, mdc)
- def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC, marker: LogMarker) =
+ def apply(logSource: String, logClass: Class[?], message: Any, mdc: MDC, marker: LogMarker) =
new Error3(NoCause, logSource, logClass, message, mdc, marker)
/** Null Object used for errors without cause Throwable */
@@ -861,14 +861,14 @@ object Logging {
/**
* For WARNING Logging
*/
- case class Warning(logSource: String, logClass: Class[_], message: Any = "") extends LogEvent {
+ case class Warning(logSource: String, logClass: Class[?], message: Any = "") extends LogEvent {
override def level = WarningLevel
}
- class Warning2(logSource: String, logClass: Class[_], message: Any, override val mdc: MDC)
+ class Warning2(logSource: String, logClass: Class[?], message: Any, override val mdc: MDC)
extends Warning(logSource, logClass, message)
class Warning3(
logSource: String,
- logClass: Class[_],
+ logClass: Class[?],
message: Any,
override val mdc: MDC,
override val marker: LogMarker)
@@ -876,7 +876,7 @@ object Logging {
with LogEventWithMarker
class Warning4(
logSource: String,
- logClass: Class[_],
+ logClass: Class[?],
message: Any,
override val mdc: MDC,
override val marker: LogMarker,
@@ -885,60 +885,60 @@ object Logging {
with LogEventWithMarker
with LogEventWithCause
object Warning {
- def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) =
+ def apply(logSource: String, logClass: Class[?], message: Any, mdc: MDC) =
new Warning2(logSource, logClass, message, mdc)
- def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC, marker: LogMarker) =
+ def apply(logSource: String, logClass: Class[?], message: Any, mdc: MDC, marker: LogMarker) =
new Warning3(logSource, logClass, message, mdc, marker)
- def apply(cause: Throwable, logSource: String, logClass: Class[_], message: Any, mdc: MDC) =
+ def apply(cause: Throwable, logSource: String, logClass: Class[?], message: Any, mdc: MDC) =
new Warning4(logSource, logClass, message, mdc, null, cause)
- def apply(cause: Throwable, logSource: String, logClass: Class[_], message: Any, mdc: MDC, marker: LogMarker) =
+ def apply(cause: Throwable, logSource: String, logClass: Class[?], message: Any, mdc: MDC, marker: LogMarker) =
new Warning4(logSource, logClass, message, mdc, marker, cause)
}
/**
* For INFO Logging
*/
- case class Info(logSource: String, logClass: Class[_], message: Any = "") extends LogEvent {
+ case class Info(logSource: String, logClass: Class[?], message: Any = "") extends LogEvent {
override def level = InfoLevel
}
- class Info2(logSource: String, logClass: Class[_], message: Any, override val mdc: MDC)
+ class Info2(logSource: String, logClass: Class[?], message: Any, override val mdc: MDC)
extends Info(logSource, logClass, message)
class Info3(
logSource: String,
- logClass: Class[_],
+ logClass: Class[?],
message: Any,
override val mdc: MDC,
override val marker: LogMarker)
extends Info2(logSource, logClass, message, mdc)
with LogEventWithMarker
object Info {
- def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) =
+ def apply(logSource: String, logClass: Class[?], message: Any, mdc: MDC) =
new Info2(logSource, logClass, message, mdc)
- def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC, marker: LogMarker) =
+ def apply(logSource: String, logClass: Class[?], message: Any, mdc: MDC, marker: LogMarker) =
new Info3(logSource, logClass, message, mdc, marker)
}
/**
* For DEBUG Logging
*/
- case class Debug(logSource: String, logClass: Class[_], message: Any = "") extends LogEvent {
+ case class Debug(logSource: String, logClass: Class[?], message: Any = "") extends LogEvent {
override def level = DebugLevel
}
- class Debug2(logSource: String, logClass: Class[_], message: Any, override val mdc: MDC)
+ class Debug2(logSource: String, logClass: Class[?], message: Any, override val mdc: MDC)
extends Debug(logSource, logClass, message)
class Debug3(
logSource: String,
- logClass: Class[_],
+ logClass: Class[?],
message: Any,
override val mdc: MDC,
override val marker: LogMarker)
extends Debug2(logSource, logClass, message, mdc)
with LogEventWithMarker
object Debug {
- def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) =
+ def apply(logSource: String, logClass: Class[?], message: Any, mdc: MDC) =
new Debug2(logSource, logClass, message, mdc)
- def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC, marker: LogMarker) =
+ def apply(logSource: String, logClass: Class[?], message: Any, mdc: MDC, marker: LogMarker) =
new Debug3(logSource, logClass, message, mdc, marker)
}
@@ -1518,8 +1518,8 @@ trait LoggingAdapter {
* there are more than four arguments.
*/
private def format1(t: String, arg: Any): String = arg match {
- case a: Array[_] if !a.getClass.getComponentType.isPrimitive => formatImpl(t, a.toSeq)
- case a: Array[_] => formatImpl(t, a.map(_.asInstanceOf[AnyRef]).toSeq)
+ case a: Array[?] if !a.getClass.getComponentType.isPrimitive => formatImpl(t, a.toSeq)
+ case a: Array[?] => formatImpl(t, a.map(_.asInstanceOf[AnyRef]).toSeq)
case x => format(t, x)
}
@@ -1559,10 +1559,10 @@ trait LoggingAdapter {
*/
trait LoggingFilter {
// for backward-compatibility reason implementation of method without marker only must work
- def isErrorEnabled(logClass: Class[_], logSource: String): Boolean
- def isWarningEnabled(logClass: Class[_], logSource: String): Boolean
- def isInfoEnabled(logClass: Class[_], logSource: String): Boolean
- def isDebugEnabled(logClass: Class[_], logSource: String): Boolean
+ def isErrorEnabled(logClass: Class[?], logSource: String): Boolean
+ def isWarningEnabled(logClass: Class[?], logSource: String): Boolean
+ def isInfoEnabled(logClass: Class[?], logSource: String): Boolean
+ def isDebugEnabled(logClass: Class[?], logSource: String): Boolean
}
/**
@@ -1571,13 +1571,13 @@ trait LoggingFilter {
*/
@nowarn("msg=never us")
trait LoggingFilterWithMarker extends LoggingFilter {
- def isErrorEnabled(logClass: Class[_], logSource: String, marker: LogMarker): Boolean =
+ def isErrorEnabled(logClass: Class[?], logSource: String, marker: LogMarker): Boolean =
isErrorEnabled(logClass, logSource)
- def isWarningEnabled(logClass: Class[_], logSource: String, marker: LogMarker): Boolean =
+ def isWarningEnabled(logClass: Class[?], logSource: String, marker: LogMarker): Boolean =
isWarningEnabled(logClass, logSource)
- def isInfoEnabled(logClass: Class[_], logSource: String, marker: LogMarker): Boolean =
+ def isInfoEnabled(logClass: Class[?], logSource: String, marker: LogMarker): Boolean =
isInfoEnabled(logClass, logSource)
- def isDebugEnabled(logClass: Class[_], logSource: String, marker: LogMarker): Boolean =
+ def isDebugEnabled(logClass: Class[?], logSource: String, marker: LogMarker): Boolean =
isDebugEnabled(logClass, logSource)
}
@@ -1590,13 +1590,13 @@ object LoggingFilterWithMarker {
}
class LoggingFilterWithMarkerWrapper(loggingFilter: LoggingFilter) extends LoggingFilterWithMarker {
- override def isErrorEnabled(logClass: Class[_], logSource: String): Boolean =
+ override def isErrorEnabled(logClass: Class[?], logSource: String): Boolean =
loggingFilter.isErrorEnabled(logClass, logSource)
- override def isWarningEnabled(logClass: Class[_], logSource: String): Boolean =
+ override def isWarningEnabled(logClass: Class[?], logSource: String): Boolean =
loggingFilter.isWarningEnabled(logClass, logSource)
- override def isInfoEnabled(logClass: Class[_], logSource: String): Boolean =
+ override def isInfoEnabled(logClass: Class[?], logSource: String): Boolean =
loggingFilter.isInfoEnabled(logClass, logSource)
- override def isDebugEnabled(logClass: Class[_], logSource: String): Boolean =
+ override def isDebugEnabled(logClass: Class[?], logSource: String): Boolean =
loggingFilter.isDebugEnabled(logClass, logSource)
}
@@ -1610,10 +1610,10 @@ class DefaultLoggingFilter(logLevel: () => Logging.LogLevel) extends LoggingFilt
def this(settings: Settings, eventStream: EventStream) = this(() => eventStream.logLevel)
import Logging._
- def isErrorEnabled(logClass: Class[_], logSource: String) = logLevel() >= ErrorLevel
- def isWarningEnabled(logClass: Class[_], logSource: String) = logLevel() >= WarningLevel
- def isInfoEnabled(logClass: Class[_], logSource: String) = logLevel() >= InfoLevel
- def isDebugEnabled(logClass: Class[_], logSource: String) = logLevel() >= DebugLevel
+ def isErrorEnabled(logClass: Class[?], logSource: String) = logLevel() >= ErrorLevel
+ def isWarningEnabled(logClass: Class[?], logSource: String) = logLevel() >= WarningLevel
+ def isInfoEnabled(logClass: Class[?], logSource: String) = logLevel() >= InfoLevel
+ def isDebugEnabled(logClass: Class[?], logSource: String) = logLevel() >= DebugLevel
}
/**
@@ -1742,14 +1742,14 @@ object LogMarker {
class MarkerLoggingAdapter(
override val bus: LoggingBus,
override val logSource: String,
- override val logClass: Class[_],
+ override val logClass: Class[?],
loggingFilter: LoggingFilter)
extends BusLogging(bus, logSource, logClass, loggingFilter) {
// TODO when breaking binary compatibility, these marker methods should become baked into LoggingAdapter itself
// For backwards compatibility, and when LoggingAdapter is created without direct
// association to an ActorSystem
- def this(bus: LoggingBus, logSource: String, logClass: Class[_]) =
+ def this(bus: LoggingBus, logSource: String, logClass: Class[?]) =
this(bus, logSource, logClass, new DefaultLoggingFilter(() => bus.logLevel))
val loggingFilterWithMarker: LoggingFilterWithMarker = LoggingFilterWithMarker.wrap(loggingFilter)
@@ -1997,8 +1997,8 @@ class MarkerLoggingAdapter(
// Copy of LoggingAdapter.format1 due to binary compatibility restrictions
private def format1(t: String, arg: Any): String = arg match {
- case a: Array[_] if !a.getClass.getComponentType.isPrimitive => format(t, a.toIndexedSeq)
- case a: Array[_] => format(t, a.map(_.asInstanceOf[AnyRef]).toIndexedSeq)
+ case a: Array[?] if !a.getClass.getComponentType.isPrimitive => format(t, a.toIndexedSeq)
+ case a: Array[?] => format(t, a.map(_.asInstanceOf[AnyRef]).toIndexedSeq)
case x => format(t, x)
}
}
@@ -2006,7 +2006,7 @@ class MarkerLoggingAdapter(
final class DiagnosticMarkerBusLoggingAdapter(
override val bus: LoggingBus,
override val logSource: String,
- override val logClass: Class[_],
+ override val logClass: Class[?],
loggingFilter: LoggingFilter)
extends MarkerLoggingAdapter(bus, logSource, logClass, loggingFilter)
with DiagnosticLoggingAdapter
@@ -2014,12 +2014,12 @@ final class DiagnosticMarkerBusLoggingAdapter(
/**
* [[pekko.event.LoggingAdapter]] that publishes [[pekko.event.Logging.LogEvent]] to event stream.
*/
-class BusLogging(val bus: LoggingBus, val logSource: String, val logClass: Class[_], loggingFilter: LoggingFilter)
+class BusLogging(val bus: LoggingBus, val logSource: String, val logClass: Class[?], loggingFilter: LoggingFilter)
extends LoggingAdapter {
// For backwards compatibility, and when LoggingAdapter is created without direct
// association to an ActorSystem
- def this(bus: LoggingBus, logSource: String, logClass: Class[_]) =
+ def this(bus: LoggingBus, logSource: String, logClass: Class[?]) =
this(bus, logSource, logClass, new DefaultLoggingFilter(() => bus.logLevel))
import Logging._
diff --git a/actor/src/main/scala/org/apache/pekko/event/LoggingReceive.scala b/actor/src/main/scala/org/apache/pekko/event/LoggingReceive.scala
index 2cddd32b1e..95a8f87119 100644
--- a/actor/src/main/scala/org/apache/pekko/event/LoggingReceive.scala
+++ b/actor/src/main/scala/org/apache/pekko/event/LoggingReceive.scala
@@ -89,8 +89,9 @@ class LoggingReceive(source: Option[AnyRef], r: Receive, label: Option[String],
if (context.system.eventStream.logLevel >= logLevel) {
val src = source.getOrElse(context.asInstanceOf[ActorCell].actor)
val (str, clazz) = LogSource.fromAnyRef(src)
- val message = "received " + (if (handled) "handled" else "unhandled") + " message " + o + " from " + context
- .sender() +
+ val message = "received " + (if (handled) "handled" else "unhandled") + " message " + o + " from " +
+ context
+ .sender() +
(label match {
case Some(l) => " in state " + l
case _ => ""
diff --git a/actor/src/main/scala/org/apache/pekko/event/jul/JavaLogger.scala b/actor/src/main/scala/org/apache/pekko/event/jul/JavaLogger.scala
index a89a26c234..b7e0a243ae 100644
--- a/actor/src/main/scala/org/apache/pekko/event/jul/JavaLogger.scala
+++ b/actor/src/main/scala/org/apache/pekko/event/jul/JavaLogger.scala
@@ -82,7 +82,7 @@ object Logger {
* @param logSource - the textual representation of the source of this log stream
* @return a Logger for the specified parameters
*/
- def apply(logClass: Class[_], logSource: String): logging.Logger = logClass match {
+ def apply(logClass: Class[?], logSource: String): logging.Logger = logClass match {
case c if c == classOf[DummyClassForStringSources] => apply(logSource)
case _ => logging.Logger.getLogger(logClass.getName)
}
@@ -110,12 +110,12 @@ object Logger {
class JavaLoggingFilter(@unused settings: ActorSystem.Settings, eventStream: EventStream) extends LoggingFilter {
import Logger.mapLevel
- def isErrorEnabled(logClass: Class[_], logSource: String) =
+ def isErrorEnabled(logClass: Class[?], logSource: String) =
(eventStream.logLevel >= ErrorLevel) && Logger(logClass, logSource).isLoggable(mapLevel(ErrorLevel))
- def isWarningEnabled(logClass: Class[_], logSource: String) =
+ def isWarningEnabled(logClass: Class[?], logSource: String) =
(eventStream.logLevel >= WarningLevel) && Logger(logClass, logSource).isLoggable(mapLevel(WarningLevel))
- def isInfoEnabled(logClass: Class[_], logSource: String) =
+ def isInfoEnabled(logClass: Class[?], logSource: String) =
(eventStream.logLevel >= InfoLevel) && Logger(logClass, logSource).isLoggable(mapLevel(InfoLevel))
- def isDebugEnabled(logClass: Class[_], logSource: String) =
+ def isDebugEnabled(logClass: Class[?], logSource: String) =
(eventStream.logLevel >= DebugLevel) && Logger(logClass, logSource).isLoggable(mapLevel(DebugLevel))
}
diff --git a/actor/src/main/scala/org/apache/pekko/io/DnsProvider.scala b/actor/src/main/scala/org/apache/pekko/io/DnsProvider.scala
index 297f8e936c..acbafa5474 100644
--- a/actor/src/main/scala/org/apache/pekko/io/DnsProvider.scala
+++ b/actor/src/main/scala/org/apache/pekko/io/DnsProvider.scala
@@ -36,12 +36,12 @@ trait DnsProvider {
* DNS resolver actor. Should respond to [[pekko.io.dns.DnsProtocol.Resolve]] with
* [[pekko.io.dns.DnsProtocol.Resolved]]
*/
- def actorClass: Class[_ <: Actor]
+ def actorClass: Class[? <: Actor]
/**
* DNS manager class. Is responsible for creating resolvers and doing any cache cleanup.
* The DNS extension will create one of these Actors. It should have a ctr that accepts
* a [[DnsExt]]
*/
- def managerClass: Class[_ <: Actor]
+ def managerClass: Class[? <: Actor]
}
diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/internal/TcpDnsClient.scala b/actor/src/main/scala/org/apache/pekko/io/dns/internal/TcpDnsClient.scala
index 07fa1ad948..ebd5b77e33 100644
--- a/actor/src/main/scala/org/apache/pekko/io/dns/internal/TcpDnsClient.scala
+++ b/actor/src/main/scala/org/apache/pekko/io/dns/internal/TcpDnsClient.scala
@@ -101,8 +101,7 @@ private[internal] object TcpDnsClient {
def encodeLength(length: Int): ByteString =
ByteString((length / 256).toByte, length.toByte)
- def decodeLength(data: ByteString): Int =
- ((data(0).toInt + 256) % 256) * 256 + ((data(1) + 256) % 256)
+ def decodeLength(data: ByteString): Int = ((data(0).toInt + 256) % 256) * 256 + ((data(1) + 256) % 256)
def throwFailure(message: String, cause: Option[Throwable]): Unit =
cause match {
diff --git a/actor/src/main/scala/org/apache/pekko/japi/JavaAPI.scala b/actor/src/main/scala/org/apache/pekko/japi/JavaAPI.scala
index 65fa6757a7..787fb638c5 100644
--- a/actor/src/main/scala/org/apache/pekko/japi/JavaAPI.scala
+++ b/actor/src/main/scala/org/apache/pekko/japi/JavaAPI.scala
@@ -263,7 +263,7 @@ object Util {
* Returns an immutable.Seq representing the provided array of Classes,
* an overloading of the generic immutableSeq in Util, to accommodate for erasure.
*/
- def immutableSeq(arr: Array[Class[_]]): immutable.Seq[Class[_]] = immutableSeq[Class[_]](arr)
+ def immutableSeq(arr: Array[Class[?]]): immutable.Seq[Class[?]] = immutableSeq[Class[?]](arr)
/**
* Turns an array into an immutable Scala sequence (by copying it).
@@ -276,7 +276,7 @@ object Util {
*/
def immutableSeq[T](iterable: java.lang.Iterable[T]): immutable.Seq[T] =
iterable match {
- case imm: immutable.Seq[_] => imm.asInstanceOf[immutable.Seq[T]]
+ case imm: immutable.Seq[?] => imm.asInstanceOf[immutable.Seq[T]]
case other =>
val i = other.iterator()
if (i.hasNext) {
diff --git a/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala b/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala
index 00dcbeb260..ad1ab751ee 100644
--- a/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala
+++ b/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala
@@ -800,13 +800,14 @@ class CircuitBreaker(
}
private def isIgnoredException(ex: Any): Boolean =
- allowExceptions.nonEmpty && (ex match {
+ allowExceptions.nonEmpty &&
+ (ex match {
case ce: CompletionException => ce.getCause != null && allowExceptions.contains(ce.getCause.getClass.getName)
case _ => allowExceptions.contains(ex.getClass.getName)
})
- private val failureFn: Try[_] => Boolean = {
- case _: Success[_] => false
+ private val failureFn: Try[?] => Boolean = {
+ case _: Success[?] => false
case Failure(t) if isIgnoredException(t) => false
case _ => true
}
@@ -865,7 +866,7 @@ class CircuitBreaker(
val f = materialize(body)
f.onComplete {
- case _: Success[_] =>
+ case _: Success[?] =>
notifyCallSuccessListeners(start)
callSucceeds()
case Failure(_) =>
diff --git a/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreakersRegistry.scala b/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreakersRegistry.scala
index ca4ba22045..20c8f1a514 100644
--- a/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreakersRegistry.scala
+++ b/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreakersRegistry.scala
@@ -42,7 +42,7 @@ object CircuitBreakersRegistry extends ExtensionId[CircuitBreakersRegistry] with
/**
* Returns the canonical ExtensionId for this Extension
*/
- override def lookup: ExtensionId[_ <: Extension] = CircuitBreakersRegistry
+ override def lookup: ExtensionId[? <: Extension] = CircuitBreakersRegistry
/**
* Returns an instance of the extension identified by this ExtensionId instance.
diff --git a/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala b/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala
index f4511eba27..6bcc7b7b7b 100644
--- a/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala
+++ b/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala
@@ -56,7 +56,7 @@ final class StatusReply[+T] private (private val status: Try[T]) {
def isSuccess: Boolean = status.isSuccess
override def equals(other: Any): Boolean = other match {
- case that: StatusReply[_] => status == that.status
+ case that: StatusReply[?] => status == that.status
case _ => false
}
@@ -161,7 +161,7 @@ object StatusReply {
* Also note that Pekko does not contain pre-build serializers for arbitrary exceptions.
*/
def apply[T](exception: Throwable): StatusReply[T] = new StatusReply(ScalaFailure(exception))
- def unapply(status: StatusReply[_]): Option[Throwable] =
+ def unapply(status: StatusReply[?]): Option[Throwable] =
if (status != null && status.isError) Some(status.getError)
else None
}
diff --git a/actor/src/main/scala/org/apache/pekko/routing/ConsistentHash.scala b/actor/src/main/scala/org/apache/pekko/routing/ConsistentHash.scala
index 83540ea236..f91ccf494c 100644
--- a/actor/src/main/scala/org/apache/pekko/routing/ConsistentHash.scala
+++ b/actor/src/main/scala/org/apache/pekko/routing/ConsistentHash.scala
@@ -48,7 +48,8 @@ class ConsistentHash[T: ClassTag] private (nodes: immutable.SortedMap[Int, T], v
*/
def :+(node: T): ConsistentHash[T] = {
val nodeHash = hashFor(node.toString)
- new ConsistentHash(nodes ++ ((1 to virtualNodesFactor).map { r =>
+ new ConsistentHash(nodes ++
+ ((1 to virtualNodesFactor).map { r =>
concatenateNodeHash(nodeHash, r) -> node
}), virtualNodesFactor)
}
@@ -67,7 +68,8 @@ class ConsistentHash[T: ClassTag] private (nodes: immutable.SortedMap[Int, T], v
*/
def :-(node: T): ConsistentHash[T] = {
val nodeHash = hashFor(node.toString)
- new ConsistentHash(nodes -- ((1 to virtualNodesFactor).map { r =>
+ new ConsistentHash(nodes --
+ ((1 to virtualNodesFactor).map { r =>
concatenateNodeHash(nodeHash, r)
}), virtualNodesFactor)
}
diff --git a/actor/src/main/scala/org/apache/pekko/serialization/PrimitiveSerializers.scala b/actor/src/main/scala/org/apache/pekko/serialization/PrimitiveSerializers.scala
index e256893779..224046002e 100644
--- a/actor/src/main/scala/org/apache/pekko/serialization/PrimitiveSerializers.scala
+++ b/actor/src/main/scala/org/apache/pekko/serialization/PrimitiveSerializers.scala
@@ -51,7 +51,7 @@ import pekko.util.ByteString
result
}
- override def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef = {
+ override def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef = {
var result = 0L
var i = 7
while (i >= 0) {
@@ -89,7 +89,7 @@ import pekko.util.ByteString
result
}
- override def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef = {
+ override def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef = {
var result = 0
var i = 3
while (i >= 0) {
@@ -121,7 +121,7 @@ import pekko.util.ByteString
override def toBinary(o: AnyRef): Array[Byte] = o.asInstanceOf[String].getBytes(StandardCharsets.UTF_8)
- override def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef =
+ override def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef =
new String(bytes, StandardCharsets.UTF_8)
}
@@ -154,7 +154,7 @@ import pekko.util.ByteString
result
}
- override def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef = {
+ override def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef = {
ByteString(bytes)
}
@@ -204,7 +204,7 @@ import pekko.util.ByteString
result
}
- override def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef = {
+ override def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef = {
bytes(0) match {
case TrueB => TRUE
case FalseB => FALSE
diff --git a/actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala b/actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala
index b823597437..d4a8b87e85 100644
--- a/actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala
+++ b/actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala
@@ -41,7 +41,7 @@ object Serialization {
/**
* Tuple that represents mapping from Class to Serializer
*/
- type ClassSerializer = (Class[_], Serializer)
+ type ClassSerializer = (Class[?], Serializer)
/**
* INTERNAL API: This holds a reference to the current transport serialization information used for
@@ -154,7 +154,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
private[this] val _log = Logging.withMarker(system, getClass.getName)
val log: LoggingAdapter = _log
- private val manifestCache = new AtomicReference[Map[String, Option[Class[_]]]](Map.empty[String, Option[Class[_]]])
+ private val manifestCache = new AtomicReference[Map[String, Option[Class[?]]]](Map.empty[String, Option[Class[?]]])
/** INTERNAL API */
@InternalApi private[pekko] def serializationInformation: Serialization.Information =
@@ -185,7 +185,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
* Returns either the resulting object or an Exception if one was thrown.
*/
@deprecated("Use deserialize that accepts the `manifest` as a class name.", since = "Akka 2.6.0")
- def deserialize[T](bytes: Array[Byte], serializerId: Int, clazz: Option[Class[_ <: T]]): Try[T] =
+ def deserialize[T](bytes: Array[Byte], serializerId: Int, clazz: Option[Class[? <: T]]): Try[T] =
Try {
val serializer =
try getSerializerById(serializerId)
@@ -221,7 +221,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
private def deserializeByteArray(bytes: Array[Byte], serializer: Serializer, manifest: String): AnyRef = {
- @tailrec def updateCache(cache: Map[String, Option[Class[_]]], key: String, value: Option[Class[_]]): Boolean = {
+ @tailrec def updateCache(cache: Map[String, Option[Class[?]]], key: String, value: Option[Class[?]]): Boolean = {
manifestCache.compareAndSet(cache, cache.updated(key, value)) ||
updateCache(manifestCache.get, key, value) // recursive, try again
}
@@ -239,7 +239,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
case None =>
system.dynamicAccess.getClassFor[AnyRef](manifest) match {
case Success(classManifest) =>
- val classManifestOption: Option[Class[_]] = Some(classManifest)
+ val classManifestOption: Option[Class[?]] = Some(classManifest)
updateCache(cache, manifest, classManifestOption)
s1.fromBinary(bytes, classManifestOption)
case Failure(_) =>
@@ -315,10 +315,10 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
* Throws java.io.NotSerializableException if no `serialization-bindings` is configured for the class.
*/
@throws(classOf[NotSerializableException])
- def serializerFor(clazz: Class[_]): Serializer =
+ def serializerFor(clazz: Class[?]): Serializer =
serializerMap.get(clazz) match {
case null => // bindings are ordered from most specific to least specific
- def unique(possibilities: immutable.Seq[(Class[_], Serializer)]): Boolean =
+ def unique(possibilities: immutable.Seq[(Class[?], Serializer)]): Boolean =
possibilities.size == 1 || {
val possibility = possibilities.head
possibilities.forall(_._1.isAssignableFrom(possibility._1)) ||
@@ -469,7 +469,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
}
}
- private def warnUnexpectedNonPekkoSerializer(clazz: Class[_], ser: Serializer): Boolean = {
+ private def warnUnexpectedNonPekkoSerializer(clazz: Class[?], ser: Serializer): Boolean = {
val clazzName = clazz.getName
if (clazzName.startsWith(PekkoPackagePrefix) && !ser.getClass.getName.startsWith(PekkoPackagePrefix)) {
log.warning(
@@ -510,8 +510,8 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
* serializerMap is a Map whose keys is the class that is serializable and values is the serializer
* to be used for that class.
*/
- private val serializerMap: ConcurrentHashMap[Class[_], Serializer] =
- bindings.foldLeft(new ConcurrentHashMap[Class[_], Serializer]) { case (map, (c, s)) => map.put(c, s); map }
+ private val serializerMap: ConcurrentHashMap[Class[?], Serializer] =
+ bindings.foldLeft(new ConcurrentHashMap[Class[?], Serializer]) { case (map, (c, s)) => map.put(c, s); map }
/**
* Maps from a Serializer Identity (Int) to a Serializer instance (optimization)
@@ -569,9 +569,9 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
/**
* INTERNAL API
*/
- @InternalApi private[pekko] def shouldWarnAboutJavaSerializer(serializedClass: Class[_], serializer: Serializer) = {
+ @InternalApi private[pekko] def shouldWarnAboutJavaSerializer(serializedClass: Class[?], serializer: Serializer) = {
- def suppressWarningOnNonSerializationVerification(serializedClass: Class[_]) = {
+ def suppressWarningOnNonSerializationVerification(serializedClass: Class[?]) = {
// suppressed, only when warn-on-no-serialization-verification = off, and extending NoSerializationVerificationNeeded
!isWarningOnNoVerificationEnabled && classOf[NoSerializationVerificationNeeded].isAssignableFrom(serializedClass)
}
diff --git a/actor/src/main/scala/org/apache/pekko/serialization/SerializationSetup.scala b/actor/src/main/scala/org/apache/pekko/serialization/SerializationSetup.scala
index 9da04fb11c..6f5b2d7ee4 100644
--- a/actor/src/main/scala/org/apache/pekko/serialization/SerializationSetup.scala
+++ b/actor/src/main/scala/org/apache/pekko/serialization/SerializationSetup.scala
@@ -57,7 +57,7 @@ object SerializerDetails {
* @param useFor A set of classes or superclasses to bind to the serializer, selection works just as if
* the classes, the alias and the serializer had been in the config.
*/
- def apply(alias: String, serializer: Serializer, useFor: immutable.Seq[Class[_]]): SerializerDetails =
+ def apply(alias: String, serializer: Serializer, useFor: immutable.Seq[Class[?]]): SerializerDetails =
new SerializerDetails(alias, serializer, useFor)
/**
@@ -67,7 +67,7 @@ object SerializerDetails {
* @param useFor A set of classes or superclasses to bind to the serializer, selection works just as if
* the classes, the alias and the serializer had been in the config.
*/
- def create(alias: String, serializer: Serializer, useFor: java.util.List[Class[_]]): SerializerDetails =
+ def create(alias: String, serializer: Serializer, useFor: java.util.List[Class[?]]): SerializerDetails =
apply(alias, serializer, useFor.asScala.toVector)
}
@@ -79,4 +79,4 @@ object SerializerDetails {
final class SerializerDetails private (
val alias: String,
val serializer: Serializer,
- val useFor: immutable.Seq[Class[_]])
+ val useFor: immutable.Seq[Class[?]])
diff --git a/actor/src/main/scala/org/apache/pekko/serialization/Serializer.scala b/actor/src/main/scala/org/apache/pekko/serialization/Serializer.scala
index 1e3a06f5f6..d001eea1ae 100644
--- a/actor/src/main/scala/org/apache/pekko/serialization/Serializer.scala
+++ b/actor/src/main/scala/org/apache/pekko/serialization/Serializer.scala
@@ -74,7 +74,7 @@ trait Serializer {
* the class should be loaded using ActorSystem.dynamicAccess.
*/
@throws(classOf[NotSerializableException])
- def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef
+ def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef
/**
* Java API: deserialize without type hint
@@ -85,7 +85,7 @@ trait Serializer {
* Java API: deserialize with type hint
*/
@throws(classOf[NotSerializableException])
- final def fromBinary(bytes: Array[Byte], clazz: Class[_]): AnyRef = fromBinary(bytes, Option(clazz))
+ final def fromBinary(bytes: Array[Byte], clazz: Class[?]): AnyRef = fromBinary(bytes, Option(clazz))
}
object Serializers {
@@ -163,7 +163,7 @@ abstract class SerializerWithStringManifest extends Serializer {
@throws(classOf[NotSerializableException])
def fromBinary(bytes: Array[Byte], manifest: String): AnyRef
- final def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef = {
+ final def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef = {
val manifestString = manifest match {
case Some(c) => c.getName
case None => ""
@@ -274,7 +274,7 @@ object BaseSerializer {
/** INTERNAL API */
@InternalApi
- private[pekko] def identifierFromConfig(clazz: Class[_], system: ExtendedActorSystem): Int =
+ private[pekko] def identifierFromConfig(clazz: Class[?], system: ExtendedActorSystem): Int =
system.settings.config.getInt(s"""$SerializationIdentifiers."${clazz.getName}"""")
/** INTERNAL API */
@@ -292,13 +292,13 @@ object BaseSerializer {
abstract class JSerializer extends Serializer {
@throws(classOf[NotSerializableException])
- final def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef =
+ final def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef =
fromBinaryJava(bytes, manifest.orNull)
/**
* This method must be implemented, manifest may be null.
*/
- protected def fromBinaryJava(bytes: Array[Byte], manifest: Class[_]): AnyRef
+ protected def fromBinaryJava(bytes: Array[Byte], manifest: Class[?]): AnyRef
}
object NullSerializer extends NullSerializer
@@ -353,7 +353,7 @@ class JavaSerializer(val system: ExtendedActorSystem) extends BaseSerializer {
}
@throws(classOf[NotSerializableException])
- def fromBinary(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = {
+ def fromBinary(bytes: Array[Byte], clazz: Option[Class[?]]): AnyRef = {
val in =
new ClassLoaderObjectInputStream(system.dynamicAccess.classLoader, new UnsynchronizedByteArrayInputStream(bytes))
try JavaSerializer.currentSystem.withValue(system) { in.readObject }
@@ -386,7 +386,7 @@ final case class DisabledJavaSerializer(system: ExtendedActorSystem) extends Ser
}
@throws(classOf[NotSerializableException])
- override def fromBinary(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = {
+ override def fromBinary(bytes: Array[Byte], clazz: Option[Class[?]]): AnyRef = {
log.warning(
LogMarker.Security,
"Incoming message attempted to use Java Serialization even though `pekko.actor.allow-java-serialization = off` was set!")
@@ -426,7 +426,7 @@ class NullSerializer extends Serializer {
def identifier = 0
def toBinary(o: AnyRef): Array[Byte] = nullAsBytes
@throws(classOf[NotSerializableException])
- def fromBinary(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = null
+ def fromBinary(bytes: Array[Byte], clazz: Option[Class[?]]): AnyRef = null
}
/**
@@ -445,7 +445,7 @@ class ByteArraySerializer(val system: ExtendedActorSystem) extends BaseSerialize
}
@throws(classOf[NotSerializableException])
- def fromBinary(bytes: Array[Byte], clazz: Option[Class[_]]): AnyRef = bytes
+ def fromBinary(bytes: Array[Byte], clazz: Option[Class[?]]): AnyRef = bytes
override def toBinary(o: AnyRef, buf: ByteBuffer): Unit =
o match {
diff --git a/actor/src/main/scala/org/apache/pekko/util/BoundedBlockingQueue.scala b/actor/src/main/scala/org/apache/pekko/util/BoundedBlockingQueue.scala
index e6ffeae3fb..a51e2cbb62 100644
--- a/actor/src/main/scala/org/apache/pekko/util/BoundedBlockingQueue.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/BoundedBlockingQueue.scala
@@ -30,11 +30,11 @@ class BoundedBlockingQueue[E <: AnyRef](val maxCapacity: Int, private val backin
backing match {
case null => throw new IllegalArgumentException("Backing Queue may not be null")
- case b: BlockingQueue[_] =>
+ case b: BlockingQueue[?] =>
require(maxCapacity > 0)
require(b.size() == 0)
require(b.remainingCapacity >= maxCapacity)
- case b: Queue[_] =>
+ case b: Queue[?] =>
require(b.size() == 0)
require(maxCapacity > 0)
}
@@ -186,9 +186,9 @@ class BoundedBlockingQueue[E <: AnyRef](val maxCapacity: Int, private val backin
finally lock.unlock()
}
- def drainTo(c: Collection[_ >: E]): Int = drainTo(c, Int.MaxValue)
+ def drainTo(c: Collection[? >: E]): Int = drainTo(c, Int.MaxValue)
- def drainTo(c: Collection[_ >: E], maxElements: Int): Int = {
+ def drainTo(c: Collection[? >: E], maxElements: Int): Int = {
if (c eq null) throw new NullPointerException
if (c eq this) throw new IllegalArgumentException
if (c eq backing) throw new IllegalArgumentException
@@ -211,13 +211,13 @@ class BoundedBlockingQueue[E <: AnyRef](val maxCapacity: Int, private val backin
}
}
- override def containsAll(c: Collection[_]): Boolean = {
+ override def containsAll(c: Collection[?]): Boolean = {
lock.lock()
try backing.containsAll(c)
finally lock.unlock()
}
- override def removeAll(c: Collection[_]): Boolean = {
+ override def removeAll(c: Collection[?]): Boolean = {
lock.lock()
try {
if (backing.removeAll(c)) {
@@ -229,7 +229,7 @@ class BoundedBlockingQueue[E <: AnyRef](val maxCapacity: Int, private val backin
} finally lock.unlock()
}
- override def retainAll(c: Collection[_]): Boolean = {
+ override def retainAll(c: Collection[?]): Boolean = {
lock.lock()
try {
if (backing.retainAll(c)) {
diff --git a/actor/src/main/scala/org/apache/pekko/util/BoxedType.scala b/actor/src/main/scala/org/apache/pekko/util/BoxedType.scala
index e26094214d..0e7fc09754 100644
--- a/actor/src/main/scala/org/apache/pekko/util/BoxedType.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/BoxedType.scala
@@ -16,7 +16,7 @@ package org.apache.pekko.util
object BoxedType {
import java.{ lang => jl }
- private val toBoxed = Map[Class[_], Class[_]](
+ private val toBoxed = Map[Class[?], Class[?]](
classOf[Boolean] -> classOf[jl.Boolean],
classOf[Byte] -> classOf[jl.Byte],
classOf[Char] -> classOf[jl.Character],
@@ -27,5 +27,5 @@ object BoxedType {
classOf[Double] -> classOf[jl.Double],
classOf[Unit] -> classOf[scala.runtime.BoxedUnit])
- final def apply(c: Class[_]): Class[_] = if (c.isPrimitive) toBoxed(c) else c
+ final def apply(c: Class[?]): Class[?] = if (c.isPrimitive) toBoxed(c) else c
}
diff --git a/actor/src/main/scala/org/apache/pekko/util/ClassLoaderObjectInputStream.scala b/actor/src/main/scala/org/apache/pekko/util/ClassLoaderObjectInputStream.scala
index ed35147fa3..b5a6f66a8d 100644
--- a/actor/src/main/scala/org/apache/pekko/util/ClassLoaderObjectInputStream.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/ClassLoaderObjectInputStream.scala
@@ -23,7 +23,7 @@ import java.io.{ InputStream, ObjectInputStream, ObjectStreamClass }
* @param is - the InputStream that is wrapped
*/
class ClassLoaderObjectInputStream(classLoader: ClassLoader, is: InputStream) extends ObjectInputStream(is) {
- override protected def resolveClass(objectStreamClass: ObjectStreamClass): Class[_] =
+ override protected def resolveClass(objectStreamClass: ObjectStreamClass): Class[?] =
try Class.forName(objectStreamClass.getName, false, classLoader)
catch {
case _: ClassNotFoundException => super.resolveClass(objectStreamClass)
diff --git a/actor/src/main/scala/org/apache/pekko/util/FrequencySketch.scala b/actor/src/main/scala/org/apache/pekko/util/FrequencySketch.scala
index dea5071a1a..90d96df312 100644
--- a/actor/src/main/scala/org/apache/pekko/util/FrequencySketch.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/FrequencySketch.scala
@@ -395,7 +395,9 @@ private[pekko] object FrequencySketchUtil {
val indexDigits = digits(rowWidth)
val counterDigits = math.max(2, digits(counterMax))
def divider(start: String, line: String, separator1: String, separator: String, end: String): String =
- start + (line * (indexDigits + 2)) + separator1 + (line * (counterDigits + 2)) +
+ start +
+ (line * (indexDigits + 2)) + separator1 +
+ (line * (counterDigits + 2)) +
((separator + (line * (counterDigits + 2))) * (slots - 1)) + end + "\n"
val builder = new StringBuilder
builder ++= divider("╔", "═", "╦", "╤", "╗")
@@ -407,8 +409,9 @@ private[pekko] object FrequencySketchUtil {
builder ++= "║\n"
for (row <- matrix.indices) {
for (column <- matrix(0).indices) {
- builder ++= (if (column == 0) divider("╠", "═", "╬", "╪", "╣")
- else divider("╟", "─", "╫", "┼", "╢"))
+ builder ++=
+ (if (column == 0) divider("╠", "═", "╬", "╪", "╣")
+ else divider("╟", "─", "╫", "┼", "╢"))
builder ++= s"║ %${indexDigits}d ".format(column)
var shift = 0
while (shift < 64) {
diff --git a/actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala b/actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala
index 648d790ed9..2faa74b00d 100644
--- a/actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala
@@ -196,7 +196,7 @@ object LineNumbers {
}
}
- private def getStreamForClass(c: Class[_]): Option[(InputStream, None.type)] = {
+ private def getStreamForClass(c: Class[?]): Option[(InputStream, None.type)] = {
val resource = c.getName.replace('.', '/') + ".class"
val cl = c.getClassLoader
val r = cl.getResourceAsStream(resource)
diff --git a/actor/src/main/scala/org/apache/pekko/util/Reflect.scala b/actor/src/main/scala/org/apache/pekko/util/Reflect.scala
index 2450e895cd..baa95779f7 100644
--- a/actor/src/main/scala/org/apache/pekko/util/Reflect.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/Reflect.scala
@@ -40,11 +40,11 @@ private[pekko] object Reflect {
*
* Hint: when comparing to Thread.currentThread().getStackTrace, add two levels.
*/
- val getCallerClass: Option[Int => Class[_]] = {
+ val getCallerClass: Option[Int => Class[?]] = {
try {
val c = Class.forName("sun.reflect.Reflection")
val m = c.getMethod("getCallerClass", Array(classOf[Int]): _*)
- Some((i: Int) => m.invoke(null, Array[AnyRef](i.asInstanceOf[java.lang.Integer]): _*).asInstanceOf[Class[_]])
+ Some((i: Int) => m.invoke(null, Array[AnyRef](i.asInstanceOf[java.lang.Integer]): _*).asInstanceOf[Class[?]])
} catch {
case NonFatal(_) => None
}
@@ -123,7 +123,7 @@ private[pekko] object Reflect {
else constructor
}
- private def safeGetClass(a: Any): Class[_] =
+ private def safeGetClass(a: Any): Class[?] =
if (a == null) classOf[AnyRef] else a.getClass
/**
@@ -133,17 +133,17 @@ private[pekko] object Reflect {
*/
private[pekko] def instantiator[T](clazz: Class[T]): () => T = () => instantiate(clazz)
- def findMarker(root: Class[_], marker: Class[_]): Type = {
- @tailrec def rec(curr: Class[_]): Type = {
+ def findMarker(root: Class[?], marker: Class[?]): Type = {
+ @tailrec def rec(curr: Class[?]): Type = {
if (curr.getSuperclass != null && marker.isAssignableFrom(curr.getSuperclass)) rec(curr.getSuperclass)
else
curr.getGenericInterfaces.collectFirst {
- case c: Class[_] if marker.isAssignableFrom(c) => c
- case t: ParameterizedType if marker.isAssignableFrom(t.getRawType.asInstanceOf[Class[_]]) => t
+ case c: Class[?] if marker.isAssignableFrom(c) => c
+ case t: ParameterizedType if marker.isAssignableFrom(t.getRawType.asInstanceOf[Class[?]]) => t
} match {
case None => throw new IllegalArgumentException(s"cannot find [$marker] in ancestors of [$root]")
- case Some(c: Class[_]) => if (c == marker) c else rec(c)
- case Some(t: ParameterizedType) => if (t.getRawType == marker) t else rec(t.getRawType.asInstanceOf[Class[_]])
+ case Some(c: Class[?]) => if (c == marker) c else rec(c)
+ case Some(t: ParameterizedType) => if (t.getRawType == marker) t else rec(t.getRawType.asInstanceOf[Class[?]])
case _ => ??? // cannot happen due to collectFirst
}
}
@@ -154,7 +154,7 @@ private[pekko] object Reflect {
* INTERNAL API
*/
private[pekko] def findClassLoader(): ClassLoader = {
- def findCaller(get: Int => Class[_]): ClassLoader =
+ def findCaller(get: Int => Class[?]): ClassLoader =
Iterator
.from(2 /*is the magic number, promise*/ )
.map(get)
diff --git a/actor/src/main/scala/org/apache/pekko/util/TypedMultiMap.scala b/actor/src/main/scala/org/apache/pekko/util/TypedMultiMap.scala
index 1677426028..cdec7a46c3 100644
--- a/actor/src/main/scala/org/apache/pekko/util/TypedMultiMap.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/TypedMultiMap.scala
@@ -109,7 +109,7 @@ class TypedMultiMap[T <: AnyRef, K[_ <: T]] private (private val map: Map[T, Set
override def toString: String = s"TypedMultiMap($map)"
override def equals(other: Any) = other match {
- case o: TypedMultiMap[_, _] => map == o.map
+ case o: TypedMultiMap[?, ?] => map == o.map
case _ => false
}
override def hashCode: Int = map.hashCode
diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedBenchmarkActors.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedBenchmarkActors.scala
index 1d0eaf9fa2..d82be1a9c1 100644
--- a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedBenchmarkActors.scala
+++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedBenchmarkActors.scala
@@ -161,7 +161,7 @@ object TypedBenchmarkActors {
}
private def startPingPongActorPairs(
- ctx: ActorContext[_],
+ ctx: ActorContext[?],
messagesPerPair: Int,
numPairs: Int,
dispatcher: String): (Vector[(ActorRef[Message], ActorRef[Message])], CountDownLatch) = {
diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryBenchmark.scala
index 6d847953de..a6c57fac57 100644
--- a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryBenchmark.scala
+++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryBenchmark.scala
@@ -121,8 +121,9 @@ object WorkPullingProducer {
Behaviors.setup { context =>
val requestNextAdapter =
context.messageAdapter[WorkPullingProducerController.RequestNext[Consumer.Command]](WrappedRequestNext(_))
- var remaining = numberOfMessages + context.system.settings.config
- .getInt("pekko.reliable-delivery.consumer-controller.flow-control-window")
+ var remaining = numberOfMessages +
+ context.system.settings.config
+ .getInt("pekko.reliable-delivery.consumer-controller.flow-control-window")
Behaviors.receiveMessagePartial {
case WrappedRequestNext(next) =>
diff --git a/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/CodecBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/CodecBenchmark.scala
index a1cb3a8561..3ff7e06778 100644
--- a/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/CodecBenchmark.scala
+++ b/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/CodecBenchmark.scala
@@ -294,7 +294,7 @@ object CodecBenchmark {
override def toBinary(o: AnyRef): Array[Byte] = Preserialized
- override def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef =
+ override def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef =
fromBinary(ByteBuffer.wrap(bytes), "NoManifestForYou")
}
diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/FlowMapBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/FlowMapBenchmark.scala
index 5ab9a14c9f..e4e9141034 100644
--- a/bench-jmh/src/main/scala/org/apache/pekko/stream/FlowMapBenchmark.scala
+++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/FlowMapBenchmark.scala
@@ -110,7 +110,7 @@ class FlowMapBenchmark {
}
// source setup
- private def mkMaps[O, Mat](source: Source[O, Mat], count: Int)(flow: => Graph[FlowShape[O, O], _]): Source[O, Mat] = {
+ private def mkMaps[O, Mat](source: Source[O, Mat], count: Int)(flow: => Graph[FlowShape[O, O], ?]): Source[O, Mat] = {
var f = source
for (_ <- 1 to count)
f = f.via(flow)
diff --git a/bench-jmh/src/main/scala/org/apache/pekko/util/StackBench.scala b/bench-jmh/src/main/scala/org/apache/pekko/util/StackBench.scala
index 3120124ac5..16296dc2a7 100644
--- a/bench-jmh/src/main/scala/org/apache/pekko/util/StackBench.scala
+++ b/bench-jmh/src/main/scala/org/apache/pekko/util/StackBench.scala
@@ -22,7 +22,7 @@ import org.openjdk.jmh.annotations.{ Benchmark, Measurement, Scope, State }
class StackBench {
class CustomSecurtyManager extends SecurityManager {
- def getTrace: Array[Class[_]] =
+ def getTrace: Array[Class[?]] =
getClassContext
}
@@ -32,7 +32,7 @@ class StackBench {
}
@Benchmark
- def securityManager(): Array[Class[_]] = {
+ def securityManager(): Array[Class[?]] = {
(new CustomSecurtyManager).getTrace
}
diff --git a/build.sbt b/build.sbt
index ae85048522..35e48bbac0 100644
--- a/build.sbt
+++ b/build.sbt
@@ -362,8 +362,9 @@ lazy val protobufV3 = pekkoModule("protobuf-v3")
assembly / assemblyOption := (assembly / assemblyOption).value.withIncludeScala(false).withIncludeBin(true),
autoScalaLibrary := false, // do not include scala dependency in pom
exportJars := true, // in dependent projects, use assembled and shaded jar
- makePomConfiguration := makePomConfiguration.value
- .withConfigurations(Vector(Compile)), // prevent original dependency to be added to pom as runtime dep
+ makePomConfiguration :=
+ makePomConfiguration.value
+ .withConfigurations(Vector(Compile)), // prevent original dependency to be added to pom as runtime dep
Compile / packageBin / packagedArtifact := Scoped.mkTuple2(
(Compile / packageBin / artifact).value,
ReproducibleBuildsPlugin.postProcessJar(OsgiKeys.bundle.value)),
@@ -384,7 +385,8 @@ lazy val protobufV3 = pekkoModule("protobuf-v3")
// redefining the fullClasspath with just what we need to avoid the cyclic task dependency
assembly / fullClasspath := (Runtime / managedClasspath).value ++ (Compile / products).value.map(Attributed.blank),
assembly / test := {}, // assembly runs tests for unknown reason which introduces another cyclic dependency to packageBin via exportedJars
- description := s"Apache Pekko Protobuf V3 is a shaded version of the protobuf runtime. Original POM: https://github.com/protocolbuffers/protobuf/blob/v${Dependencies.Protobuf.protobufJavaVersion}/java/pom.xml")
+ description :=
+ s"Apache Pekko Protobuf V3 is a shaded version of the protobuf runtime. Original POM: https://github.com/protocolbuffers/protobuf/blob/v${Dependencies.Protobuf.protobufJavaVersion}/java/pom.xml")
lazy val pki =
pekkoModule("pki")
diff --git a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStream.scala b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStream.scala
index 9ce5438c38..6a5d073c3f 100644
--- a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStream.scala
+++ b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStream.scala
@@ -45,7 +45,7 @@ private[protobuf] class NumberInputStream(
* @return the Class object described by the ObjectStreamClass
* @throws ClassNotFoundException if the Class cannot be found (or is rejected)
*/
- override protected def resolveClass(objectStreamClass: ObjectStreamClass): Class[_] = {
+ override protected def resolveClass(objectStreamClass: ObjectStreamClass): Class[?] = {
val clazz = super.resolveClass(objectStreamClass)
if (clazz.isPrimitive() || (clazz.isArray() && clazz.getComponentType.isPrimitive) ||
classOf[Number].isAssignableFrom(clazz) || clazz.getPackage.getName == "java.math") {
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingQuery.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingQuery.scala
index 3373754f7a..54e99bc484 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingQuery.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingQuery.scala
@@ -36,7 +36,7 @@ sealed trait ClusterShardingQuery
*
* For the statistics for the entire cluster, see [[GetClusterShardingStats]].
*/
-final case class GetShardRegionState(entityTypeKey: EntityTypeKey[_], replyTo: ActorRef[CurrentShardRegionState])
+final case class GetShardRegionState(entityTypeKey: EntityTypeKey[?], replyTo: ActorRef[CurrentShardRegionState])
extends ClusterShardingQuery {
/**
@@ -45,7 +45,7 @@ final case class GetShardRegionState(entityTypeKey: EntityTypeKey[_], replyTo: A
* Query the ShardRegion state for the given entity type key. This will get the state of the
* local ShardRegion's state.
*/
- def this(entityTypeKey: javadsl.EntityTypeKey[_], replyTo: ActorRef[CurrentShardRegionState]) =
+ def this(entityTypeKey: javadsl.EntityTypeKey[?], replyTo: ActorRef[CurrentShardRegionState]) =
this(entityTypeKey.asScala, replyTo)
}
@@ -61,7 +61,7 @@ final case class GetShardRegionState(entityTypeKey: EntityTypeKey[_], replyTo: A
* @param replyTo the actor to send the result to
*/
final case class GetClusterShardingStats(
- entityTypeKey: EntityTypeKey[_],
+ entityTypeKey: EntityTypeKey[?],
timeout: FiniteDuration,
replyTo: ActorRef[ClusterShardingStats])
extends ClusterShardingQuery {
@@ -74,7 +74,7 @@ final case class GetClusterShardingStats(
* shard regions the reply will contain an empty map of regions.
*/
def this(
- entityTypeKey: javadsl.EntityTypeKey[_],
+ entityTypeKey: javadsl.EntityTypeKey[?],
timeout: java.time.Duration,
replyTo: ActorRef[ClusterShardingStats]) =
this(entityTypeKey.asScala, JavaDurationConverters.asFiniteDuration(timeout), replyTo)
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingSettings.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingSettings.scala
index 5b8d0b0840..3088eb43ed 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingSettings.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingSettings.scala
@@ -34,7 +34,7 @@ import pekko.util.JavaDurationConverters._
object ClusterShardingSettings {
/** Scala API: Creates new cluster sharding settings object */
- def apply(system: ActorSystem[_]): ClusterShardingSettings =
+ def apply(system: ActorSystem[?]): ClusterShardingSettings =
fromConfig(system.settings.config.getConfig("pekko.cluster.sharding"))
def fromConfig(config: Config): ClusterShardingSettings = {
@@ -44,7 +44,7 @@ object ClusterShardingSettings {
}
/** Java API: Creates new cluster sharding settings object */
- def create(system: ActorSystem[_]): ClusterShardingSettings =
+ def create(system: ActorSystem[?]): ClusterShardingSettings =
apply(system)
/** INTERNAL API: Intended only for internal use, it is not recommended to keep converting between the setting types */
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingExtension.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingExtension.scala
index 9a21c89079..ddbdef76be 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingExtension.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingExtension.scala
@@ -29,10 +29,10 @@ import java.util.{ Map => JMap }
*/
object ReplicatedShardingExtension extends ExtensionId[ReplicatedShardingExtension] {
- override def createExtension(system: ActorSystem[_]): ReplicatedShardingExtension =
+ override def createExtension(system: ActorSystem[?]): ReplicatedShardingExtension =
new ReplicatedShardingExtensionImpl(system)
- def get(system: ActorSystem[_]): ReplicatedShardingExtension = apply(system)
+ def get(system: ActorSystem[?]): ReplicatedShardingExtension = apply(system)
}
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSettings.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSettings.scala
index 40f97680bb..d8f103bcaf 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSettings.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSettings.scala
@@ -27,12 +27,12 @@ import pekko.util.JavaDurationConverters._
object ShardedDaemonProcessSettings {
/** Scala API: Create default settings for system */
- def apply(system: ActorSystem[_]): ShardedDaemonProcessSettings = {
+ def apply(system: ActorSystem[?]): ShardedDaemonProcessSettings = {
fromConfig(system.settings.config.getConfig("pekko.cluster.sharded-daemon-process"))
}
/** Java API: Create default settings for system */
- def create(system: ActorSystem[_]): ShardedDaemonProcessSettings =
+ def create(system: ActorSystem[?]): ShardedDaemonProcessSettings =
apply(system)
/**
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingConsumerController.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingConsumerController.scala
index 1e58675bc0..6257b2c4b1 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingConsumerController.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingConsumerController.scala
@@ -55,7 +55,7 @@ object ShardingConsumerController {
* Scala API: Factory method from config `pekko.reliable-delivery.sharding.consumer-controller`
* of the `ActorSystem`.
*/
- def apply(system: ActorSystem[_]): Settings =
+ def apply(system: ActorSystem[?]): Settings =
apply(system.settings.config.getConfig("pekko.reliable-delivery.sharding.consumer-controller"))
/**
@@ -70,7 +70,7 @@ object ShardingConsumerController {
* Java API: Factory method from config `pekko.reliable-delivery.sharding.consumer-controller`
* of the `ActorSystem`.
*/
- def create(system: ActorSystem[_]): Settings =
+ def create(system: ActorSystem[?]): Settings =
apply(system)
/**
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingProducerController.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingProducerController.scala
index b38d954277..7b973cc620 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingProducerController.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingProducerController.scala
@@ -175,7 +175,7 @@ object ShardingProducerController {
* Scala API: Factory method from config `pekko.reliable-delivery.sharding.producer-controller`
* of the `ActorSystem`.
*/
- def apply(system: ActorSystem[_]): Settings =
+ def apply(system: ActorSystem[?]): Settings =
apply(system.settings.config.getConfig("pekko.reliable-delivery.sharding.producer-controller"))
/**
@@ -195,7 +195,7 @@ object ShardingProducerController {
* Java API: Factory method from config `pekko.reliable-delivery.sharding.producer-controller`
* of the `ActorSystem`.
*/
- def create(system: ActorSystem[_]): Settings =
+ def create(system: ActorSystem[?]): Settings =
apply(system)
/**
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingConsumerControllerImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingConsumerControllerImpl.scala
index adf156f918..3e85591e2a 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingConsumerControllerImpl.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingConsumerControllerImpl.scala
@@ -46,7 +46,7 @@ import pekko.cluster.sharding.typed.delivery.ShardingConsumerController
private def waitForStart[A](
context: ActorContext[ConsumerController.Command[A]],
settings: ShardingConsumerController.Settings,
- consumer: ActorRef[_]): Behavior[ConsumerController.Command[A]] = {
+ consumer: ActorRef[?]): Behavior[ConsumerController.Command[A]] = {
Behaviors.withStash(settings.bufferSize) { stashBuffer =>
Behaviors
.receiveMessage[ConsumerController.Command[A]] {
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala
index 0ee5a06808..19ad5d4cf2 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala
@@ -488,7 +488,8 @@ private class ShardingProducerControllerImpl[A: ClassTag](
s.out.foreach {
case (outKey: OutKey, outState) =>
val idleDurationMillis = (now - outState.usedNanoTime) / 1000 / 1000
- if (outState.unconfirmed.nonEmpty && idleDurationMillis >= settings.resendFirstUnconfirmedIdleTimeout.toMillis) {
+ if (outState.unconfirmed.nonEmpty &&
+ idleDurationMillis >= settings.resendFirstUnconfirmedIdleTimeout.toMillis) {
context.log.debug(
"Resend first unconfirmed for [{}], because it was idle for [{} ms]",
outKey,
@@ -506,8 +507,10 @@ private class ShardingProducerControllerImpl[A: ClassTag](
s.out.flatMap {
case (outKey: OutKey, outState) =>
val idleDurationMillis = (now - outState.usedNanoTime) / 1000 / 1000
- if (outState.unconfirmed.isEmpty && outState.buffered.isEmpty && idleDurationMillis >= settings
- .cleanupUnusedAfter.toMillis) {
+ if (outState.unconfirmed.isEmpty && outState.buffered.isEmpty &&
+ idleDurationMillis >=
+ settings
+ .cleanupUnusedAfter.toMillis) {
context.log.debug("Cleanup unused [{}], because it was idle for [{} ms]", outKey, idleDurationMillis)
context.stop(outState.producerController)
Some(outKey)
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala
index 026611912c..71fe2d2af7 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala
@@ -99,14 +99,14 @@ import pekko.util.JavaDurationConverters._
}
/** INTERNAL API */
-@InternalApi private[pekko] final class ClusterShardingImpl(system: ActorSystem[_])
+@InternalApi private[pekko] final class ClusterShardingImpl(system: ActorSystem[?])
extends javadsl.ClusterSharding
with scaladsl.ClusterSharding {
import pekko.actor.typed.scaladsl.adapter._
require(
- system.isInstanceOf[ActorSystemAdapter[_]],
+ system.isInstanceOf[ActorSystemAdapter[?]],
"only adapted classic actor systems can be used for cluster features")
private val cluster = Cluster(system)
@@ -326,7 +326,7 @@ import pekko.util.JavaDurationConverters._
override def equals(other: Any): Boolean =
other match {
- case eri: EntityRefImpl[_] =>
+ case eri: EntityRefImpl[?] =>
(eri.entityId == entityId) &&
(eri.typeKey == typeKey) &&
(eri.dataCenter == dataCenter)
@@ -405,13 +405,13 @@ import pekko.util.JavaDurationConverters._
// impl InternalRecipientRef
override def provider: ActorRefProvider = {
import pekko.actor.typed.scaladsl.adapter._
- shardRegion.toTyped.asInstanceOf[InternalRecipientRef[_]].provider
+ shardRegion.toTyped.asInstanceOf[InternalRecipientRef[?]].provider
}
// impl InternalRecipientRef
def isTerminated: Boolean = {
import pekko.actor.typed.scaladsl.adapter._
- shardRegion.toTyped.asInstanceOf[InternalRecipientRef[_]].isTerminated
+ shardRegion.toTyped.asInstanceOf[InternalRecipientRef[?]].isTerminated
}
override def toString: String = s"EntityRef($typeKey, $entityId)"
@@ -434,7 +434,7 @@ import pekko.util.JavaDurationConverters._
import pekko.cluster.sharding.ShardRegion.{ Passivate => ClassicPassivate }
def behavior(stopMessage: Any): Behavior[scaladsl.ClusterSharding.ShardCommand] = {
- def sendClassicPassivate(entity: ActorRef[_], classicSystem: actor.ActorSystem): Unit = {
+ def sendClassicPassivate(entity: ActorRef[?], classicSystem: actor.ActorSystem): Unit = {
val classicRef = entity.toClassic
val pathToShard = classicRef.path.elements.take(4).mkString("/")
classicSystem.actorSelection(pathToShard).tell(ClassicPassivate(stopMessage), classicRef)
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/Murmur2.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/Murmur2.scala
index e5873d9a29..3f6be73c94 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/Murmur2.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/Murmur2.scala
@@ -42,8 +42,9 @@ private[sharding] object Murmur2 {
val length4 = length / 4
for (i <- 0 until length4) {
val i4 = i * 4
- var k = (data(i4 + 0) & 0xFF) + ((data(i4 + 1) & 0xFF) << 8) + ((data(i4 + 2) & 0xFF) << 16) + ((data(
- i4 + 3) & 0xFF) << 24)
+ var k = (data(i4 + 0) & 0xFF) + ((data(i4 + 1) & 0xFF) << 8) + ((data(i4 + 2) & 0xFF) << 16) +
+ ((data(
+ i4 + 3) & 0xFF) << 24)
k *= m
k ^= k >>> r
k *= m
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ReplicatedShardingExtensionImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ReplicatedShardingExtensionImpl.scala
index 45ebce4fc6..85add7f3e8 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ReplicatedShardingExtensionImpl.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ReplicatedShardingExtensionImpl.scala
@@ -37,7 +37,7 @@ import pekko.util.ccompat.JavaConverters._
* INTERNAL API
*/
@InternalApi
-private[pekko] final class ReplicatedShardingExtensionImpl(system: ActorSystem[_]) extends ReplicatedShardingExtension {
+private[pekko] final class ReplicatedShardingExtensionImpl(system: ActorSystem[?]) extends ReplicatedShardingExtension {
private val counter = new AtomicLong(0)
@@ -99,7 +99,8 @@ private[pekko] final class ReplicatedShardingImpl[M](
override def entityRefsFor(entityId: String): Map[ReplicaId, EntityRef[M]] =
replicaTypeKeys.map {
case (replicaId, (typeKey, dc, typeName)) =>
- replicaId -> (dc match {
+ replicaId ->
+ (dc match {
case None => sharding.entityRefFor(typeKey, ReplicationId(typeName, entityId, replicaId).persistenceId.id)
case Some(dc) =>
sharding.entityRefFor(typeKey, ReplicationId(typeName, entityId, replicaId).persistenceId.id, dc)
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessImpl.scala
index 9107e1eede..15d579fd6b 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessImpl.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessImpl.scala
@@ -101,7 +101,7 @@ private[pekko] object ShardedDaemonProcessImpl {
* INTERNAL API
*/
@InternalApi
-private[pekko] final class ShardedDaemonProcessImpl(system: ActorSystem[_])
+private[pekko] final class ShardedDaemonProcessImpl(system: ActorSystem[?])
extends javadsl.ShardedDaemonProcess
with scaladsl.ShardedDaemonProcess {
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardingSerializer.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardingSerializer.scala
index 3d064b94d2..931199fa77 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardingSerializer.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardingSerializer.scala
@@ -39,13 +39,13 @@ import java.nio.ByteBuffer
private val ShardingEnvelopeManifest = "a"
override def manifest(o: AnyRef): String = o match {
- case _: ShardingEnvelope[_] => ShardingEnvelopeManifest
+ case _: ShardingEnvelope[?] => ShardingEnvelopeManifest
case _ =>
throw new IllegalArgumentException(s"Can't serialize object of type ${o.getClass} in [${getClass.getName}]")
}
override def toBinary(o: AnyRef): Array[Byte] = o match {
- case env: ShardingEnvelope[_] =>
+ case env: ShardingEnvelope[?] =>
val builder = ShardingMessages.ShardingEnvelope.newBuilder()
builder.setEntityId(env.entityId)
builder.setMessage(payloadSupport.payloadBuilder(env.message))
@@ -68,7 +68,7 @@ import java.nio.ByteBuffer
// buffer based avoiding a copy for artery
override def toBinary(o: AnyRef, buf: ByteBuffer): Unit = o match {
- case env: ShardingEnvelope[_] =>
+ case env: ShardingEnvelope[?] =>
val builder = ShardingMessages.ShardingEnvelope.newBuilder()
builder.setEntityId(env.entityId)
builder.setMessage(payloadSupport.payloadBuilder(env.message))
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/testkit/TestEntityRefImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/testkit/TestEntityRefImpl.scala
index 06d4b36fba..f777cc63b5 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/testkit/TestEntityRefImpl.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/testkit/TestEntityRefImpl.scala
@@ -67,12 +67,12 @@ import pekko.util.Timeout
// impl InternalRecipientRef
override def provider: ActorRefProvider = {
- probe.asInstanceOf[InternalRecipientRef[_]].provider
+ probe.asInstanceOf[InternalRecipientRef[?]].provider
}
// impl InternalRecipientRef
def isTerminated: Boolean = {
- probe.asInstanceOf[InternalRecipientRef[_]].isTerminated
+ probe.asInstanceOf[InternalRecipientRef[?]].isTerminated
}
override def toString: String = s"TestEntityRef($entityId)"
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterSharding.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterSharding.scala
index 450a075e58..bf168445cf 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterSharding.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterSharding.scala
@@ -40,7 +40,7 @@ trait EntityFactory[M] {
}
object ClusterSharding {
- def get(system: ActorSystem[_]): ClusterSharding =
+ def get(system: ActorSystem[?]): ClusterSharding =
scaladsl.ClusterSharding(system).asJava
/**
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala
index 8389e1c5c3..d6000db497 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala
@@ -24,7 +24,7 @@ import pekko.cluster.sharding.ShardCoordinator.ShardAllocationStrategy
import pekko.cluster.sharding.typed.ShardedDaemonProcessSettings
object ShardedDaemonProcess {
- def get(system: ActorSystem[_]): ShardedDaemonProcess =
+ def get(system: ActorSystem[?]): ShardedDaemonProcess =
pekko.cluster.sharding.typed.scaladsl.ShardedDaemonProcess(system).asJava
}
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterSharding.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterSharding.scala
index ed1908bd7e..181c70f019 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterSharding.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterSharding.scala
@@ -38,7 +38,7 @@ import pekko.util.Timeout
object ClusterSharding extends ExtensionId[ClusterSharding] {
- override def createExtension(system: ActorSystem[_]): ClusterSharding =
+ override def createExtension(system: ActorSystem[?]): ClusterSharding =
new ClusterShardingImpl(system)
/**
@@ -538,7 +538,7 @@ object EntityTypeKey {
}
object ClusterShardingSetup {
- def apply[T <: Extension](createExtension: ActorSystem[_] => ClusterSharding): ClusterShardingSetup =
+ def apply[T <: Extension](createExtension: ActorSystem[?] => ClusterSharding): ClusterShardingSetup =
new ClusterShardingSetup(createExtension(_))
}
@@ -548,5 +548,5 @@ object ClusterShardingSetup {
* to replace the default implementation of the [[ClusterSharding]] extension. Intended
* for tests that need to replace extension with stub/mock implementations.
*/
-final class ClusterShardingSetup(createExtension: java.util.function.Function[ActorSystem[_], ClusterSharding])
+final class ClusterShardingSetup(createExtension: java.util.function.Function[ActorSystem[?], ClusterSharding])
extends ExtensionSetup[ClusterSharding](ClusterSharding, createExtension)
diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ShardedDaemonProcess.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ShardedDaemonProcess.scala
index 1e30bb4fb6..2fc1064771 100644
--- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ShardedDaemonProcess.scala
+++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ShardedDaemonProcess.scala
@@ -28,7 +28,7 @@ import pekko.cluster.sharding.typed.internal.ShardedDaemonProcessImpl
import pekko.cluster.sharding.typed.javadsl
object ShardedDaemonProcess extends ExtensionId[ShardedDaemonProcess] {
- override def createExtension(system: ActorSystem[_]): ShardedDaemonProcess = new ShardedDaemonProcessImpl(system)
+ override def createExtension(system: ActorSystem[?]): ShardedDaemonProcess = new ShardedDaemonProcessImpl(system)
}
/**
diff --git a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/delivery/DeliveryThroughputSpec.scala b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/delivery/DeliveryThroughputSpec.scala
index 2a744558a3..c2f21d4e5c 100644
--- a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/delivery/DeliveryThroughputSpec.scala
+++ b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/delivery/DeliveryThroughputSpec.scala
@@ -207,8 +207,9 @@ object DeliveryThroughputSpec extends MultiNodeConfig {
val requestNextAdapter =
context.messageAdapter[WorkPullingProducerController.RequestNext[Consumer.Command]](WrappedRequestNext(_))
var startTime = System.nanoTime()
- var remaining = numberOfMessages + context.system.settings.config
- .getInt("pekko.reliable-delivery.consumer-controller.flow-control-window")
+ var remaining = numberOfMessages +
+ context.system.settings.config
+ .getInt("pekko.reliable-delivery.consumer-controller.flow-control-window")
Behaviors.receiveMessage {
case WrappedRequestNext(next) =>
@@ -254,8 +255,9 @@ object DeliveryThroughputSpec extends MultiNodeConfig {
val requestNextAdapter =
context.messageAdapter[ShardingProducerController.RequestNext[Consumer.Command]](WrappedRequestNext(_))
var startTime = System.nanoTime()
- var remaining = numberOfMessages + context.system.settings.config
- .getInt("pekko.reliable-delivery.sharding.consumer-controller.flow-control-window")
+ var remaining = numberOfMessages +
+ context.system.settings.config
+ .getInt("pekko.reliable-delivery.sharding.consumer-controller.flow-control-window")
var latestDemand: ShardingProducerController.RequestNext[Consumer.Command] = null
var messagesSentToEachEntity: Map[String, Long] = Map.empty[String, Long].withDefaultValue(0L)
diff --git a/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/DurableStateStoreQueryUsageCompileOnlySpec.scala b/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/DurableStateStoreQueryUsageCompileOnlySpec.scala
index c43d313469..9fe939082c 100644
--- a/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/DurableStateStoreQueryUsageCompileOnlySpec.scala
+++ b/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/DurableStateStoreQueryUsageCompileOnlySpec.scala
@@ -35,7 +35,7 @@ object DurableStateStoreQueryUsageCompileOnlySpec {
val source: Source[DurableStateChange[Record], NotUsed] = durableStateStoreQuery.changes("tag", offset)
source.map {
case UpdatedDurableState(persistenceId, revision, value, offset, timestamp) => Some(value)
- case _: DeletedDurableState[_] => None
+ case _: DeletedDurableState[?] => None
}
// #get-durable-state-store-query-example
}
diff --git a/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/ExternalShardAllocationCompileOnlySpec.scala b/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/ExternalShardAllocationCompileOnlySpec.scala
index 36d109a657..a134e650b9 100644
--- a/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/ExternalShardAllocationCompileOnlySpec.scala
+++ b/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/ExternalShardAllocationCompileOnlySpec.scala
@@ -30,7 +30,7 @@ import docs.org.apache.pekko.cluster.sharding.typed.ShardingCompileOnlySpec.Basi
import scala.concurrent.Future
class ExternalShardAllocationCompileOnlySpec {
- val system: ActorSystem[_] = ???
+ val system: ActorSystem[?] = ???
val sharding = ClusterSharding(system)
diff --git a/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/HelloWorldPersistentEntityExample.scala b/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/HelloWorldPersistentEntityExample.scala
index e91e122428..5091dd5bfc 100644
--- a/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/HelloWorldPersistentEntityExample.scala
+++ b/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/HelloWorldPersistentEntityExample.scala
@@ -32,7 +32,7 @@ object HelloWorldPersistentEntityExample {
import pekko.cluster.sharding.typed.scaladsl.Entity
import pekko.util.Timeout
- class HelloWorldService(system: ActorSystem[_]) {
+ class HelloWorldService(system: ActorSystem[?]) {
import system.executionContext
private val sharding = ClusterSharding(system)
diff --git a/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingCompileOnlySpec.scala b/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingCompileOnlySpec.scala
index 5145b0370b..28984bccd8 100644
--- a/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingCompileOnlySpec.scala
+++ b/cluster-sharding-typed/src/test/scala/docs/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingCompileOnlySpec.scala
@@ -31,7 +31,7 @@ object ReplicatedShardingCompileOnlySpec {
sealed trait Command
- val system: ActorSystem[_] = ???
+ val system: ActorSystem[?] = ???
object MyEventSourcedBehavior {
def apply(replicationId: ReplicationId): Behavior[Command] = ???
diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala
index b2b8183ec7..05460c833e 100644
--- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala
+++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala
@@ -61,10 +61,10 @@ class JoinConfigCompatCheckerClusterShardingSpec
private val clusterWaitDuration = 5.seconds
- private def configured(system: ActorSystem[_]): Int =
+ private def configured(system: ActorSystem[?]): Int =
system.settings.config.getInt(Key)
- private def join(sys: ActorSystem[_]): ClassicCluster = {
+ private def join(sys: ActorSystem[?]): ClassicCluster = {
if (sys eq system) {
configured(system) should ===(Shards)
val seedNode = ClassicCluster(system)
diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala
index 13354dd981..04c5a39f2a 100644
--- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala
+++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala
@@ -264,7 +264,7 @@ abstract class ReplicatedShardingSpec(replicationType: ReplicationType, configA:
}
"start replicated sharding on both nodes" in {
- def start(sys: ActorSystem[_]) = {
+ def start(sys: ActorSystem[?]) = {
ReplicatedShardingExtension(sys).init(MyReplicatedStringSet.provider(replicationType))
ReplicatedShardingExtension(sys).init(MyReplicatedIntSet.provider(replicationType))
}
diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/DurableShardingSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/DurableShardingSpec.scala
index 42331cb730..535c5c1fa8 100644
--- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/DurableShardingSpec.scala
+++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/DurableShardingSpec.scala
@@ -114,7 +114,7 @@ class DurableShardingSpec
(1 to 4).foreach { n =>
producerProbe.receiveMessage().sendNextTo ! ShardingEnvelope("entity-1", TestConsumer.Job(s"msg-$n"))
journalOperations.expectMessageType[InmemJournal.Write].event.getClass should ===(
- classOf[DurableProducerQueue.MessageSent[_]])
+ classOf[DurableProducerQueue.MessageSent[?]])
}
journalOperations.expectNoMessage()
@@ -183,7 +183,7 @@ class DurableShardingSpec
val next5 = producerProbe.receiveMessage()
next5.sendNextTo ! ShardingEnvelope("entity-1", TestConsumer.Job(s"msg-5"))
journalOperations.expectMessageType[InmemJournal.Write].event.getClass should ===(
- classOf[DurableProducerQueue.MessageSent[_]])
+ classOf[DurableProducerQueue.MessageSent[?]])
// issue #30489: the consumer controller may have stopped after msg-5, so allow for resend on timeout (10-15s)
val delivery5 = consumerProbe.receiveMessage(20.seconds)
@@ -225,7 +225,7 @@ class DurableShardingSpec
TestConsumer.Job(s"msg-1"),
replyProbe.ref)
journalOperations.expectMessageType[InmemJournal.Write].event.getClass should ===(
- classOf[DurableProducerQueue.MessageSent[_]])
+ classOf[DurableProducerQueue.MessageSent[?]])
replyProbe.expectMessage(Done)
producerProbe.receiveMessage().askNextTo ! MessageWithConfirmation(
@@ -233,7 +233,7 @@ class DurableShardingSpec
TestConsumer.Job(s"msg-2"),
replyProbe.ref)
journalOperations.expectMessageType[InmemJournal.Write].event.getClass should ===(
- classOf[DurableProducerQueue.MessageSent[_]])
+ classOf[DurableProducerQueue.MessageSent[?]])
replyProbe.expectMessage(Done)
testKit.stop(shardingProducerController)
diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala
index 7f8cd73197..9fb9581774 100644
--- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala
+++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala
@@ -166,7 +166,7 @@ class ClusterShardingPersistenceSpec
_entityId.toString
}
- private def awaitEntityTerminatedAndRemoved(ref: ActorRef[_], entityId: String): Unit = {
+ private def awaitEntityTerminatedAndRemoved(ref: ActorRef[?], entityId: String): Unit = {
val p = TestProbe[Any]()
p.expectTerminated(ref, p.remainingOrDefault)
diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala
index 2fc309cc75..bef2f6b6da 100644
--- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala
+++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala
@@ -1297,7 +1297,8 @@ final class ClusterShardingSettings(
import ClusterShardingSettings.{ RememberEntitiesStoreCustom, StateStoreModeDData, StateStoreModePersistence }
require(
- stateStoreMode == StateStoreModePersistence || stateStoreMode == StateStoreModeDData || stateStoreMode == RememberEntitiesStoreCustom,
+ stateStoreMode == StateStoreModePersistence || stateStoreMode == StateStoreModeDData ||
+ stateStoreMode == RememberEntitiesStoreCustom,
s"Unknown 'state-store-mode' [$stateStoreMode], valid values are '$StateStoreModeDData' or '$StateStoreModePersistence'")
/** If true, this node should run the shard region, otherwise just a shard proxy should started on this node. */
diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala
index a3fb8c3ce0..4aecb0fce8 100644
--- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala
+++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala
@@ -1204,7 +1204,8 @@ abstract class ShardCoordinator(
state.shards.get(shard) match {
case Some(ref) => getShardHomeSender ! ShardHome(shard, ref)
case None =>
- if (state.regions.contains(region) && !gracefulShutdownInProgress(region) && !regionTerminationInProgress
+ if (state.regions.contains(region) && !gracefulShutdownInProgress(region) &&
+ !regionTerminationInProgress
.contains(region)) {
update(ShardHomeAllocated(shard, region)) { evt =>
state = state.updated(evt)
diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala
index 5af701afa2..3cbdddf0e9 100644
--- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala
+++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala
@@ -1003,7 +1003,8 @@ private[pekko] class ShardRegion(
shardsByRef = shardsByRef - ref
shards = shards - shardId
startingShards -= shardId
- if (settings.passivationStrategy != ClusterShardingSettings.NoPassivationStrategy && !gracefulShutdownInProgress) {
+ if (settings.passivationStrategy != ClusterShardingSettings.NoPassivationStrategy &&
+ !gracefulShutdownInProgress) {
val update = ShardsUpdated(shards.size)
shards.values.foreach(_ ! update)
}
@@ -1084,11 +1085,10 @@ private[pekko] class ShardRegion(
}
private def askOne[T: ClassTag](shard: ActorRef, msg: Any, shardId: ShardId)(
- implicit timeout: Timeout): Future[Either[ShardId, T]] =
- (shard ? msg).mapTo[T].transform {
- case Success(t) => Success(Right(t))
- case Failure(_) => Success(Left(shardId))
- }
+ implicit timeout: Timeout): Future[Either[ShardId, T]] = (shard ? msg).mapTo[T].transform {
+ case Success(t) => Success(Right(t))
+ case Failure(_) => Success(Left(shardId))
+ }
private def tryCompleteGracefulShutdownIfInProgress(): Unit =
if (gracefulShutdownInProgress && shards.isEmpty && shardBuffers.isEmpty) {
diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardingFlightRecorder.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardingFlightRecorder.scala
index 29bb1a6c77..52bd659492 100644
--- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardingFlightRecorder.scala
+++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardingFlightRecorder.scala
@@ -23,7 +23,7 @@ import pekko.util.FlightRecorderLoader
@InternalApi
object ShardingFlightRecorder extends ExtensionId[ShardingFlightRecorder] with ExtensionIdProvider {
- override def lookup: ExtensionId[_ <: Extension] = this
+ override def lookup: ExtensionId[? <: Extension] = this
override def createExtension(system: ExtendedActorSystem): ShardingFlightRecorder =
FlightRecorderLoader.load[ShardingFlightRecorder](
diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/LeastShardAllocationStrategy.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/LeastShardAllocationStrategy.scala
index d6e0107027..6519f98268 100644
--- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/LeastShardAllocationStrategy.scala
+++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/LeastShardAllocationStrategy.scala
@@ -114,8 +114,9 @@ import pekko.cluster.sharding.internal.AbstractLeastShardAllocationStrategy.Shar
if (numberOfRegions == 0 || numberOfShards == 0) {
emptyRebalanceResult
} else {
- val optimalPerRegion = numberOfShards / numberOfRegions + (if (numberOfShards % numberOfRegions == 0) 0
- else 1)
+ val optimalPerRegion = numberOfShards / numberOfRegions +
+ (if (numberOfShards % numberOfRegions == 0) 0
+ else 1)
val result1 = rebalancePhase1(numberOfShards, optimalPerRegion, sortedRegionEntries)
diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/RandomizedBrainResolverIntegrationSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/RandomizedBrainResolverIntegrationSpec.scala
index 39ca53bb23..290c0b99eb 100644
--- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/RandomizedBrainResolverIntegrationSpec.scala
+++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/RandomizedBrainResolverIntegrationSpec.scala
@@ -296,13 +296,12 @@ class RandomizedSplitBrainResolverIntegrationSpec
// The test is limited to one flaky step, see issue #29185.
val numberOfFlaky = if (cleanSplit) 0 else 1
val healLastFlaky = numberOfFlaky > 0 && random.nextBoolean()
- val flaky: Map[Int, (RoleName, List[RoleName])] =
- (0 until numberOfFlaky).map { i =>
- val from = nodes(random.nextInt(nodes.size))
- val targets = nodes.filterNot(_ == from)
- val to = (0 to random.nextInt(math.min(5, targets.size))).map(j => targets(j)).toList
- i -> (from -> to)
- }.toMap
+ val flaky: Map[Int, (RoleName, List[RoleName])] = (0 until numberOfFlaky).map { i =>
+ val from = nodes(random.nextInt(nodes.size))
+ val targets = nodes.filterNot(_ == from)
+ val to = (0 to random.nextInt(math.min(5, targets.size))).map(j => targets(j)).toList
+ i -> (from -> to)
+ }.toMap
val delays = (0 until 10).map(_ => 2 + random.nextInt(13))
diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiDcClusterShardingSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiDcClusterShardingSpec.scala
index f944b10980..cdf7f6b14a 100644
--- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiDcClusterShardingSpec.scala
+++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiDcClusterShardingSpec.scala
@@ -98,7 +98,8 @@ abstract class MultiDcClusterShardingSpec
to, {
startSharding()
withClue(
- s"Failed waiting for ${cluster.selfUniqueAddress} to be up. Current state: ${cluster.state}" + cluster.state) {
+ s"Failed waiting for ${cluster.selfUniqueAddress} to be up. Current state: ${cluster.state}" +
+ cluster.state) {
within(15.seconds) {
awaitAssert(cluster.state.members.exists { m =>
m.uniqueAddress == cluster.selfUniqueAddress && m.status == MemberStatus.Up
diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala
index e49a149dd4..962d07728a 100644
--- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala
+++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala
@@ -24,7 +24,7 @@ import pekko.remote.testkit.MultiNodeConfig
object MultiNodeClusterShardingConfig {
- private[sharding] def testNameFromCallStack(classToStartFrom: Class[_]): String = {
+ private[sharding] def testNameFromCallStack(classToStartFrom: Class[?]): String = {
def isAbstractClass(className: String): Boolean = {
try {
@@ -108,7 +108,8 @@ abstract class MultiNodeClusterShardingConfig(
"").replace("_", "")}"
val persistenceConfig: Config =
- if (mode == ClusterShardingSettings.StateStoreModeDData && rememberEntitiesStore != ClusterShardingSettings.RememberEntitiesStoreEventsourced)
+ if (mode == ClusterShardingSettings.StateStoreModeDData &&
+ rememberEntitiesStore != ClusterShardingSettings.RememberEntitiesStoreEventsourced)
ConfigFactory.empty
else MultiNodeClusterShardingConfig.persistenceConfig(targetDir)
diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala
index 7010278bff..d4ebf95063 100644
--- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala
+++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala
@@ -48,7 +48,8 @@ class JoinConfigCompatCheckShardingSpec extends PekkoSpec() with WithLogCapturin
"A Joining Node" must {
/** This test verifies the built-in JoinConfigCompatCheckerSharding */
- "NOT be allowed to join a cluster using a different value for pekko.cluster.sharding.state-store-mode" taggedAs LongRunningTest in {
+ "NOT be allowed to join a cluster using a different value for pekko.cluster.sharding.state-store-mode" taggedAs
+ LongRunningTest in {
val joinNodeConfig =
ConfigFactory.parseString("""
diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardingQueriesSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardingQueriesSpec.scala
index 112b32ef17..01dd8006cb 100644
--- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardingQueriesSpec.scala
+++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardingQueriesSpec.scala
@@ -27,13 +27,13 @@ class ShardingQueriesSpec extends PekkoSpec {
"ShardsQueryResult" must {
- def nonEmpty(qr: ShardsQueryResult[_]): Boolean =
+ def nonEmpty(qr: ShardsQueryResult[?]): Boolean =
qr.total > 0 && qr.queried > 0
- def isTotalFailed(qr: ShardsQueryResult[_]): Boolean =
+ def isTotalFailed(qr: ShardsQueryResult[?]): Boolean =
nonEmpty(qr) && qr.failed.size == qr.total
- def isAllSubsetFailed(qr: ShardsQueryResult[_]): Boolean =
+ def isAllSubsetFailed(qr: ShardsQueryResult[?]): Boolean =
nonEmpty(qr) && qr.queried < qr.total && qr.failed.size == qr.queried
"reflect nothing to acquire metadata from - 0 shards" in {
diff --git a/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala b/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala
index fd7263992e..84d297f709 100644
--- a/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala
+++ b/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala
@@ -846,9 +846,10 @@ class DistributedPubSubMediator(settings: DistributedPubSubSettings)
def put(key: String, valueOption: Option[ActorRef]): Unit = {
val bucket = registry(selfAddress)
val v = nextVersion()
- registry += (selfAddress -> bucket.copy(
- version = v,
- content = bucket.content + (key -> ValueHolder(v, valueOption))))
+ registry +=
+ (selfAddress -> bucket.copy(
+ version = v,
+ content = bucket.content + (key -> ValueHolder(v, valueOption))))
}
def getCurrentTopics(): Set[String] = {
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala
index b8e25201d3..2d8a0ec4c2 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala
@@ -77,7 +77,7 @@ import pekko.util.Timeout
Behaviors
.receive[SReplicator.Command] { (ctx, msg) =>
msg match {
- case cmd: SReplicator.Get[_] =>
+ case cmd: SReplicator.Get[?] =>
classicReplicator.tell(dd.Replicator.Get(cmd.key, cmd.consistency), sender = cmd.replyTo.toClassic)
Behaviors.same
@@ -87,23 +87,22 @@ import pekko.util.Timeout
case t => t.asScala + additionalAskTimeout
})
import ctx.executionContext
- val reply =
- (classicReplicator ? dd.Replicator.Get(cmd.key, cmd.consistency.toClassic))
- .mapTo[dd.Replicator.GetResponse[d]]
- .map {
- case rsp: dd.Replicator.GetSuccess[d] =>
- JReplicator.GetSuccess(rsp.key)(rsp.dataValue)
- case rsp: dd.Replicator.NotFound[d] => JReplicator.NotFound(rsp.key)
- case rsp: dd.Replicator.GetFailure[d] => JReplicator.GetFailure(rsp.key)
- case rsp: dd.Replicator.GetDataDeleted[d] => JReplicator.GetDataDeleted(rsp.key)
- }
- .recover {
- case _ => JReplicator.GetFailure(cmd.key)
- }
+ val reply = (classicReplicator ? dd.Replicator.Get(cmd.key, cmd.consistency.toClassic))
+ .mapTo[dd.Replicator.GetResponse[d]]
+ .map {
+ case rsp: dd.Replicator.GetSuccess[d] =>
+ JReplicator.GetSuccess(rsp.key)(rsp.dataValue)
+ case rsp: dd.Replicator.NotFound[d] => JReplicator.NotFound(rsp.key)
+ case rsp: dd.Replicator.GetFailure[d] => JReplicator.GetFailure(rsp.key)
+ case rsp: dd.Replicator.GetDataDeleted[d] => JReplicator.GetDataDeleted(rsp.key)
+ }
+ .recover {
+ case _ => JReplicator.GetFailure(cmd.key)
+ }
reply.foreach { cmd.replyTo ! _ }
Behaviors.same
- case cmd: SReplicator.Update[_] =>
+ case cmd: SReplicator.Update[?] =>
classicReplicator.tell(
dd.Replicator.Update(cmd.key, cmd.writeConsistency, None)(cmd.modify),
sender = cmd.replyTo.toClassic)
@@ -132,7 +131,7 @@ import pekko.util.Timeout
reply.foreach { cmd.replyTo ! _ }
Behaviors.same
- case cmd: SReplicator.Subscribe[_] =>
+ case cmd: SReplicator.Subscribe[?] =>
// For the Scala API the SubscribeResponse messages can be sent directly to the subscriber
classicReplicator.tell(
dd.Replicator.Subscribe(cmd.key, cmd.subscriber.toClassic),
@@ -158,12 +157,12 @@ import pekko.util.Timeout
case InternalSubscribeResponse(rsp, subscriber) =>
rsp match {
- case chg: dd.Replicator.Changed[_] => subscriber ! JReplicator.Changed(chg.key)(chg.dataValue)
- case del: dd.Replicator.Deleted[_] => subscriber ! JReplicator.Deleted(del.key)
+ case chg: dd.Replicator.Changed[?] => subscriber ! JReplicator.Changed(chg.key)(chg.dataValue)
+ case del: dd.Replicator.Deleted[?] => subscriber ! JReplicator.Deleted(del.key)
}
Behaviors.same
- case cmd: SReplicator.Unsubscribe[_] =>
+ case cmd: SReplicator.Unsubscribe[?] =>
classicReplicator.tell(
dd.Replicator.Unsubscribe(cmd.key, cmd.subscriber.toClassic),
sender = cmd.subscriber.toClassic)
@@ -172,7 +171,7 @@ import pekko.util.Timeout
case cmd: JReplicator.Unsubscribe[ReplicatedData] @unchecked =>
stopSubscribeAdapter(cmd.subscriber)
- case cmd: SReplicator.Delete[_] =>
+ case cmd: SReplicator.Delete[?] =>
classicReplicator.tell(dd.Replicator.Delete(cmd.key, cmd.consistency), sender = cmd.replyTo.toClassic)
Behaviors.same
@@ -182,19 +181,18 @@ import pekko.util.Timeout
case t => t.asScala + additionalAskTimeout
})
import ctx.executionContext
- val reply =
- (classicReplicator ? dd.Replicator.Delete(cmd.key, cmd.consistency.toClassic))
- .mapTo[dd.Replicator.DeleteResponse[d]]
- .map {
- case rsp: dd.Replicator.DeleteSuccess[d] => JReplicator.DeleteSuccess(rsp.key)
- case rsp: dd.Replicator.ReplicationDeleteFailure[d] =>
- JReplicator.DeleteFailure(rsp.key)
- case rsp: dd.Replicator.DataDeleted[d] => JReplicator.DataDeleted(rsp.key)
- case rsp: dd.Replicator.StoreFailure[d] => JReplicator.StoreFailure(rsp.key)
- }
- .recover {
- case _ => JReplicator.DeleteFailure(cmd.key)
- }
+ val reply = (classicReplicator ? dd.Replicator.Delete(cmd.key, cmd.consistency.toClassic))
+ .mapTo[dd.Replicator.DeleteResponse[d]]
+ .map {
+ case rsp: dd.Replicator.DeleteSuccess[d] => JReplicator.DeleteSuccess(rsp.key)
+ case rsp: dd.Replicator.ReplicationDeleteFailure[d] =>
+ JReplicator.DeleteFailure(rsp.key)
+ case rsp: dd.Replicator.DataDeleted[d] => JReplicator.DataDeleted(rsp.key)
+ case rsp: dd.Replicator.StoreFailure[d] => JReplicator.StoreFailure(rsp.key)
+ }
+ .recover {
+ case _ => JReplicator.DeleteFailure(cmd.key)
+ }
reply.foreach { cmd.replyTo ! _ }
Behaviors.same
@@ -205,10 +203,9 @@ import pekko.util.Timeout
case JReplicator.GetReplicaCount(replyTo) =>
implicit val timeout = Timeout(localAskTimeout)
import ctx.executionContext
- val reply =
- (classicReplicator ? dd.Replicator.GetReplicaCount)
- .mapTo[dd.Replicator.ReplicaCount]
- .map(rsp => JReplicator.ReplicaCount(rsp.n))
+ val reply = (classicReplicator ? dd.Replicator.GetReplicaCount)
+ .mapTo[dd.Replicator.ReplicaCount]
+ .map(rsp => JReplicator.ReplicaCount(rsp.n))
reply.foreach { replyTo ! _ }
Behaviors.same
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/DistributedData.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/DistributedData.scala
index 7c8ce8400a..b1421d4328 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/DistributedData.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/DistributedData.scala
@@ -30,9 +30,9 @@ import pekko.cluster.ddata.SelfUniqueAddress
import pekko.util.JavaDurationConverters._
object DistributedData extends ExtensionId[DistributedData] {
- def get(system: ActorSystem[_]): DistributedData = apply(system)
+ def get(system: ActorSystem[?]): DistributedData = apply(system)
- override def createExtension(system: ActorSystem[_]): DistributedData =
+ override def createExtension(system: ActorSystem[?]): DistributedData =
new DistributedDataImpl(system)
/**
@@ -97,7 +97,7 @@ abstract class DistributedData extends Extension {
/**
* INTERNAL API
*/
-@InternalApi private[pekko] class DistributedDataImpl(system: ActorSystem[_]) extends DistributedData {
+@InternalApi private[pekko] class DistributedDataImpl(system: ActorSystem[?]) extends DistributedData {
override val replicator: ActorRef[Replicator.Command] =
pekko.cluster.ddata.typed.scaladsl.DistributedData(system).replicator.narrow[Replicator.Command]
@@ -108,7 +108,7 @@ abstract class DistributedData extends Extension {
}
object DistributedDataSetup {
- def apply[T <: Extension](createExtension: ActorSystem[_] => DistributedData): DistributedDataSetup =
+ def apply[T <: Extension](createExtension: ActorSystem[?] => DistributedData): DistributedDataSetup =
new DistributedDataSetup(createExtension(_))
}
@@ -118,5 +118,5 @@ object DistributedDataSetup {
* to replace the default implementation of the [[DistributedData]] extension. Intended
* for tests that need to replace extension with stub/mock implementations.
*/
-final class DistributedDataSetup(createExtension: java.util.function.Function[ActorSystem[_], DistributedData])
+final class DistributedDataSetup(createExtension: java.util.function.Function[ActorSystem[?], DistributedData])
extends ExtensionSetup[DistributedData](DistributedData, createExtension)
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorSettings.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorSettings.scala
index 4370d15087..dfd3ae0f1e 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorSettings.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorSettings.scala
@@ -26,7 +26,7 @@ object ReplicatorSettings {
* Create settings from the default configuration
* `pekko.cluster.distributed-data`.
*/
- def create(system: ActorSystem[_]): dd.ReplicatorSettings =
+ def create(system: ActorSystem[?]): dd.ReplicatorSettings =
dd.ReplicatorSettings(system.toClassic)
/**
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/DistributedData.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/DistributedData.scala
index b3ef6aaf69..7fc3435f9d 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/DistributedData.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/DistributedData.scala
@@ -31,9 +31,9 @@ import pekko.cluster.ddata.SelfUniqueAddress
import pekko.util.JavaDurationConverters._
object DistributedData extends ExtensionId[DistributedData] {
- def get(system: ActorSystem[_]): DistributedData = apply(system)
+ def get(system: ActorSystem[?]): DistributedData = apply(system)
- override def createExtension(system: ActorSystem[_]): DistributedData =
+ override def createExtension(system: ActorSystem[?]): DistributedData =
new DistributedData(system)
/**
@@ -76,7 +76,7 @@ object DistributedData extends ExtensionId[DistributedData] {
* [[pekko.cluster.ddata.DistributedData]] and that means that typed
* and classic actors can share the same data.
*/
-class DistributedData(system: ActorSystem[_]) extends Extension {
+class DistributedData(system: ActorSystem[?]) extends Extension {
import pekko.actor.typed.scaladsl.adapter._
private val settings: ReplicatorSettings = ReplicatorSettings(system)
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala
index aa0449d9db..4d2450ef1b 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala
@@ -30,7 +30,7 @@ object ReplicatorSettings {
* Create settings from the default configuration
* `pekko.cluster.distributed-data`.
*/
- def apply(system: ActorSystem[_]): ReplicatorSettings =
+ def apply(system: ActorSystem[?]): ReplicatorSettings =
dd.ReplicatorSettings(system.toClassic)
/**
@@ -44,6 +44,6 @@ object ReplicatorSettings {
* INTERNAL API
* The name of the actor used in DistributedData extensions.
*/
- @InternalApi private[pekko] def name(system: ActorSystem[_]): String =
+ @InternalApi private[pekko] def name(system: ActorSystem[?]): String =
dd.ReplicatorSettings.name(system.toClassic, Some("typed"))
}
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/Cluster.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/Cluster.scala
index e2fdf08a76..3ae85e751e 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/Cluster.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/Cluster.scala
@@ -185,12 +185,12 @@ case object PrepareForFullClusterShutdown extends PrepareForFullClusterShutdown
*/
object Cluster extends ExtensionId[Cluster] {
- def createExtension(system: ActorSystem[_]): Cluster = new AdapterClusterImpl(system)
+ def createExtension(system: ActorSystem[?]): Cluster = new AdapterClusterImpl(system)
/**
* Java API
*/
- def get(system: ActorSystem[_]): Cluster = apply(system)
+ def get(system: ActorSystem[?]): Cluster = apply(system)
}
/**
@@ -223,7 +223,7 @@ abstract class Cluster extends Extension {
}
object ClusterSetup {
- def apply[T <: Extension](createExtension: ActorSystem[_] => Cluster): ClusterSetup =
+ def apply[T <: Extension](createExtension: ActorSystem[?] => Cluster): ClusterSetup =
new ClusterSetup(createExtension(_))
}
@@ -233,5 +233,5 @@ object ClusterSetup {
* to replace the default implementation of the [[Cluster]] extension. Intended
* for tests that need to replace extension with stub/mock implementations.
*/
-final class ClusterSetup(createExtension: java.util.function.Function[ActorSystem[_], Cluster])
+final class ClusterSetup(createExtension: java.util.function.Function[ActorSystem[?], Cluster])
extends ExtensionSetup[Cluster](Cluster, createExtension)
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala
index 8e3c0dcab8..d27fe4cf0c 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala
@@ -29,13 +29,13 @@ import pekko.util.JavaDurationConverters._
import com.typesafe.config.Config
object ClusterSingletonSettings {
- def apply(system: ActorSystem[_]): ClusterSingletonSettings =
+ def apply(system: ActorSystem[?]): ClusterSingletonSettings =
fromConfig(system.settings.config.getConfig("pekko.cluster"))
/**
* Java API
*/
- def create(system: ActorSystem[_]): ClusterSingletonSettings = apply(system)
+ def create(system: ActorSystem[?]): ClusterSingletonSettings = apply(system)
def fromConfig(config: Config): ClusterSingletonSettings = {
// TODO introduce a config namespace for typed singleton and read that?
@@ -144,12 +144,12 @@ final class ClusterSingletonSettings(
object ClusterSingleton extends ExtensionId[ClusterSingleton] {
- override def createExtension(system: ActorSystem[_]): ClusterSingleton = new AdaptedClusterSingletonImpl(system)
+ override def createExtension(system: ActorSystem[?]): ClusterSingleton = new AdaptedClusterSingletonImpl(system)
/**
* Java API:
*/
- def get(system: ActorSystem[_]): ClusterSingleton = apply(system)
+ def get(system: ActorSystem[?]): ClusterSingleton = apply(system)
}
/**
@@ -236,7 +236,7 @@ object ClusterSingletonManagerSettings {
* Create settings from the default configuration
* `pekko.cluster.singleton`.
*/
- def apply(system: ActorSystem[_]): ClusterSingletonManagerSettings =
+ def apply(system: ActorSystem[?]): ClusterSingletonManagerSettings =
apply(system.settings.config.getConfig("pekko.cluster.singleton"))
.withRemovalMargin(pekko.cluster.Cluster(system).downingProvider.downRemovalMargin)
@@ -262,7 +262,7 @@ object ClusterSingletonManagerSettings {
* Java API: Create settings from the default configuration
* `pekko.cluster.singleton`.
*/
- def create(system: ActorSystem[_]): ClusterSingletonManagerSettings = apply(system)
+ def create(system: ActorSystem[?]): ClusterSingletonManagerSettings = apply(system)
/**
* Java API: Create settings from a configuration with the same layout as
@@ -343,7 +343,7 @@ final class ClusterSingletonManagerSettings(
}
object ClusterSingletonSetup {
- def apply[T <: Extension](createExtension: ActorSystem[_] => ClusterSingleton): ClusterSingletonSetup =
+ def apply[T <: Extension](createExtension: ActorSystem[?] => ClusterSingleton): ClusterSingletonSetup =
new ClusterSingletonSetup(createExtension(_))
}
@@ -353,5 +353,5 @@ object ClusterSingletonSetup {
* to replace the default implementation of the [[ClusterSingleton]] extension. Intended
* for tests that need to replace extension with stub/mock implementations.
*/
-final class ClusterSingletonSetup(createExtension: java.util.function.Function[ActorSystem[_], ClusterSingleton])
+final class ClusterSingletonSetup(createExtension: java.util.function.Function[ActorSystem[?], ClusterSingleton])
extends ExtensionSetup[ClusterSingleton](ClusterSingleton, createExtension)
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterImpl.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterImpl.scala
index a506921438..7cfdb92a74 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterImpl.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterImpl.scala
@@ -155,10 +155,10 @@ private[pekko] object AdapterClusterImpl {
* INTERNAL API:
*/
@InternalApi
-private[pekko] final class AdapterClusterImpl(system: ActorSystem[_]) extends Cluster {
+private[pekko] final class AdapterClusterImpl(system: ActorSystem[?]) extends Cluster {
import AdapterClusterImpl._
- require(system.isInstanceOf[ActorSystemAdapter[_]], "only adapted actor systems can be used for cluster features")
+ require(system.isInstanceOf[ActorSystemAdapter[?]], "only adapted actor systems can be used for cluster features")
private val classicCluster = pekko.cluster.Cluster(system)
override def selfMember: Member = classicCluster.selfMember
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterSingletonImpl.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterSingletonImpl.scala
index 6d67d70671..032400e67d 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterSingletonImpl.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterSingletonImpl.scala
@@ -32,9 +32,9 @@ import pekko.cluster.typed.{ Cluster, ClusterSingleton, ClusterSingletonImpl, Cl
* INTERNAL API:
*/
@InternalApi
-private[pekko] final class AdaptedClusterSingletonImpl(system: ActorSystem[_]) extends ClusterSingleton {
+private[pekko] final class AdaptedClusterSingletonImpl(system: ActorSystem[?]) extends ClusterSingleton {
require(
- system.isInstanceOf[ActorSystemAdapter[_]],
+ system.isInstanceOf[ActorSystemAdapter[?]],
"only adapted actor systems can be used for the typed cluster singleton")
import ClusterSingletonImpl._
@@ -44,7 +44,7 @@ private[pekko] final class AdaptedClusterSingletonImpl(system: ActorSystem[_]) e
private lazy val cluster = Cluster(system)
private val classicSystem = system.toClassic.asInstanceOf[ExtendedActorSystem]
- private val proxies = new ConcurrentHashMap[(String, Option[DataCenter]), ActorRef[_]]()
+ private val proxies = new ConcurrentHashMap[(String, Option[DataCenter]), ActorRef[?]]()
override def init[M](singleton: typed.SingletonActor[M]): ActorRef[M] = {
val settings = singleton.settings match {
@@ -79,8 +79,8 @@ private[pekko] final class AdaptedClusterSingletonImpl(system: ActorSystem[_]) e
}
private def getProxy[T](name: String, settings: ClusterSingletonSettings): ActorRef[T] = {
- val proxyCreator = new JFunction[(String, Option[DataCenter]), ActorRef[_]] {
- def apply(singletonNameAndDc: (String, Option[DataCenter])): ActorRef[_] = {
+ val proxyCreator = new JFunction[(String, Option[DataCenter]), ActorRef[?]] {
+ def apply(singletonNameAndDc: (String, Option[DataCenter])): ActorRef[?] = {
val (singletonName, _) = singletonNameAndDc
val proxyName = s"singletonProxy$singletonName-${settings.dataCenter.getOrElse("no-dc")}"
classicSystem.systemActorOf(
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/PekkoClusterTypedSerializer.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/PekkoClusterTypedSerializer.scala
index 7fb850fa18..a915bed84d 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/PekkoClusterTypedSerializer.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/PekkoClusterTypedSerializer.scala
@@ -43,14 +43,14 @@ private[pekko] final class PekkoClusterTypedSerializer(override val system: Exte
override def manifest(o: AnyRef): String = o match {
case _: Entry => ReceptionistEntryManifest
- case _: TopicImpl.MessagePublished[_] => PubSubPublishManifest
+ case _: TopicImpl.MessagePublished[?] => PubSubPublishManifest
case _ =>
throw new IllegalArgumentException(s"Can't serialize object of type ${o.getClass} in [${getClass.getName}]")
}
override def toBinary(o: AnyRef): Array[Byte] = o match {
case e: Entry => receptionistEntryToBinary(e)
- case m: TopicImpl.MessagePublished[_] => pubSubPublishToBinary(m)
+ case m: TopicImpl.MessagePublished[?] => pubSubPublishToBinary(m)
case _ =>
throw new IllegalArgumentException(s"Cannot serialize object of type [${o.getClass.getName}]")
}
@@ -63,7 +63,7 @@ private[pekko] final class PekkoClusterTypedSerializer(override val system: Exte
s"Unimplemented deserialization of message with manifest [$manifest] in [${getClass.getName}]")
}
- private def pubSubPublishToBinary(m: TopicImpl.MessagePublished[_]): Array[Byte] = {
+ private def pubSubPublishToBinary(m: TopicImpl.MessagePublished[?]): Array[Byte] = {
ClusterMessages.PubSubMessagePublished
.newBuilder()
.setMessage(payloadSupport.payloadBuilder(m.message))
@@ -83,7 +83,7 @@ private[pekko] final class PekkoClusterTypedSerializer(override val system: Exte
b.build().toByteArray
}
- private def pubSubMessageFromBinary(bytes: Array[Byte]): TopicImpl.MessagePublished[_] = {
+ private def pubSubMessageFromBinary(bytes: Array[Byte]): TopicImpl.MessagePublished[?] = {
val parsed = ClusterMessages.PubSubMessagePublished.parseFrom(bytes)
val userMessage = payloadSupport.deserializePayload(parsed.getMessage)
TopicImpl.MessagePublished(userMessage)
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala
index 02eee4050a..c715b85228 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala
@@ -58,34 +58,34 @@ import pekko.remote.ByteStringUtils
private val DurableQueueCleanupManifest = "i"
override def manifest(o: AnyRef): String = o match {
- case _: ConsumerController.SequencedMessage[_] => SequencedMessageManifest
+ case _: ConsumerController.SequencedMessage[?] => SequencedMessageManifest
case _: ProducerControllerImpl.Ack => AckManifest
case _: ProducerControllerImpl.Request => RequestManifest
case _: ProducerControllerImpl.Resend => ResendManifest
- case _: ProducerController.RegisterConsumer[_] => RegisterConsumerManifest
- case _: DurableProducerQueue.MessageSent[_] => DurableQueueMessageSentManifest
+ case _: ProducerController.RegisterConsumer[?] => RegisterConsumerManifest
+ case _: DurableProducerQueue.MessageSent[?] => DurableQueueMessageSentManifest
case _: DurableProducerQueue.Confirmed => DurableQueueConfirmedManifest
- case _: DurableProducerQueue.State[_] => DurableQueueStateManifest
+ case _: DurableProducerQueue.State[?] => DurableQueueStateManifest
case _: DurableProducerQueue.Cleanup => DurableQueueCleanupManifest
case _ =>
throw new IllegalArgumentException(s"Can't serialize object of type ${o.getClass} in [${getClass.getName}]")
}
override def toBinary(o: AnyRef): Array[Byte] = o match {
- case m: ConsumerController.SequencedMessage[_] => sequencedMessageToBinary(m)
+ case m: ConsumerController.SequencedMessage[?] => sequencedMessageToBinary(m)
case m: ProducerControllerImpl.Ack => ackToBinary(m)
case m: ProducerControllerImpl.Request => requestToBinary(m)
case m: ProducerControllerImpl.Resend => resendToBinary(m)
- case m: ProducerController.RegisterConsumer[_] => registerConsumerToBinary(m)
- case m: DurableProducerQueue.MessageSent[_] => durableQueueMessageSentToBinary(m)
+ case m: ProducerController.RegisterConsumer[?] => registerConsumerToBinary(m)
+ case m: DurableProducerQueue.MessageSent[?] => durableQueueMessageSentToBinary(m)
case m: DurableProducerQueue.Confirmed => durableQueueConfirmedToBinary(m)
- case m: DurableProducerQueue.State[_] => durableQueueStateToBinary(m)
+ case m: DurableProducerQueue.State[?] => durableQueueStateToBinary(m)
case m: DurableProducerQueue.Cleanup => durableQueueCleanupToBinary(m)
case _ =>
throw new IllegalArgumentException(s"Cannot serialize object of type [${o.getClass.getName}]")
}
- private def sequencedMessageToBinary(m: ConsumerController.SequencedMessage[_]): Array[Byte] = {
+ private def sequencedMessageToBinary(m: ConsumerController.SequencedMessage[?]): Array[Byte] = {
val b = ReliableDelivery.SequencedMessage.newBuilder()
b.setProducerId(m.producerId)
b.setSeqNr(m.seqNr)
@@ -134,17 +134,17 @@ import pekko.remote.ByteStringUtils
b.build().toByteArray()
}
- private def registerConsumerToBinary(m: ProducerController.RegisterConsumer[_]): Array[Byte] = {
+ private def registerConsumerToBinary(m: ProducerController.RegisterConsumer[?]): Array[Byte] = {
val b = ReliableDelivery.RegisterConsumer.newBuilder()
b.setConsumerControllerRef(resolver.toSerializationFormat(m.consumerController))
b.build().toByteArray()
}
- private def durableQueueMessageSentToBinary(m: DurableProducerQueue.MessageSent[_]): Array[Byte] = {
+ private def durableQueueMessageSentToBinary(m: DurableProducerQueue.MessageSent[?]): Array[Byte] = {
durableQueueMessageSentToProto(m).toByteArray()
}
- private def durableQueueMessageSentToProto(m: DurableProducerQueue.MessageSent[_]): ReliableDelivery.MessageSent = {
+ private def durableQueueMessageSentToProto(m: DurableProducerQueue.MessageSent[?]): ReliableDelivery.MessageSent = {
val b = ReliableDelivery.MessageSent.newBuilder()
b.setSeqNr(m.seqNr)
b.setQualifier(m.confirmationQualifier)
@@ -178,7 +178,7 @@ import pekko.remote.ByteStringUtils
b.build()
}
- private def durableQueueStateToBinary(m: DurableProducerQueue.State[_]): Array[Byte] = {
+ private def durableQueueStateToBinary(m: DurableProducerQueue.State[?]): Array[Byte] = {
val b = ReliableDelivery.State.newBuilder()
b.setCurrentSeqNr(m.currentSeqNr)
b.setHighestConfirmedSeqNr(m.highestConfirmedSeqNr)
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionist.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionist.scala
index 102f3abd00..474d82ee94 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionist.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionist.scala
@@ -54,15 +54,15 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider {
import ClusterReceptionistProtocol.SubscriptionsKV
type SubscriptionRegistry = TypedMultiMap[AbstractServiceKey, SubscriptionsKV]
- type DDataKey = ORMultiMapKey[ServiceKey[_], Entry]
+ type DDataKey = ORMultiMapKey[ServiceKey[?], Entry]
- final val EmptyORMultiMap = ORMultiMap.empty[ServiceKey[_], Entry]
+ final val EmptyORMultiMap = ORMultiMap.empty[ServiceKey[?], Entry]
override val name = "clusterReceptionist"
// values contain system uid to make it possible to discern actors at the same
// path in different incarnations of a cluster node
- final case class Entry(ref: ActorRef[_], systemUid: Long)(val createdTimestamp: Long) {
+ final case class Entry(ref: ActorRef[?], systemUid: Long)(val createdTimestamp: Long) {
def uniqueAddress(selfAddress: Address): UniqueAddress =
if (ref.path.address.hasLocalScope) UniqueAddress(selfAddress, systemUid)
else UniqueAddress(ref.path.address, systemUid)
@@ -79,7 +79,7 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider {
private final case class NodeRemoved(addresses: UniqueAddress) extends InternalCommand
private final case class NodeUnreachable(addresses: UniqueAddress) extends InternalCommand
private final case class NodeReachable(addresses: UniqueAddress) extends InternalCommand
- private final case class ChangeFromReplicator(key: DDataKey, value: ORMultiMap[ServiceKey[_], Entry])
+ private final case class ChangeFromReplicator(key: DDataKey, value: ORMultiMap[ServiceKey[?], Entry])
extends InternalCommand
private case object RemoveTick extends InternalCommand
private case object PruneTombstonesTick extends InternalCommand
@@ -93,12 +93,12 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider {
*/
final case class State(
registry: ShardedServiceRegistry,
- servicesPerActor: Map[ActorRef[_], Set[AbstractServiceKey]],
- tombstones: Map[ActorRef[_], Set[(AbstractServiceKey, Deadline)]],
+ servicesPerActor: Map[ActorRef[?], Set[AbstractServiceKey]],
+ tombstones: Map[ActorRef[?], Set[(AbstractServiceKey, Deadline)]],
subscriptions: SubscriptionRegistry) {
/** tombstone all services actor is registered for */
- def addTombstone(actor: ActorRef[_], deadline: Deadline): State = {
+ def addTombstone(actor: ActorRef[?], deadline: Deadline): State = {
servicesPerActor.getOrElse(actor, Set.empty).foldLeft(this) { (state, key) =>
state.addTombstone(actor.asInstanceOf[ActorRef[key.Protocol]], key.asServiceKey, deadline)
}
@@ -116,7 +116,7 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider {
def pruneTombstones(): State = {
if (tombstones.isEmpty) this
else {
- val newTombstones: Map[ActorRef[_], Set[(AbstractServiceKey, Deadline)]] =
+ val newTombstones: Map[ActorRef[?], Set[(AbstractServiceKey, Deadline)]] =
tombstones.foldLeft(tombstones) {
case (acc, (actorRef, entries)) =>
val entriesToKeep = entries.filter {
@@ -218,10 +218,10 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider {
// subscribe to changes from other nodes
val replicatorMessageAdapter: ActorRef[Replicator.ReplicatorMessage] =
ctx.messageAdapter[Replicator.ReplicatorMessage] {
- case changed: Replicator.Changed[_] @unchecked =>
+ case changed: Replicator.Changed[?] @unchecked =>
ChangeFromReplicator(
changed.key.asInstanceOf[DDataKey],
- changed.dataValue.asInstanceOf[ORMultiMap[ServiceKey[_], Entry]])
+ changed.dataValue.asInstanceOf[ORMultiMap[ServiceKey[?], Entry]])
case _ => throw new IllegalArgumentException() // compiler exhaustiveness check pleaser
}
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSettings.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSettings.scala
index 76a8231a7d..73903be8aa 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSettings.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSettings.scala
@@ -30,7 +30,7 @@ import pekko.util.Helpers.toRootLowerCase
*/
@InternalApi
private[pekko] object ClusterReceptionistSettings {
- def apply(system: ActorSystem[_]): ClusterReceptionistSettings =
+ def apply(system: ActorSystem[?]): ClusterReceptionistSettings =
apply(system.settings.config.getConfig("pekko.cluster.typed.receptionist"))
def apply(config: Config): ClusterReceptionistSettings = {
diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/Registry.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/Registry.scala
index 3f96258ead..4693a550ff 100644
--- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/Registry.scala
+++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/Registry.scala
@@ -28,7 +28,7 @@ import pekko.cluster.typed.internal.receptionist.ClusterReceptionist.{ DDataKey,
@InternalApi private[pekko] object ShardedServiceRegistry {
def apply(numberOfKeys: Int): ShardedServiceRegistry = {
val emptyRegistries = (0 until numberOfKeys).map { n =>
- val key = ORMultiMapKey[ServiceKey[_], Entry](s"ReceptionistKey_$n")
+ val key = ORMultiMapKey[ServiceKey[?], Entry](s"ReceptionistKey_$n")
key -> new ServiceRegistry(EmptyORMultiMap)
}.toMap
new ShardedServiceRegistry(emptyRegistries, Set.empty, Set.empty)
@@ -53,10 +53,10 @@ import pekko.cluster.typed.internal.receptionist.ClusterReceptionist.{ DDataKey,
def allDdataKeys: Iterable[DDataKey] = keys
- def ddataKeyFor(serviceKey: ServiceKey[_]): DDataKey =
+ def ddataKeyFor(serviceKey: ServiceKey[?]): DDataKey =
keys(math.abs(serviceKey.id.hashCode() % serviceRegistries.size))
- def allServices: Iterator[(ServiceKey[_], Set[Entry])] =
+ def allServices: Iterator[(ServiceKey[?], Set[Entry])] =
serviceRegistries.valuesIterator.flatMap(_.entries.entries)
def allEntries: Iterator[Entry] = allServices.flatMap(_._2)
@@ -113,7 +113,7 @@ import pekko.cluster.typed.internal.receptionist.ClusterReceptionist.{ DDataKey,
/**
* INTERNAL API
*/
-@InternalApi private[pekko] final case class ServiceRegistry(entries: ORMultiMap[ServiceKey[_], Entry]) extends AnyVal {
+@InternalApi private[pekko] final case class ServiceRegistry(entries: ORMultiMap[ServiceKey[?], Entry]) extends AnyVal {
// let's hide all the ugly casts we can in here
def actorRefsFor[T](key: AbstractServiceKey): Set[ActorRef[key.Protocol]] =
@@ -122,7 +122,7 @@ import pekko.cluster.typed.internal.receptionist.ClusterReceptionist.{ DDataKey,
def entriesFor(key: AbstractServiceKey): Set[Entry] =
entries.getOrElse(key.asServiceKey, Set.empty[Entry])
- def keysFor(address: UniqueAddress)(implicit node: SelfUniqueAddress): Set[ServiceKey[_]] =
+ def keysFor(address: UniqueAddress)(implicit node: SelfUniqueAddress): Set[ServiceKey[?]] =
entries.entries.collect {
case (key, entries) if entries.exists(_.uniqueAddress(node.uniqueAddress.address) == address) =>
key
@@ -144,7 +144,7 @@ import pekko.cluster.typed.internal.receptionist.ClusterReceptionist.{ DDataKey,
}
}
- def toORMultiMap: ORMultiMap[ServiceKey[_], Entry] = entries
+ def toORMultiMap: ORMultiMap[ServiceKey[?], Entry] = entries
}
diff --git a/cluster-typed/src/test/scala/docs/org/apache/pekko/cluster/typed/BasicClusterExampleSpec.scala b/cluster-typed/src/test/scala/docs/org/apache/pekko/cluster/typed/BasicClusterExampleSpec.scala
index e994ba5f92..7625095790 100644
--- a/cluster-typed/src/test/scala/docs/org/apache/pekko/cluster/typed/BasicClusterExampleSpec.scala
+++ b/cluster-typed/src/test/scala/docs/org/apache/pekko/cluster/typed/BasicClusterExampleSpec.scala
@@ -67,7 +67,7 @@ pekko {
""").withFallback(configSystem1)
def illustrateJoinSeedNodes(): Unit = {
- val system: ActorSystem[_] = ???
+ val system: ActorSystem[?] = ???
// #join-seed-nodes
import pekko.actor.Address
@@ -82,15 +82,15 @@ pekko {
}
object Backend {
- def apply(): Behavior[_] = Behaviors.empty
+ def apply(): Behavior[?] = Behaviors.empty
}
object Frontend {
- def apply(): Behavior[_] = Behaviors.empty
+ def apply(): Behavior[?] = Behaviors.empty
}
def illustrateRoles(): Unit = {
- val context: ActorContext[_] = ???
+ val context: ActorContext[?] = ???
// #hasRole
val selfMember = Cluster(context.system).selfMember
@@ -104,7 +104,7 @@ pekko {
@nowarn("msg=never used")
def illustrateDcAccess(): Unit = {
- val system: ActorSystem[_] = ???
+ val system: ActorSystem[?] = ???
// #dcAccess
val cluster = Cluster(system)
diff --git a/cluster-typed/src/test/scala/docs/org/apache/pekko/cluster/typed/DistributedPubSubExample.scala b/cluster-typed/src/test/scala/docs/org/apache/pekko/cluster/typed/DistributedPubSubExample.scala
index ca85cb8b58..2b63a1e22f 100644
--- a/cluster-typed/src/test/scala/docs/org/apache/pekko/cluster/typed/DistributedPubSubExample.scala
+++ b/cluster-typed/src/test/scala/docs/org/apache/pekko/cluster/typed/DistributedPubSubExample.scala
@@ -306,13 +306,13 @@ object DistributedPubSubExample {
pekko.loggers = ["org.apache.pekko.testkit.TestEventListener"]
""")
- def createCluster(nodes: List[ActorSystem[_]]): Unit = {
- val clusterUp = (nodes: List[ActorSystem[_]], expected: Int) =>
+ def createCluster(nodes: List[ActorSystem[?]]): Unit = {
+ val clusterUp = (nodes: List[ActorSystem[?]], expected: Int) =>
nodes.forall { s =>
Cluster(s).state.members.count(_.status == MemberStatus.up) == expected
}
- val awaitClusterUp = (nodes: List[ActorSystem[_]], expected: Int) =>
+ val awaitClusterUp = (nodes: List[ActorSystem[?]], expected: Int) =>
while (!clusterUp(nodes, expected)) {
Thread.sleep(1000)
}
diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/GroupRouterSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/GroupRouterSpec.scala
index 449489f2c5..36baf91718 100644
--- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/GroupRouterSpec.scala
+++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/GroupRouterSpec.scala
@@ -47,7 +47,7 @@ object GroupRouterSpec {
""")
object PingActor {
- case class Pong(workerActor: ActorRef[_]) extends CborSerializable
+ case class Pong(workerActor: ActorRef[?]) extends CborSerializable
case class Ping(replyTo: ActorRef[Pong]) extends CborSerializable
def apply(): Behavior[Ping] = Behaviors.receive {
@@ -59,8 +59,8 @@ object GroupRouterSpec {
object Pinger {
sealed trait Command
- private case class SawPong(worker: ActorRef[_]) extends Command
- case class DonePinging(pongs: Int, uniqueWorkers: Set[ActorRef[_]])
+ private case class SawPong(worker: ActorRef[?]) extends Command
+ case class DonePinging(pongs: Int, uniqueWorkers: Set[ActorRef[?]])
def apply(
router: ActorRef[PingActor.Ping],
requestedPings: Int,
@@ -71,7 +71,7 @@ object GroupRouterSpec {
}
(0 to requestedPings).foreach(_ => router ! PingActor.Ping(pongAdapter))
var pongs = 0
- var uniqueWorkers = Set.empty[ActorRef[_]]
+ var uniqueWorkers = Set.empty[ActorRef[?]]
Behaviors.receiveMessage {
case SawPong(worker) =>
diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializerSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializerSpec.scala
index 23b645c4f7..4531c9577b 100644
--- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializerSpec.scala
+++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializerSpec.scala
@@ -66,9 +66,11 @@ class ReliableDeliverySerializerSpec extends ScalaTestWithActorTestKit with AnyW
DurableProducerQueue.MessageSent(15L, "msg15", true, "q4", timestamp),
DurableProducerQueue.MessageSent(16L, "msg16", true, "q4", timestamp))),
"DurableProducerQueue.Cleanup" -> DurableProducerQueue.Cleanup(Set("q1", "q2", "q3")),
- "SequencedMessage-chunked-1" -> ConsumerController.SequencedMessage
+ "SequencedMessage-chunked-1" ->
+ ConsumerController.SequencedMessage
.fromChunked("prod-1", 1L, ChunkedMessage(ByteString.fromString("abc"), true, true, 20, ""), true, true, ref),
- "SequencedMessage-chunked-2" -> ConsumerController.SequencedMessage
+ "SequencedMessage-chunked-2" ->
+ ConsumerController.SequencedMessage
.fromChunked("prod-1", 1L, ChunkedMessage(ByteString(1, 2, 3), true, false, 123456, "A"), false, false, ref),
"DurableProducerQueue.MessageSent-chunked" -> DurableProducerQueue.MessageSent.fromChunked(
3L,
diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/Cluster.scala b/cluster/src/main/scala/org/apache/pekko/cluster/Cluster.scala
index 9314c9b2bc..366db85648 100644
--- a/cluster/src/main/scala/org/apache/pekko/cluster/Cluster.scala
+++ b/cluster/src/main/scala/org/apache/pekko/cluster/Cluster.scala
@@ -268,7 +268,7 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
* A snapshot of [[pekko.cluster.ClusterEvent.CurrentClusterState]]
* will be sent to the subscriber as the first message.
*/
- @varargs def subscribe(subscriber: ActorRef, to: Class[_]*): Unit =
+ @varargs def subscribe(subscriber: ActorRef, to: Class[?]*): Unit =
subscribe(subscriber, initialStateMode = InitialStateAsSnapshot, to: _*)
/**
@@ -286,7 +286,7 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
*
* Note that for large clusters it is more efficient to use `InitialStateAsSnapshot`.
*/
- @varargs def subscribe(subscriber: ActorRef, initialStateMode: SubscriptionInitialStateMode, to: Class[_]*): Unit = {
+ @varargs def subscribe(subscriber: ActorRef, initialStateMode: SubscriptionInitialStateMode, to: Class[?]*): Unit = {
require(to.length > 0, "at least one `ClusterDomainEvent` class is required")
require(
to.forall(classOf[ClusterDomainEvent].isAssignableFrom),
@@ -305,7 +305,7 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
* Unsubscribe to a specific type of cluster domain events,
* matching previous `subscribe` registration.
*/
- def unsubscribe(subscriber: ActorRef, to: Class[_]): Unit =
+ def unsubscribe(subscriber: ActorRef, to: Class[?]): Unit =
clusterCore ! InternalClusterAction.Unsubscribe(subscriber, Some(to))
/**
diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala
index 4f04cb1f90..247664c586 100644
--- a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala
+++ b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala
@@ -177,9 +177,9 @@ private[cluster] object InternalClusterAction {
final case class AddOnMemberRemovedListener(callback: Runnable) extends NoSerializationVerificationNeeded
sealed trait SubscriptionMessage
- final case class Subscribe(subscriber: ActorRef, initialStateMode: SubscriptionInitialStateMode, to: Set[Class[_]])
+ final case class Subscribe(subscriber: ActorRef, initialStateMode: SubscriptionInitialStateMode, to: Set[Class[?]])
extends SubscriptionMessage
- final case class Unsubscribe(subscriber: ActorRef, to: Option[Class[_]])
+ final case class Unsubscribe(subscriber: ActorRef, to: Option[Class[?]])
extends SubscriptionMessage
with DeadLetterSuppression
@@ -911,7 +911,8 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh
def leaving(address: Address): Unit = {
// only try to update if the node is available (in the member ring)
latestGossip.members.find(_.address == address).foreach { existingMember =>
- if (existingMember.status == Joining || existingMember.status == WeaklyUp || existingMember
+ if (existingMember.status == Joining || existingMember.status == WeaklyUp ||
+ existingMember
.status == Up || existingMember.status == PreparingForShutdown || existingMember.status == ReadyForShutdown) {
// mark node as LEAVING
val newMembers = latestGossip.members - existingMember + existingMember.copy(status = Leaving)
@@ -1290,7 +1291,8 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh
} else {
leaderActionCounter += 1
import cluster.settings.{ AllowWeaklyUpMembers, LeaderActionsInterval, WeaklyUpAfter }
- if (AllowWeaklyUpMembers && LeaderActionsInterval * leaderActionCounter >= WeaklyUpAfter && !preparingForShutdown)
+ if (AllowWeaklyUpMembers && LeaderActionsInterval * leaderActionCounter >= WeaklyUpAfter &&
+ !preparingForShutdown)
moveJoiningToWeaklyUp()
if (leaderActionCounter == firstNotice || leaderActionCounter % periodicNotice == 0)
@@ -1316,7 +1318,8 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh
def checkForPrepareForShutdown(): Unit = {
if (MembershipState.allowedToPrepareToShutdown(
- latestGossip.member(selfUniqueAddress).status) && latestGossip.members
+ latestGossip.member(selfUniqueAddress).status) &&
+ latestGossip.members
.exists(m => MembershipState.prepareForShutdownStates(m.status))) {
logDebug("Detected full cluster shutdown")
self ! ClusterUserAction.PrepareForShutdown
diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala
index 5355a94880..40f380e157 100644
--- a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala
+++ b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala
@@ -251,7 +251,8 @@ object ClusterEvent {
override def equals(other: Any): Boolean = other match {
case that: CurrentClusterState =>
- (this eq that) || (members == that.members &&
+ (this eq that) ||
+ (members == that.members &&
unreachable == that.unreachable &&
seenBy == that.seenBy &&
leader == that.leader &&
@@ -729,7 +730,7 @@ private[cluster] final class ClusterDomainEventPublisher
receiver ! state
}
- def subscribe(subscriber: ActorRef, initMode: SubscriptionInitialStateMode, to: Set[Class[_]]): Unit = {
+ def subscribe(subscriber: ActorRef, initMode: SubscriptionInitialStateMode, to: Set[Class[?]]): Unit = {
initMode match {
case InitialStateAsEvents =>
def pub(event: AnyRef): Unit = {
@@ -744,7 +745,7 @@ private[cluster] final class ClusterDomainEventPublisher
to.foreach { eventStream.subscribe(subscriber, _) }
}
- def unsubscribe(subscriber: ActorRef, to: Option[Class[_]]): Unit = to match {
+ def unsubscribe(subscriber: ActorRef, to: Option[Class[?]]): Unit = to match {
case None => eventStream.unsubscribe(subscriber)
case Some(c) => eventStream.unsubscribe(subscriber, c)
}
diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala b/cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala
index 72624215c4..a955e408a3 100644
--- a/cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala
+++ b/cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala
@@ -308,7 +308,8 @@ import pekko.util.ccompat._
latestGossip.members.iterator
.collect {
case m
- if m.dataCenter == state.selfDc && !latestGossip.seenByNode(m.uniqueAddress) && state
+ if m.dataCenter == state.selfDc && !latestGossip.seenByNode(m.uniqueAddress) &&
+ state
.validNodeForGossip(m.uniqueAddress) =>
m.uniqueAddress
}
diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala b/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala
index 38fb002907..3a05b4ed9b 100644
--- a/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala
+++ b/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala
@@ -614,8 +614,7 @@ private[pekko] trait ClusterRouterActor { this: RouterActor =>
}
}
- def isAvailable(m: Member): Boolean =
- (m.status == MemberStatus.Up || m.status == MemberStatus.WeaklyUp) &&
+ def isAvailable(m: Member): Boolean = (m.status == MemberStatus.Up || m.status == MemberStatus.WeaklyUp) &&
satisfiesRoles(m.roles) &&
(settings.allowLocalRoutees || m.address != cluster.selfAddress)
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterAccrualFailureDetectorSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterAccrualFailureDetectorSpec.scala
index 32f6f53514..f71f521242 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterAccrualFailureDetectorSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterAccrualFailureDetectorSpec.scala
@@ -100,7 +100,8 @@ abstract class ClusterAccrualFailureDetectorSpec
enterBarrier("after-2")
}
- "mark node as 'unavailable' if a node in the cluster is shut down (and its heartbeats stops)" taggedAs LongRunningTest in {
+ "mark node as 'unavailable' if a node in the cluster is shut down (and its heartbeats stops)" taggedAs
+ LongRunningTest in {
runOn(first) {
testConductor.exit(third, 0).await
}
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterDeathWatchSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterDeathWatchSpec.scala
index f72df20774..48a1bd2f70 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterDeathWatchSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterDeathWatchSpec.scala
@@ -161,7 +161,8 @@ abstract class ClusterDeathWatchSpec
}
- "not be able to watch an actor before node joins cluster, ClusterRemoteWatcher takes over from RemoteWatcher" in within(
+ "not be able to watch an actor before node joins cluster, ClusterRemoteWatcher takes over from RemoteWatcher" in
+ within(
20.seconds) {
runOn(fifth) {
system.actorOf(
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinInProgressSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinInProgressSpec.scala
index 55bcd1eba6..b174acc4f2 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinInProgressSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinInProgressSpec.scala
@@ -45,7 +45,8 @@ abstract class JoinInProgressSpec extends MultiNodeClusterSpec(JoinInProgressMul
import JoinInProgressMultiJvmSpec._
"A cluster node" must {
- "send heartbeats immediately when joining to avoid false failure detection due to delayed gossip" taggedAs LongRunningTest in {
+ "send heartbeats immediately when joining to avoid false failure detection due to delayed gossip" taggedAs
+ LongRunningTest in {
runOn(first) {
startClusterNode()
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderLeavingSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderLeavingSpec.scala
index 854efbeceb..e17cca8dd3 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderLeavingSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderLeavingSpec.scala
@@ -49,7 +49,8 @@ abstract class LeaderLeavingSpec extends MultiNodeClusterSpec(LeaderLeavingMulti
"A LEADER that is LEAVING" must {
- "be moved to LEAVING, then to EXITING, then to REMOVED, then be shut down and then a new LEADER should be elected" taggedAs LongRunningTest in {
+ "be moved to LEAVING, then to EXITING, then to REMOVED, then be shut down and then a new LEADER should be elected" taggedAs
+ LongRunningTest in {
awaitClusterUp(first, second, third)
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MembershipChangeListenerUpSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MembershipChangeListenerUpSpec.scala
index 49d55cd6f0..11d4e033c4 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MembershipChangeListenerUpSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MembershipChangeListenerUpSpec.scala
@@ -39,7 +39,8 @@ abstract class MembershipChangeListenerUpSpec extends MultiNodeClusterSpec(Membe
"A set of connected cluster systems" must {
- "(when two nodes) after cluster convergence updates the membership table then all MembershipChangeListeners should be triggered" taggedAs LongRunningTest in {
+ "(when two nodes) after cluster convergence updates the membership table then all MembershipChangeListeners should be triggered" taggedAs
+ LongRunningTest in {
awaitClusterUp(first)
@@ -70,7 +71,8 @@ abstract class MembershipChangeListenerUpSpec extends MultiNodeClusterSpec(Membe
enterBarrier("after-1")
}
- "(when three nodes) after cluster convergence updates the membership table then all MembershipChangeListeners should be triggered" taggedAs LongRunningTest in {
+ "(when three nodes) after cluster convergence updates the membership table then all MembershipChangeListeners should be triggered" taggedAs
+ LongRunningTest in {
val latch = TestLatch()
val expectedAddresses = Set(first, second, third).map(address)
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MinMembersBeforeUpSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MinMembersBeforeUpSpec.scala
index 36820f32de..3a1dcabf12 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MinMembersBeforeUpSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MinMembersBeforeUpSpec.scala
@@ -94,7 +94,8 @@ abstract class MinMembersBeforeUpWithWeaklyUpSpec extends MinMembersBeforeUpBase
override def third: RoleName = MinMembersBeforeUpWithWeaklyUpMultiJvmSpec.third
"Cluster leader" must {
- "wait with moving members to UP until minimum number of members have joined with weakly up enabled" taggedAs LongRunningTest in {
+ "wait with moving members to UP until minimum number of members have joined with weakly up enabled" taggedAs
+ LongRunningTest in {
testWaitMovingMembersToUp()
}
}
@@ -107,7 +108,8 @@ abstract class MinMembersOfRoleBeforeUpSpec extends MinMembersBeforeUpBase(MinMe
override def third: RoleName = MinMembersOfRoleBeforeUpMultiJvmSpec.third
"Cluster leader" must {
- "wait with moving members to UP until minimum number of members with specific role have joined" taggedAs LongRunningTest in {
+ "wait with moving members to UP until minimum number of members with specific role have joined" taggedAs
+ LongRunningTest in {
testWaitMovingMembersToUp()
}
}
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSunnyWeatherSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSunnyWeatherSpec.scala
index a144f07eb9..01caf8fd3d 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSunnyWeatherSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSunnyWeatherSpec.scala
@@ -91,8 +91,9 @@ abstract class MultiDcSunnyWeatherSpec extends MultiNodeClusterSpec(MultiDcSunny
val expectedBetaHeartbeaterNodes = takeNOldestMembers(dataCenter = "beta", 2)
val expectedBetaHeartbeaterRoles = membersAsRoles(expectedBetaHeartbeaterNodes)
- val expectedNoActiveHeartbeatSenderRoles = roles.toSet -- (expectedAlphaHeartbeaterRoles.union(
- expectedBetaHeartbeaterRoles))
+ val expectedNoActiveHeartbeatSenderRoles = roles.toSet --
+ (expectedAlphaHeartbeaterRoles.union(
+ expectedBetaHeartbeaterRoles))
enterBarrier("found-expectations")
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeMembershipSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeMembershipSpec.scala
index bf1998fbc4..36a595d9c5 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeMembershipSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeMembershipSpec.scala
@@ -37,7 +37,8 @@ abstract class NodeMembershipSpec extends MultiNodeClusterSpec(NodeMembershipMul
"A set of connected cluster systems" must {
- "(when two nodes) start gossiping to each other so that both nodes gets the same gossip info" taggedAs LongRunningTest in {
+ "(when two nodes) start gossiping to each other so that both nodes gets the same gossip info" taggedAs
+ LongRunningTest in {
// make sure that the node-to-join is started before other join
runOn(first) {
@@ -55,7 +56,8 @@ abstract class NodeMembershipSpec extends MultiNodeClusterSpec(NodeMembershipMul
enterBarrier("after-1")
}
- "(when three nodes) start gossiping to each other so that all nodes gets the same gossip info" taggedAs LongRunningTest in {
+ "(when three nodes) start gossiping to each other so that all nodes gets the same gossip info" taggedAs
+ LongRunningTest in {
runOn(third) {
cluster.join(first)
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainSpec.scala
index a7cbf70c9a..f709e60318 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainSpec.scala
@@ -75,7 +75,8 @@ abstract class SplitBrainSpec(multiNodeConfig: SplitBrainMultiNodeConfig)
enterBarrier("after-1")
}
- "detect network partition and mark nodes on other side as unreachable and form new cluster" taggedAs LongRunningTest in within(
+ "detect network partition and mark nodes on other side as unreachable and form new cluster" taggedAs
+ LongRunningTest in within(
30.seconds) {
enterBarrier("before-split")
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StressSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StressSpec.scala
index 0e9ad19534..172b17ecb7 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StressSpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StressSpec.scala
@@ -144,10 +144,11 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig {
val numberOfNodesJoiningOneByOneLarge = getInt("nr-of-nodes-joining-one-by-one-large") * nFactor
val numberOfNodesJoiningToOneNode = getInt("nr-of-nodes-joining-to-one") * nFactor
// remaining will join to seed nodes
- val numberOfNodesJoiningToSeedNodes = (totalNumberOfNodes - numberOfSeedNodes -
+ val numberOfNodesJoiningToSeedNodes =
+ (totalNumberOfNodes - numberOfSeedNodes -
numberOfNodesJoiningToSeedNodesInitially - numberOfNodesJoiningOneByOneSmall -
numberOfNodesJoiningOneByOneLarge - numberOfNodesJoiningToOneNode)
- .requiring(_ >= 0, s"too many configured nr-of-nodes-joining-*, total should be <= $totalNumberOfNodes")
+ .requiring(_ >= 0, s"too many configured nr-of-nodes-joining-*, total should be <= $totalNumberOfNodes")
val numberOfNodesLeavingOneByOneSmall = getInt("nr-of-nodes-leaving-one-by-one-small") * nFactor
val numberOfNodesLeavingOneByOneLarge = getInt("nr-of-nodes-leaving-one-by-one-large") * nFactor
val numberOfNodesLeaving = getInt("nr-of-nodes-leaving") * nFactor
@@ -165,13 +166,15 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig {
require(
numberOfSeedNodes + numberOfNodesJoiningToSeedNodesInitially + numberOfNodesJoiningOneByOneSmall +
- numberOfNodesJoiningOneByOneLarge + numberOfNodesJoiningToOneNode + numberOfNodesJoiningToSeedNodes <= totalNumberOfNodes,
+ numberOfNodesJoiningOneByOneLarge + numberOfNodesJoiningToOneNode + numberOfNodesJoiningToSeedNodes <=
+ totalNumberOfNodes,
s"specified number of joining nodes <= $totalNumberOfNodes")
// don't shutdown the 3 nodes hosting the master actors
require(
numberOfNodesLeavingOneByOneSmall + numberOfNodesLeavingOneByOneLarge + numberOfNodesLeaving +
- numberOfNodesShutdownOneByOneSmall + numberOfNodesShutdownOneByOneLarge + numberOfNodesShutdown <= totalNumberOfNodes - 3,
+ numberOfNodesShutdownOneByOneSmall + numberOfNodesShutdownOneByOneLarge + numberOfNodesShutdown <=
+ totalNumberOfNodes - 3,
s"""specified number of leaving/shutdown nodes <= ${totalNumberOfNodes - 3}""")
require(
@@ -286,8 +289,7 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig {
log.info("Cluster result history\n" + formatHistory)
}
- def formatHistory: String =
- (formatHistoryHeader +: (history.map(formatHistoryLine))).mkString("\n")
+ def formatHistory: String = (formatHistoryHeader +: (history.map(formatHistoryLine))).mkString("\n")
def formatHistoryHeader: String = "[Title]\t[Duration (ms)]\t[GossipStats(gossip, merge, same, newer, older)]"
diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SurviveNetworkInstabilitySpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SurviveNetworkInstabilitySpec.scala
index 62f170e235..99f476ede2 100644
--- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SurviveNetworkInstabilitySpec.scala
+++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SurviveNetworkInstabilitySpec.scala
@@ -103,7 +103,7 @@ abstract class SurviveNetworkInstabilitySpec
private val remoteSettings = RARP(system).provider.remoteSettings
@nowarn
- def quarantinedEventClass: Class[_] =
+ def quarantinedEventClass: Class[?] =
if (remoteSettings.Artery.Enabled)
classOf[QuarantinedEvent]
else
diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterHeartbeatSenderStateSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterHeartbeatSenderStateSpec.scala
index 936ed35358..d377b79b03 100644
--- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterHeartbeatSenderStateSpec.scala
+++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterHeartbeatSenderStateSpec.scala
@@ -163,8 +163,8 @@ class ClusterHeartbeatSenderStateSpec extends AnyWordSpec with Matchers {
"behave correctly for random operations" in {
val rnd = ThreadLocalRandom.current
- val nodes =
- (1 to rnd.nextInt(10, 200)).map(n => UniqueAddress(Address("pekko", "sys", "n" + n, 7355), n.toLong)).toVector
+ val nodes = (1 to rnd.nextInt(10, 200)).map(n =>
+ UniqueAddress(Address("pekko", "sys", "n" + n, 7355), n.toLong)).toVector
def rndNode() = nodes(rnd.nextInt(0, nodes.size))
val selfUniqueAddress = rndNode()
var state = emptyState(selfUniqueAddress)
diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerSpec.scala
index 3fdff1a557..b0f847965c 100644
--- a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerSpec.scala
+++ b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerSpec.scala
@@ -112,7 +112,8 @@ class JoinConfigCompatCheckerSpec extends PekkoSpec with ClusterTestKit {
}
- "NOT be allowed to join a cluster when one of its required properties are not available on cluster side" taggedAs LongRunningTest in {
+ "NOT be allowed to join a cluster when one of its required properties are not available on cluster side" taggedAs
+ LongRunningTest in {
// this config is NOT compatible with the cluster config
// because there is one missing required configuration property.
@@ -153,7 +154,8 @@ class JoinConfigCompatCheckerSpec extends PekkoSpec with ClusterTestKit {
}
- "NOT be allowed to join a cluster when one of the cluster required properties are not available on the joining side" taggedAs LongRunningTest in {
+ "NOT be allowed to join a cluster when one of the cluster required properties are not available on the joining side" taggedAs
+ LongRunningTest in {
// this config is NOT compatible with the cluster config
// because there is one missing required configuration property.
@@ -190,7 +192,8 @@ class JoinConfigCompatCheckerSpec extends PekkoSpec with ClusterTestKit {
}
- "be allowed to join a cluster when one of its required properties are not available on cluster side but it's configured to NOT enforce it" taggedAs LongRunningTest in {
+ "be allowed to join a cluster when one of its required properties are not available on cluster side but it's configured to NOT enforce it" taggedAs
+ LongRunningTest in {
// this config is NOT compatible with the cluster config
// because there is one missing required configuration property.
@@ -228,7 +231,8 @@ class JoinConfigCompatCheckerSpec extends PekkoSpec with ClusterTestKit {
}
- "be allowed to join a cluster when its configuration is incompatible but it's configured to NOT enforce it" taggedAs LongRunningTest in {
+ "be allowed to join a cluster when its configuration is incompatible but it's configured to NOT enforce it" taggedAs
+ LongRunningTest in {
// this config is NOT compatible with the cluster config,
// but node will ignore the the config check and join anyway
val joinNodeConfig =
@@ -263,7 +267,8 @@ class JoinConfigCompatCheckerSpec extends PekkoSpec with ClusterTestKit {
}
/** This test verifies the built-in JoinConfigCompatCheckerPekkoCluster */
- "NOT be allowed to join a cluster using a different value for pekko.cluster.downing-provider-class" taggedAs LongRunningTest in {
+ "NOT be allowed to join a cluster using a different value for pekko.cluster.downing-provider-class" taggedAs
+ LongRunningTest in {
val joinNodeConfig =
ConfigFactory.parseString("""
@@ -372,7 +377,8 @@ class JoinConfigCompatCheckerSpec extends PekkoSpec with ClusterTestKit {
}
- "NOT be allowed to re-join a cluster when one of its required properties are not available on cluster side" taggedAs LongRunningTest in {
+ "NOT be allowed to re-join a cluster when one of its required properties are not available on cluster side" taggedAs
+ LongRunningTest in {
// this config is NOT compatible with the cluster config
// because there is one missing required configuration property.
@@ -420,7 +426,8 @@ class JoinConfigCompatCheckerSpec extends PekkoSpec with ClusterTestKit {
}
- "NOT be allowed to re-join a cluster when one of the cluster required properties are not available on the joining side" taggedAs LongRunningTest in {
+ "NOT be allowed to re-join a cluster when one of the cluster required properties are not available on the joining side" taggedAs
+ LongRunningTest in {
// this config is NOT compatible with the cluster config
// because there is one missing required configuration property.
@@ -464,7 +471,8 @@ class JoinConfigCompatCheckerSpec extends PekkoSpec with ClusterTestKit {
}
- "be allowed to re-join a cluster when one of its required properties are not available on cluster side but it's configured to NOT enforce it" taggedAs LongRunningTest in {
+ "be allowed to re-join a cluster when one of its required properties are not available on cluster side but it's configured to NOT enforce it" taggedAs
+ LongRunningTest in {
// this config is NOT compatible with the cluster config
// because there is one missing required configuration property.
@@ -512,7 +520,8 @@ class JoinConfigCompatCheckerSpec extends PekkoSpec with ClusterTestKit {
}
- "be allowed to re-join a cluster when its configuration is incompatible but it's configured to NOT enforce it" taggedAs LongRunningTest in {
+ "be allowed to re-join a cluster when its configuration is incompatible but it's configured to NOT enforce it" taggedAs
+ LongRunningTest in {
// this config is NOT compatible with the cluster config,
// but node will ignore the the config check and join anyway
val joinNodeConfig =
diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilityPerfSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilityPerfSpec.scala
index f8f096c314..d5283ccc1b 100644
--- a/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilityPerfSpec.scala
+++ b/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilityPerfSpec.scala
@@ -28,14 +28,13 @@ class ReachabilityPerfSpec extends AnyWordSpec with Matchers {
val address = Address("pekko", "sys", "a", 7355)
val node = Address("pekko", "sys", "a", 7355)
- private def createReachabilityOfSize(base: Reachability, size: Int): Reachability =
- (1 to size).foldLeft(base) {
- case (r, i) =>
- val observer = UniqueAddress(address.copy(host = Some("node-" + i)), i.toLong)
- val j = if (i == size) 1 else i + 1
- val subject = UniqueAddress(address.copy(host = Some("node-" + j)), j.toLong)
- r.unreachable(observer, subject).reachable(observer, subject)
- }
+ private def createReachabilityOfSize(base: Reachability, size: Int): Reachability = (1 to size).foldLeft(base) {
+ case (r, i) =>
+ val observer = UniqueAddress(address.copy(host = Some("node-" + i)), i.toLong)
+ val j = if (i == size) 1 else i + 1
+ val subject = UniqueAddress(address.copy(host = Some("node-" + j)), j.toLong)
+ r.unreachable(observer, subject).reachable(observer, subject)
+ }
@nowarn
private def addUnreachable(base: Reachability, count: Int): Reachability = {
diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/StartupWithOneThreadSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/StartupWithOneThreadSpec.scala
index fc68d1564d..9cdde255aa 100644
--- a/cluster/src/test/scala/org/apache/pekko/cluster/StartupWithOneThreadSpec.scala
+++ b/cluster/src/test/scala/org/apache/pekko/cluster/StartupWithOneThreadSpec.scala
@@ -66,14 +66,16 @@ class StartupWithOneThreadSpec(startTime: Long) extends PekkoSpec(StartupWithOne
// dispatcher threads.
// Note that the Cluster extension is started via ClusterActorRefProvider
// before ActorSystem.apply returns, i.e. in the constructor of PekkoSpec.
- (System.nanoTime - startTime).nanos.toMillis should be <
+ (System.nanoTime - startTime).nanos.toMillis should
+ be <
(system.settings.CreationTimeout.duration - 2.second).toMillis
system.actorOf(testProps) ! "hello"
system.actorOf(testProps) ! "hello"
system.actorOf(testProps) ! "hello"
Cluster(system)
- (System.nanoTime - startTime).nanos.toMillis should be <
+ (System.nanoTime - startTime).nanos.toMillis should
+ be <
(system.settings.CreationTimeout.duration - 2.second).toMillis
expectMsg("hello")
diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/VectorClockPerfSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/VectorClockPerfSpec.scala
index 350aacb33f..e160056610 100644
--- a/cluster/src/test/scala/org/apache/pekko/cluster/VectorClockPerfSpec.scala
+++ b/cluster/src/test/scala/org/apache/pekko/cluster/VectorClockPerfSpec.scala
@@ -21,12 +21,12 @@ import org.scalatest.wordspec.AnyWordSpec
object VectorClockPerfSpec {
import VectorClock._
- def createVectorClockOfSize(size: Int): (VectorClock, SortedSet[Node]) =
- (1 to size).foldLeft((VectorClock(), SortedSet.empty[Node])) {
- case ((vc, nodes), i) =>
- val node = Node(i.toString)
- (vc :+ node, nodes + node)
- }
+ def createVectorClockOfSize(
+ size: Int): (VectorClock, SortedSet[Node]) = (1 to size).foldLeft((VectorClock(), SortedSet.empty[Node])) {
+ case ((vc, nodes), i) =>
+ val node = Node(i.toString)
+ (vc :+ node, nodes + node)
+ }
def copyVectorClock(vc: VectorClock): VectorClock = {
val versions = vc.versions.foldLeft(TreeMap.empty[Node, Long]) {
diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSpec.scala
index 93a1c5344d..54acdee794 100644
--- a/cluster/src/test/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSpec.scala
+++ b/cluster/src/test/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSpec.scala
@@ -514,7 +514,8 @@ class SplitBrainResolverSpec
assertDowningSide(side2, Set(memberB, memberC, memberD, memberE))
}
- "down indirectly connected on minority side, when combined with clean partition: {A, (B, C)} | {D, E, F, G} => {D, E, F, G}" in new Setup2(
+ "down indirectly connected on minority side, when combined with clean partition: {A, (B, C)} | {D, E, F, G} => {D, E, F, G}" in
+ new Setup2(
role = None) {
side1 = Set(memberA, memberB, memberC)
side2 = Set(memberD, memberE, memberF, memberG)
@@ -534,7 +535,8 @@ class SplitBrainResolverSpec
assertDowningSide(side2, Set(memberA, memberB, memberC))
}
- "down indirectly connected on majority side, when combined with clean partition: {A, B, C} | {(D, E), F, G} => {F, G}" in new Setup2(
+ "down indirectly connected on majority side, when combined with clean partition: {A, B, C} | {(D, E), F, G} => {F, G}" in
+ new Setup2(
role = None) {
side1 = Set(memberA, memberB, memberC)
side2 = Set(memberD, memberE, memberF, memberG)
@@ -568,7 +570,8 @@ class SplitBrainResolverSpec
assertDowningSide(side2, Set(memberA, memberB, memberC, memberE, memberF))
}
- "down indirectly connected, detected via seen, combined with clean partition: {A, B, C} | {(D, E), (F, G)} => {}" in new Setup2(
+ "down indirectly connected, detected via seen, combined with clean partition: {A, B, C} | {(D, E), (F, G)} => {}" in
+ new Setup2(
role = None) {
side1 = Set(memberA, memberB, memberC)
side2 = Set(memberD, memberE, memberF, memberG)
@@ -581,7 +584,8 @@ class SplitBrainResolverSpec
assertDowningSide(side2, Set(memberA, memberB, memberC, memberD, memberE, memberF, memberG))
}
- "double DownIndirectlyConnected when indirectly connected happens before clean partition: {A, B, C} | {(D, E), (F, G)} => {}" in new Setup2(
+ "double DownIndirectlyConnected when indirectly connected happens before clean partition: {A, B, C} | {(D, E), (F, G)} => {}" in
+ new Setup2(
role = None) {
side1 = Set(memberA, memberB, memberC)
side2 = Set(memberD, memberE, memberF, memberG)
@@ -774,7 +778,8 @@ class SplitBrainResolverSpec
assertDowning(Set(memberA, memberB))
}
- "down indirectly connected on younger side, when combined with clean partition: {A, (B, C)} | {D, E, F, G} => {D, E, F, G}" in new Setup2 {
+ "down indirectly connected on younger side, when combined with clean partition: {A, (B, C)} | {D, E, F, G} => {D, E, F, G}" in
+ new Setup2 {
side1 = Set(memberA, memberB, memberC)
side2 = Set(memberD, memberE, memberF, memberG)
indirectlyConnected = List(memberB -> memberC, memberC -> memberB)
@@ -793,7 +798,8 @@ class SplitBrainResolverSpec
assertDowningSide(side2, Set(memberA, memberB, memberC))
}
- "down indirectly connected on oldest side, when combined with clean partition: {A, B, C} | {(D, E), F, G} => {F, G}" in new Setup2 {
+ "down indirectly connected on oldest side, when combined with clean partition: {A, B, C} | {(D, E), F, G} => {F, G}" in
+ new Setup2 {
side1 = Set(memberA, memberB, memberC)
side2 = Set(memberD, memberE, memberF, memberG)
@@ -950,7 +956,8 @@ class SplitBrainResolverSpec
strategy3.nodesToDown(reverseDecision3) should ===(Set(memberB, memberC, memberD, memberE).map(_.uniqueAddress))
}
- "down indirectly connected to already downed node during partition: {A, B, C, D} | {(E, F)} => {A, B, C, D}" in new Setup2(
+ "down indirectly connected to already downed node during partition: {A, B, C, D} | {(E, F)} => {A, B, C, D}" in
+ new Setup2(
role = None) {
val memberELeaving = leaving(memberE)
val memberFDown = downed(memberF)
diff --git a/coordination/src/main/scala/org/apache/pekko/coordination/lease/scaladsl/LeaseProvider.scala b/coordination/src/main/scala/org/apache/pekko/coordination/lease/scaladsl/LeaseProvider.scala
index 22c9e20484..ddf770a7fb 100644
--- a/coordination/src/main/scala/org/apache/pekko/coordination/lease/scaladsl/LeaseProvider.scala
+++ b/coordination/src/main/scala/org/apache/pekko/coordination/lease/scaladsl/LeaseProvider.scala
@@ -116,7 +116,7 @@ final class LeaseProvider(system: ExtendedActorSystem) extends Extension {
s
case Failure(_: NoSuchMethodException) =>
dynamicAccess.createInstanceFor[T](fqcn, immutable.Seq((classOf[LeaseSettings], leaseSettings)))
- case f: Failure[_] =>
+ case f: Failure[?] =>
f
}
diff --git a/distributed-data/src/main/scala-3/org/apache/pekko/cluster/ddata/GSet.scala b/distributed-data/src/main/scala-3/org/apache/pekko/cluster/ddata/GSet.scala
index d6fb966ab1..116a8bf00d 100644
--- a/distributed-data/src/main/scala-3/org/apache/pekko/cluster/ddata/GSet.scala
+++ b/distributed-data/src/main/scala-3/org/apache/pekko/cluster/ddata/GSet.scala
@@ -52,7 +52,7 @@ final case class GSet[A] private (elements: Set[A])(override val delta: Option[G
* Java API
*/
def getElements(): java.util.Set[A] = {
- import org.apache.pekko.util.ccompat.JavaConverters._
+ import org.apache.pekko.util.ccompat.JavaConverters.*
elements.asJava
}
@@ -79,8 +79,8 @@ final case class GSet[A] private (elements: Set[A])(override val delta: Option[G
}
override def merge(that: GSet[A]): GSet[A] =
- if ((this eq that) || that.isAncestorOf(this)) this.clearAncestor()
- else if (this.isAncestorOf(that)) that.clearAncestor()
+ if (this eq that) || that.isAncestorOf(this) then this.clearAncestor()
+ else if this.isAncestorOf(that) then that.clearAncestor()
else {
clearAncestor()
new GSet[A](elements.union(that.elements))(None)
@@ -91,7 +91,7 @@ final case class GSet[A] private (elements: Set[A])(override val delta: Option[G
override def zero: GSet[A] = GSet.empty
override def resetDelta: GSet[A] =
- if (delta.isEmpty) this
+ if delta.isEmpty then this
else assignAncestor(new GSet[A](elements)(None))
override def toString: String = s"G$elements"
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Key.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Key.scala
index 1a3dca332d..8618f25580 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Key.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Key.scala
@@ -18,7 +18,7 @@ object Key {
/**
* Extract the [[Key#id]].
*/
- def unapply(k: Key[_]): Option[String] = Some(k.id)
+ def unapply(k: Key[?]): Option[String] = Some(k.id)
private[pekko] type KeyR = Key[ReplicatedData]
@@ -37,7 +37,7 @@ object Key {
abstract class Key[+T <: ReplicatedData](val id: Key.KeyId) extends Serializable {
override final def equals(o: Any): Boolean = o match {
- case k: Key[_] => id == k.id
+ case k: Key[?] => id == k.id
case _ => false
}
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/LWWMap.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/LWWMap.scala
index 13fe25345c..abcad716ac 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/LWWMap.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/LWWMap.scala
@@ -213,7 +213,7 @@ final class LWWMap[A, B] private[pekko] (private[pekko] val underlying: ORMap[A,
override def toString: String = s"LWW$entries" // e.g. LWWMap(a -> 1, b -> 2)
override def equals(o: Any): Boolean = o match {
- case other: LWWMap[_, _] => underlying == other.underlying
+ case other: LWWMap[?, ?] => underlying == other.underlying
case _ => false
}
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/LWWRegister.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/LWWRegister.scala
index d53f561f68..381f446889 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/LWWRegister.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/LWWRegister.scala
@@ -213,7 +213,7 @@ final class LWWRegister[A] private[pekko] (private[pekko] val node: UniqueAddres
override def toString: String = s"LWWRegister($value)"
override def equals(o: Any): Boolean = o match {
- case other: LWWRegister[_] =>
+ case other: LWWRegister[?] =>
timestamp == other.timestamp && value == other.value && node == other.node
case _ => false
}
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMap.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMap.scala
index 70b66681bd..133a27b162 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMap.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMap.scala
@@ -70,7 +70,7 @@ object ORMap {
def zeroTag: ZeroTag
override def zero: DeltaReplicatedData = zeroTag.zero
override def merge(that: DeltaOp): DeltaOp = that match {
- case other: AtomicDeltaOp[_, _] => DeltaGroup(Vector(this, other))
+ case other: AtomicDeltaOp[?, ?] => DeltaGroup(Vector(this, other))
case DeltaGroup(ops) => DeltaGroup(this +: ops)
}
override def deltaSize: Int = 1
@@ -84,9 +84,9 @@ object ORMap {
zeroTag: ZeroTag)
extends AtomicDeltaOp[A, B] {
override def merge(that: DeltaOp): DeltaOp = that match {
- case put: PutDeltaOp[_, _] if this.value._1 == put.value._1 =>
+ case put: PutDeltaOp[?, ?] if this.value._1 == put.value._1 =>
new PutDeltaOp[A, B](this.underlying.merge(put.underlying), put.asInstanceOf[PutDeltaOp[A, B]].value, zeroTag)
- case update: UpdateDeltaOp[_, _]
+ case update: UpdateDeltaOp[?, ?]
if update.values.size == 1 && update.asInstanceOf[UpdateDeltaOp[A, B]].values.contains(this.value._1) =>
val (key, elem1) = this.value
val newValue = elem1 match {
@@ -98,7 +98,7 @@ object ORMap {
(key, elem1.merge(elem2).asInstanceOf[B])
}
new PutDeltaOp[A, B](this.underlying.merge(update.underlying), newValue, zeroTag)
- case other: AtomicDeltaOp[_, _] => DeltaGroup(Vector(this, other))
+ case other: AtomicDeltaOp[?, ?] => DeltaGroup(Vector(this, other))
case DeltaGroup(ops) => DeltaGroup(this +: ops)
}
}
@@ -111,7 +111,7 @@ object ORMap {
zeroTag: ZeroTag)
extends AtomicDeltaOp[A, B] {
override def merge(that: DeltaOp): DeltaOp = that match {
- case update: UpdateDeltaOp[_, _] =>
+ case update: UpdateDeltaOp[?, ?] =>
new UpdateDeltaOp[A, B](
this.underlying.merge(update.underlying),
update.asInstanceOf[UpdateDeltaOp[A, B]].values.foldLeft(this.values) { (map, pair) =>
@@ -123,10 +123,10 @@ object ORMap {
} else map + pair
},
zeroTag)
- case put: PutDeltaOp[_, _]
+ case put: PutDeltaOp[?, ?]
if this.values.size == 1 && this.values.contains(put.asInstanceOf[PutDeltaOp[A, B]].value._1) =>
new PutDeltaOp[A, B](this.underlying.merge(put.underlying), put.asInstanceOf[PutDeltaOp[A, B]].value, zeroTag)
- case other: AtomicDeltaOp[_, _] => DeltaGroup(Vector(this, other))
+ case other: AtomicDeltaOp[?, ?] => DeltaGroup(Vector(this, other))
case DeltaGroup(ops) => DeltaGroup(this +: ops)
}
}
@@ -152,18 +152,18 @@ object ORMap {
extends DeltaOp
with ReplicatedDeltaSize {
override def merge(that: DeltaOp): DeltaOp = that match {
- case that: AtomicDeltaOp[_, _] =>
+ case that: AtomicDeltaOp[?, ?] =>
ops.last match {
- case thisPut: PutDeltaOp[_, _] =>
+ case thisPut: PutDeltaOp[?, ?] =>
val merged = thisPut.merge(that)
merged match {
- case op: AtomicDeltaOp[_, _] => DeltaGroup(ops.dropRight(1) :+ op)
+ case op: AtomicDeltaOp[?, ?] => DeltaGroup(ops.dropRight(1) :+ op)
case DeltaGroup(thatOps) => DeltaGroup(ops.dropRight(1) ++ thatOps)
}
- case thisUpdate: UpdateDeltaOp[_, _] =>
+ case thisUpdate: UpdateDeltaOp[?, ?] =>
val merged = thisUpdate.merge(that)
merged match {
- case op: AtomicDeltaOp[_, _] => DeltaGroup(ops.dropRight(1) :+ op)
+ case op: AtomicDeltaOp[?, ?] => DeltaGroup(ops.dropRight(1) :+ op)
case DeltaGroup(thatOps) => DeltaGroup(ops.dropRight(1) ++ thatOps)
}
case _ => DeltaGroup(ops :+ that)
@@ -266,7 +266,7 @@ final class ORMap[A, B <: ReplicatedData] private[pekko] (
* INTERNAL API
*/
@InternalApi private[pekko] def put(node: UniqueAddress, key: A, value: B): ORMap[A, B] =
- if (value.isInstanceOf[ORSet[_]] && values.contains(key))
+ if (value.isInstanceOf[ORSet[?]] && values.contains(key))
throw new IllegalArgumentException(
"`ORMap.put` must not be used to replace an existing `ORSet` " +
"value, because important history can be lost when replacing the `ORSet` and " +
@@ -449,32 +449,34 @@ final class ORMap[A, B <: ReplicatedData] private[pekko] (
}
val processDelta: PartialFunction[ORMap.DeltaOp, Unit] = {
- case putOp: PutDeltaOp[_, _] =>
+ case putOp: PutDeltaOp[?, ?] =>
val keyDelta = putOp.underlying
mergedKeys = mergedKeys.mergeDelta(keyDelta)
- mergedValues = mergedValues + putOp
- .asInstanceOf[PutDeltaOp[A, B]]
- .value // put is destructive and propagates only full values of B!
- case removeOp: RemoveDeltaOp[_, _] =>
+ mergedValues = mergedValues +
+ putOp
+ .asInstanceOf[PutDeltaOp[A, B]]
+ .value // put is destructive and propagates only full values of B!
+ case removeOp: RemoveDeltaOp[?, ?] =>
val removedKey = removeOp.underlying match {
// if op is RemoveDeltaOp then it must have exactly one element in the elements
- case op: ORSet.RemoveDeltaOp[_] => op.underlying.elements.head.asInstanceOf[A]
+ case op: ORSet.RemoveDeltaOp[?] => op.underlying.elements.head.asInstanceOf[A]
case _ => throw new IllegalArgumentException("ORMap.RemoveDeltaOp must contain ORSet.RemoveDeltaOp inside")
}
mergedValues = mergedValues - removedKey
mergedKeys = mergedKeys.mergeDelta(removeOp.underlying)
// please note that if RemoveDeltaOp is not preceded by update clearing the value
// anomalies may result
- case removeKeyOp: RemoveKeyDeltaOp[_, _] =>
+ case removeKeyOp: RemoveKeyDeltaOp[?, ?] =>
// removeKeyOp tombstones values for later use
if (mergedValues.contains(removeKeyOp.asInstanceOf[RemoveKeyDeltaOp[A, B]].removedKey)) {
- tombstonedVals = tombstonedVals + (removeKeyOp
- .asInstanceOf[RemoveKeyDeltaOp[A, B]]
- .removedKey -> mergedValues(removeKeyOp.asInstanceOf[RemoveKeyDeltaOp[A, B]].removedKey))
+ tombstonedVals = tombstonedVals +
+ (removeKeyOp
+ .asInstanceOf[RemoveKeyDeltaOp[A, B]]
+ .removedKey -> mergedValues(removeKeyOp.asInstanceOf[RemoveKeyDeltaOp[A, B]].removedKey))
}
mergedValues = mergedValues - removeKeyOp.asInstanceOf[RemoveKeyDeltaOp[A, B]].removedKey
mergedKeys = mergedKeys.mergeDelta(removeKeyOp.underlying)
- case updateOp: UpdateDeltaOp[_, _] =>
+ case updateOp: UpdateDeltaOp[?, ?] =>
mergedKeys = mergedKeys.mergeDelta(updateOp.underlying)
updateOp.asInstanceOf[UpdateDeltaOp[A, B]].values.foreach {
case (key, value) =>
@@ -574,7 +576,7 @@ final class ORMap[A, B <: ReplicatedData] private[pekko] (
override def toString: String = s"OR$entries"
override def equals(o: Any): Boolean = o match {
- case other: ORMap[_, _] => keys == other.keys && values == other.values
+ case other: ORMap[?, ?] => keys == other.keys && values == other.values
case _ => false
}
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMultiMap.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMultiMap.scala
index 36c3eb4ef5..1bc6cd8b33 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMultiMap.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMultiMap.scala
@@ -362,7 +362,7 @@ final class ORMultiMap[A, B] private[pekko] (
override def toString: String = s"ORMulti$entries"
override def equals(o: Any): Boolean = o match {
- case other: ORMultiMap[_, _] => underlying == other.underlying
+ case other: ORMultiMap[?, ?] => underlying == other.underlying
case _ => false
}
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala
index 25ec5dfb15..9a0f852390 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala
@@ -89,7 +89,7 @@ object ORSet {
// Note that we only merge deltas originating from the same node
AddDeltaOp(
new ORSet(concatElementsMap(u.elementsMap.asInstanceOf[Map[A, Dot]]), underlying.vvector.merge(u.vvector)))
- case _: AtomicDeltaOp[_] => DeltaGroup(Vector(this, that))
+ case _: AtomicDeltaOp[?] => DeltaGroup(Vector(this, that))
case DeltaGroup(ops) => DeltaGroup(this +: ops)
}
@@ -108,7 +108,7 @@ object ORSet {
throw new IllegalArgumentException(s"RemoveDeltaOp should contain one removed element, but was $underlying")
override def merge(that: DeltaOp): DeltaOp = that match {
- case _: AtomicDeltaOp[_] => DeltaGroup(Vector(this, that)) // keep it simple for removals
+ case _: AtomicDeltaOp[?] => DeltaGroup(Vector(this, that)) // keep it simple for removals
case DeltaGroup(ops) => DeltaGroup(this +: ops)
}
}
@@ -116,7 +116,7 @@ object ORSet {
/** INTERNAL API: Used for `clear` but could be used for other cases also */
@InternalApi private[pekko] final case class FullStateDeltaOp[A](underlying: ORSet[A]) extends AtomicDeltaOp[A] {
override def merge(that: DeltaOp): DeltaOp = that match {
- case _: AtomicDeltaOp[_] => DeltaGroup(Vector(this, that))
+ case _: AtomicDeltaOp[?] => DeltaGroup(Vector(this, that))
case DeltaGroup(ops) => DeltaGroup(this +: ops)
}
}
@@ -128,10 +128,10 @@ object ORSet {
extends DeltaOp
with ReplicatedDeltaSize {
override def merge(that: DeltaOp): DeltaOp = that match {
- case thatAdd: AddDeltaOp[_] =>
+ case thatAdd: AddDeltaOp[?] =>
// merge AddDeltaOp into last AddDeltaOp in the group, if possible
ops.last match {
- case thisAdd: AddDeltaOp[_] => DeltaGroup(ops.dropRight(1) :+ thisAdd.merge(thatAdd))
+ case thisAdd: AddDeltaOp[?] => DeltaGroup(ops.dropRight(1) :+ thisAdd.merge(thatAdd))
case _ => DeltaGroup(ops :+ thatAdd)
}
case DeltaGroup(thatOps) => DeltaGroup(ops ++ thatOps)
@@ -369,7 +369,7 @@ final class ORSet[A] private[pekko] (
val newDelta = delta match {
case None =>
ORSet.AddDeltaOp(new ORSet(Map(element -> newDot), newDot))
- case Some(existing: ORSet.AddDeltaOp[_]) =>
+ case Some(existing: ORSet.AddDeltaOp[?]) =>
existing.merge(ORSet.AddDeltaOp(new ORSet(Map(element -> newDot), newDot)))
case Some(d) =>
d.merge(ORSet.AddDeltaOp(new ORSet(Map(element -> newDot), newDot)))
@@ -482,18 +482,18 @@ final class ORSet[A] private[pekko] (
override def mergeDelta(thatDelta: ORSet.DeltaOp): ORSet[A] = {
thatDelta match {
- case d: ORSet.AddDeltaOp[_] => dryMerge(d.asInstanceOf[ORSet.AddDeltaOp[A]].underlying, addDeltaOp = true)
- case d: ORSet.RemoveDeltaOp[_] => mergeRemoveDelta(d.asInstanceOf[ORSet.RemoveDeltaOp[A]])
- case d: ORSet.FullStateDeltaOp[_] =>
+ case d: ORSet.AddDeltaOp[?] => dryMerge(d.asInstanceOf[ORSet.AddDeltaOp[A]].underlying, addDeltaOp = true)
+ case d: ORSet.RemoveDeltaOp[?] => mergeRemoveDelta(d.asInstanceOf[ORSet.RemoveDeltaOp[A]])
+ case d: ORSet.FullStateDeltaOp[?] =>
dryMerge(d.asInstanceOf[ORSet.FullStateDeltaOp[A]].underlying, addDeltaOp = false)
case ORSet.DeltaGroup(ops) =>
ops.foldLeft(this) {
- case (acc, op: ORSet.AddDeltaOp[_]) =>
+ case (acc, op: ORSet.AddDeltaOp[?]) =>
acc.dryMerge(op.asInstanceOf[ORSet.AddDeltaOp[A]].underlying, addDeltaOp = true)
- case (acc, op: ORSet.RemoveDeltaOp[_]) => acc.mergeRemoveDelta(op.asInstanceOf[ORSet.RemoveDeltaOp[A]])
- case (acc, op: ORSet.FullStateDeltaOp[_]) =>
+ case (acc, op: ORSet.RemoveDeltaOp[?]) => acc.mergeRemoveDelta(op.asInstanceOf[ORSet.RemoveDeltaOp[A]])
+ case (acc, op: ORSet.FullStateDeltaOp[?]) =>
acc.dryMerge(op.asInstanceOf[ORSet.FullStateDeltaOp[A]].underlying, addDeltaOp = false)
- case (_, _: ORSet.DeltaGroup[_]) =>
+ case (_, _: ORSet.DeltaGroup[?]) =>
throw new IllegalArgumentException("ORSet.DeltaGroup should not be nested")
}
}
@@ -578,7 +578,7 @@ final class ORSet[A] private[pekko] (
override def toString: String = s"OR$elements"
override def equals(o: Any): Boolean = o match {
- case other: ORSet[_] => vvector == other.vvector && elementsMap == other.elementsMap
+ case other: ORSet[?] => vvector == other.vvector && elementsMap == other.elementsMap
case _ => false
}
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/PNCounterMap.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/PNCounterMap.scala
index b4357f47bd..fa64d53ca0 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/PNCounterMap.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/PNCounterMap.scala
@@ -199,7 +199,7 @@ final class PNCounterMap[A] private[pekko] (private[pekko] val underlying: ORMap
override def toString: String = s"PNCounter$entries"
override def equals(o: Any): Boolean = o match {
- case other: PNCounterMap[_] => underlying == other.underlying
+ case other: PNCounterMap[?] => underlying == other.underlying
case _ => false
}
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala
index 0a78b959cb..b516fd0682 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala
@@ -2020,7 +2020,8 @@ final class Replicator(settings: ReplicatorSettings) extends Actor with ActorLog
}
def isNodeRemoved(node: UniqueAddress, keys: Iterable[KeyId]): Boolean = {
- removedNodes.contains(node) || (keys.exists(key =>
+ removedNodes.contains(node) ||
+ (keys.exists(key =>
dataEntries.get(key) match {
case Some((DataEnvelope(_, pruning, _), _)) => pruning.contains(node)
case None => false
@@ -2675,10 +2676,10 @@ final class Replicator(settings: ReplicatorSettings) extends Actor with ActorLog
// Try again with the full state
sender() ! writeMsg
- case _: Replicator.UpdateSuccess[_] =>
+ case _: Replicator.UpdateSuccess[?] =>
gotLocalStoreReply = true
if (isDone) reply(isTimeout = false)
- case _: Replicator.StoreFailure[_] =>
+ case _: Replicator.StoreFailure[?] =>
gotLocalStoreReply = true
gotWriteNackFrom += selfUniqueAddress.address
if (isDone) reply(isTimeout = false)
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/VersionVector.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/VersionVector.scala
index 2d438207b1..efed1c615c 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/VersionVector.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/VersionVector.scala
@@ -405,7 +405,7 @@ final case class ManyVersionVector(versions: TreeMap[UniqueAddress, Long]) exten
else this
override def toString: String =
- versions.map { case ((n, v)) => n.toString + " -> " + v }.mkString("VersionVector(", ", ", ")")
+ versions.map { case (n, v) => n.toString + " -> " + v }.mkString("VersionVector(", ", ", ")")
/** INTERNAL API */
@InternalApi override private[pekko] def estimatedSize: Int =
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala
index fd53bc2b74..1f42559510 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala
@@ -339,67 +339,67 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
ORMultiMapKeyManifest -> (bytes => ORMultiMapKey(keyIdFromBinary(bytes))))
override def manifest(obj: AnyRef): String = obj match {
- case _: ORSet[_] => ORSetManifest
- case _: ORSet.AddDeltaOp[_] => ORSetAddManifest
- case _: ORSet.RemoveDeltaOp[_] => ORSetRemoveManifest
- case _: GSet[_] => GSetManifest
+ case _: ORSet[?] => ORSetManifest
+ case _: ORSet.AddDeltaOp[?] => ORSetAddManifest
+ case _: ORSet.RemoveDeltaOp[?] => ORSetRemoveManifest
+ case _: GSet[?] => GSetManifest
case _: GCounter => GCounterManifest
case _: PNCounter => PNCounterManifest
case _: Flag => FlagManifest
- case _: LWWRegister[_] => LWWRegisterManifest
- case _: ORMap[_, _] => ORMapManifest
- case _: ORMap.PutDeltaOp[_, _] => ORMapPutManifest
- case _: ORMap.RemoveDeltaOp[_, _] => ORMapRemoveManifest
- case _: ORMap.RemoveKeyDeltaOp[_, _] => ORMapRemoveKeyManifest
- case _: ORMap.UpdateDeltaOp[_, _] => ORMapUpdateManifest
- case _: LWWMap[_, _] => LWWMapManifest
- case _: PNCounterMap[_] => PNCounterMapManifest
- case _: ORMultiMap[_, _] => ORMultiMapManifest
+ case _: LWWRegister[?] => LWWRegisterManifest
+ case _: ORMap[?, ?] => ORMapManifest
+ case _: ORMap.PutDeltaOp[?, ?] => ORMapPutManifest
+ case _: ORMap.RemoveDeltaOp[?, ?] => ORMapRemoveManifest
+ case _: ORMap.RemoveKeyDeltaOp[?, ?] => ORMapRemoveKeyManifest
+ case _: ORMap.UpdateDeltaOp[?, ?] => ORMapUpdateManifest
+ case _: LWWMap[?, ?] => LWWMapManifest
+ case _: PNCounterMap[?] => PNCounterMapManifest
+ case _: ORMultiMap[?, ?] => ORMultiMapManifest
case DeletedData => DeletedDataManifest
case _: VersionVector => VersionVectorManifest
- case _: ORSetKey[_] => ORSetKeyManifest
- case _: GSetKey[_] => GSetKeyManifest
+ case _: ORSetKey[?] => ORSetKeyManifest
+ case _: GSetKey[?] => GSetKeyManifest
case _: GCounterKey => GCounterKeyManifest
case _: PNCounterKey => PNCounterKeyManifest
case _: FlagKey => FlagKeyManifest
- case _: LWWRegisterKey[_] => LWWRegisterKeyManifest
- case _: ORMapKey[_, _] => ORMapKeyManifest
- case _: LWWMapKey[_, _] => LWWMapKeyManifest
- case _: PNCounterMapKey[_] => PNCounterMapKeyManifest
- case _: ORMultiMapKey[_, _] => ORMultiMapKeyManifest
+ case _: LWWRegisterKey[?] => LWWRegisterKeyManifest
+ case _: ORMapKey[?, ?] => ORMapKeyManifest
+ case _: LWWMapKey[?, ?] => LWWMapKeyManifest
+ case _: PNCounterMapKey[?] => PNCounterMapKeyManifest
+ case _: ORMultiMapKey[?, ?] => ORMultiMapKeyManifest
- case _: ORSet.DeltaGroup[_] => ORSetDeltaGroupManifest
- case _: ORMap.DeltaGroup[_, _] => ORMapDeltaGroupManifest
- case _: ORSet.FullStateDeltaOp[_] => ORSetFullManifest
+ case _: ORSet.DeltaGroup[?] => ORSetDeltaGroupManifest
+ case _: ORMap.DeltaGroup[?, ?] => ORMapDeltaGroupManifest
+ case _: ORSet.FullStateDeltaOp[?] => ORSetFullManifest
case _ =>
throw new IllegalArgumentException(s"Can't serialize object of type ${obj.getClass} in [${getClass.getName}]")
}
def toBinary(obj: AnyRef): Array[Byte] = obj match {
- case m: ORSet[_] => compress(orsetToProto(m))
- case m: ORSet.AddDeltaOp[_] => orsetToProto(m.underlying).toByteArray
- case m: ORSet.RemoveDeltaOp[_] => orsetToProto(m.underlying).toByteArray
- case m: GSet[_] => gsetToProto(m).toByteArray
+ case m: ORSet[?] => compress(orsetToProto(m))
+ case m: ORSet.AddDeltaOp[?] => orsetToProto(m.underlying).toByteArray
+ case m: ORSet.RemoveDeltaOp[?] => orsetToProto(m.underlying).toByteArray
+ case m: GSet[?] => gsetToProto(m).toByteArray
case m: GCounter => gcounterToProto(m).toByteArray
case m: PNCounter => pncounterToProto(m).toByteArray
case m: Flag => flagToProto(m).toByteArray
- case m: LWWRegister[_] => lwwRegisterToProto(m).toByteArray
- case m: ORMap[_, _] => compress(ormapToProto(m))
- case m: ORMap.PutDeltaOp[_, _] => ormapPutToProto(m).toByteArray
- case m: ORMap.RemoveDeltaOp[_, _] => ormapRemoveToProto(m).toByteArray
- case m: ORMap.RemoveKeyDeltaOp[_, _] => ormapRemoveKeyToProto(m).toByteArray
- case m: ORMap.UpdateDeltaOp[_, _] => ormapUpdateToProto(m).toByteArray
- case m: LWWMap[_, _] => compress(lwwmapToProto(m))
- case m: PNCounterMap[_] => compress(pncountermapToProto(m))
- case m: ORMultiMap[_, _] => compress(multimapToProto(m))
+ case m: LWWRegister[?] => lwwRegisterToProto(m).toByteArray
+ case m: ORMap[?, ?] => compress(ormapToProto(m))
+ case m: ORMap.PutDeltaOp[?, ?] => ormapPutToProto(m).toByteArray
+ case m: ORMap.RemoveDeltaOp[?, ?] => ormapRemoveToProto(m).toByteArray
+ case m: ORMap.RemoveKeyDeltaOp[?, ?] => ormapRemoveKeyToProto(m).toByteArray
+ case m: ORMap.UpdateDeltaOp[?, ?] => ormapUpdateToProto(m).toByteArray
+ case m: LWWMap[?, ?] => compress(lwwmapToProto(m))
+ case m: PNCounterMap[?] => compress(pncountermapToProto(m))
+ case m: ORMultiMap[?, ?] => compress(multimapToProto(m))
case DeletedData => dm.Empty.getDefaultInstance.toByteArray
case m: VersionVector => versionVectorToProto(m).toByteArray
case Key(id) => keyIdToBinary(id)
- case m: ORSet.DeltaGroup[_] => orsetDeltaGroupToProto(m).toByteArray
- case m: ORMap.DeltaGroup[_, _] => ormapDeltaGroupToProto(m).toByteArray
- case m: ORSet.FullStateDeltaOp[_] => orsetToProto(m.underlying).toByteArray
+ case m: ORSet.DeltaGroup[?] => orsetDeltaGroupToProto(m).toByteArray
+ case m: ORMap.DeltaGroup[?, ?] => ormapDeltaGroupToProto(m).toByteArray
+ case m: ORSet.FullStateDeltaOp[?] => orsetToProto(m.underlying).toByteArray
case _ =>
throw new IllegalArgumentException(s"Can't serialize object of type ${obj.getClass} in [${getClass.getName}]")
}
@@ -412,7 +412,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
s"Unimplemented deserialization of message with manifest [$manifest] in [${getClass.getName}]")
}
- def gsetToProto(gset: GSet[_]): rd.GSet = {
+ def gsetToProto(gset: GSet[?]): rd.GSet = {
val b = rd.GSet.newBuilder()
// using java collections and sorting for performance (avoid conversions)
val stringElements = new ArrayList[String]
@@ -450,7 +450,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
b.build()
}
- def gsetFromBinary(bytes: Array[Byte]): GSet[_] =
+ def gsetFromBinary(bytes: Array[Byte]): GSet[?] =
gsetFromProto(rd.GSet.parseFrom(bytes))
def gsetFromProto(gset: rd.GSet): GSet[Any] = {
@@ -464,7 +464,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
GSet(elements.toSet)
}
- def orsetToProto(orset: ORSet[_]): rd.ORSet =
+ def orsetToProto(orset: ORSet[?]): rd.ORSet =
orsetToProtoImpl(orset.asInstanceOf[ORSet[Any]])
private def orsetToProtoImpl(orset: ORSet[Any]): rd.ORSet = {
@@ -488,7 +488,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
otherElementsMap = otherElementsMap.updated(enclosedMsg, other)
}
- def addDots(elements: ArrayList[_]): Unit = {
+ def addDots(elements: ArrayList[?]): Unit = {
// add corresponding dots in same order
val iter = elements.iterator
while (iter.hasNext) {
@@ -544,8 +544,8 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
private def orsetFullFromBinary(bytes: Array[Byte]): ORSet.FullStateDeltaOp[Any] =
new ORSet.FullStateDeltaOp(orsetFromProto(rd.ORSet.parseFrom(bytes)))
- private def orsetDeltaGroupToProto(deltaGroup: ORSet.DeltaGroup[_]): rd.ORSetDeltaGroup = {
- def createEntry(opType: rd.ORSetDeltaOp, u: ORSet[_]) = {
+ private def orsetDeltaGroupToProto(deltaGroup: ORSet.DeltaGroup[?]): rd.ORSetDeltaGroup = {
+ def createEntry(opType: rd.ORSetDeltaOp, u: ORSet[?]) = {
rd.ORSetDeltaGroup.Entry.newBuilder().setOperation(opType).setUnderlying(orsetToProto(u))
}
@@ -605,7 +605,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
def flagFromProto(flag: rd.Flag): Flag =
if (flag.getEnabled) Flag.Enabled else Flag.Disabled
- def lwwRegisterToProto(lwwRegister: LWWRegister[_]): rd.LWWRegister =
+ def lwwRegisterToProto(lwwRegister: LWWRegister[?]): rd.LWWRegister =
rd.LWWRegister
.newBuilder()
.setTimestamp(lwwRegister.timestamp)
@@ -684,7 +684,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
protoEntries
}
- def ormapToProto(ormap: ORMap[_, _]): rd.ORMap = {
+ def ormapToProto(ormap: ORMap[?, ?]): rd.ORMap = {
val ormapBuilder = rd.ORMap.newBuilder()
val entries: jl.Iterable[rd.ORMap.Entry] =
getEntries(ormap.values, rd.ORMap.Entry.newBuilder _, otherMessageToProto)
@@ -741,7 +741,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
// wire protocol is always DeltaGroup
private def ormapPutFromBinary(bytes: Array[Byte]): ORMap.PutDeltaOp[Any, ReplicatedData] = {
val ops = ormapDeltaGroupOpsFromBinary(bytes)
- if (ops.size == 1 && ops.head.isInstanceOf[ORMap.PutDeltaOp[_, _]])
+ if (ops.size == 1 && ops.head.isInstanceOf[ORMap.PutDeltaOp[?, ?]])
ops.head.asInstanceOf[ORMap.PutDeltaOp[Any, ReplicatedData]]
else
throw new NotSerializableException("Improper ORMap delta put operation size or kind")
@@ -750,7 +750,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
// wire protocol is always delta group
private def ormapRemoveFromBinary(bytes: Array[Byte]): ORMap.RemoveDeltaOp[Any, ReplicatedData] = {
val ops = ormapDeltaGroupOpsFromBinary(bytes)
- if (ops.size == 1 && ops.head.isInstanceOf[ORMap.RemoveDeltaOp[_, _]])
+ if (ops.size == 1 && ops.head.isInstanceOf[ORMap.RemoveDeltaOp[?, ?]])
ops.head.asInstanceOf[ORMap.RemoveDeltaOp[Any, ReplicatedData]]
else
throw new NotSerializableException("Improper ORMap delta remove operation size or kind")
@@ -759,7 +759,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
// wire protocol is always delta group
private def ormapRemoveKeyFromBinary(bytes: Array[Byte]): ORMap.RemoveKeyDeltaOp[Any, ReplicatedData] = {
val ops = ormapDeltaGroupOpsFromBinary(bytes)
- if (ops.size == 1 && ops.head.isInstanceOf[ORMap.RemoveKeyDeltaOp[_, _]])
+ if (ops.size == 1 && ops.head.isInstanceOf[ORMap.RemoveKeyDeltaOp[?, ?]])
ops.head.asInstanceOf[ORMap.RemoveKeyDeltaOp[Any, ReplicatedData]]
else
throw new NotSerializableException("Improper ORMap delta remove key operation size or kind")
@@ -768,7 +768,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
// wire protocol is always delta group
private def ormapUpdateFromBinary(bytes: Array[Byte]): ORMap.UpdateDeltaOp[Any, ReplicatedDelta] = {
val ops = ormapDeltaGroupOpsFromBinary(bytes)
- if (ops.size == 1 && ops.head.isInstanceOf[ORMap.UpdateDeltaOp[_, _]])
+ if (ops.size == 1 && ops.head.isInstanceOf[ORMap.UpdateDeltaOp[?, ?]])
ops.head.asInstanceOf[ORMap.UpdateDeltaOp[Any, ReplicatedDelta]]
else
throw new NotSerializableException("Improper ORMap delta update operation size or kind")
@@ -827,28 +827,28 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
ops
}
- private def ormapPutToProto(deltaOp: ORMap.PutDeltaOp[_, _]): rd.ORMapDeltaGroup = {
+ private def ormapPutToProto(deltaOp: ORMap.PutDeltaOp[?, ?]): rd.ORMapDeltaGroup = {
ormapDeltaGroupOpsToProto(immutable.IndexedSeq(deltaOp.asInstanceOf[ORMap.DeltaOp]))
}
- private def ormapRemoveToProto(deltaOp: ORMap.RemoveDeltaOp[_, _]): rd.ORMapDeltaGroup = {
+ private def ormapRemoveToProto(deltaOp: ORMap.RemoveDeltaOp[?, ?]): rd.ORMapDeltaGroup = {
ormapDeltaGroupOpsToProto(immutable.IndexedSeq(deltaOp.asInstanceOf[ORMap.DeltaOp]))
}
- private def ormapRemoveKeyToProto(deltaOp: ORMap.RemoveKeyDeltaOp[_, _]): rd.ORMapDeltaGroup = {
+ private def ormapRemoveKeyToProto(deltaOp: ORMap.RemoveKeyDeltaOp[?, ?]): rd.ORMapDeltaGroup = {
ormapDeltaGroupOpsToProto(immutable.IndexedSeq(deltaOp.asInstanceOf[ORMap.DeltaOp]))
}
- private def ormapUpdateToProto(deltaOp: ORMap.UpdateDeltaOp[_, _]): rd.ORMapDeltaGroup = {
+ private def ormapUpdateToProto(deltaOp: ORMap.UpdateDeltaOp[?, ?]): rd.ORMapDeltaGroup = {
ormapDeltaGroupOpsToProto(immutable.IndexedSeq(deltaOp.asInstanceOf[ORMap.DeltaOp]))
}
- private def ormapDeltaGroupToProto(deltaGroup: ORMap.DeltaGroup[_, _]): rd.ORMapDeltaGroup = {
+ private def ormapDeltaGroupToProto(deltaGroup: ORMap.DeltaGroup[?, ?]): rd.ORMapDeltaGroup = {
ormapDeltaGroupOpsToProto(deltaGroup.ops)
}
private def ormapDeltaGroupOpsToProto(deltaGroupOps: immutable.IndexedSeq[ORMap.DeltaOp]): rd.ORMapDeltaGroup = {
- def createEntry(opType: rd.ORMapDeltaOp, u: ORSet[_], m: Map[_, _], zt: Int) = {
+ def createEntry(opType: rd.ORMapDeltaOp, u: ORSet[?], m: Map[?, ?], zt: Int) = {
if (m.size > 1 && opType != rd.ORMapDeltaOp.ORMapUpdate)
throw new IllegalArgumentException("Invalid size of ORMap delta map")
else {
@@ -876,7 +876,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
}
}
- def createEntryWithKey(opType: rd.ORMapDeltaOp, u: ORSet[_], k: Any, zt: Int) = {
+ def createEntryWithKey(opType: rd.ORMapDeltaOp, u: ORSet[?], k: Any, zt: Int) = {
val entryDataBuilder = rd.ORMapDeltaGroup.MapEntry.newBuilder()
k match {
case key: String => entryDataBuilder.setStringKey(key)
@@ -894,31 +894,31 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
deltaGroupOps.foreach {
case ORMap.PutDeltaOp(op, pair, zt) =>
b.addEntries(
- createEntry(rd.ORMapDeltaOp.ORMapPut, op.asInstanceOf[ORSet.AddDeltaOp[_]].underlying, Map(pair), zt.value))
+ createEntry(rd.ORMapDeltaOp.ORMapPut, op.asInstanceOf[ORSet.AddDeltaOp[?]].underlying, Map(pair), zt.value))
case ORMap.RemoveDeltaOp(op, zt) =>
b.addEntries(
createEntry(
rd.ORMapDeltaOp.ORMapRemove,
- op.asInstanceOf[ORSet.RemoveDeltaOp[_]].underlying,
+ op.asInstanceOf[ORSet.RemoveDeltaOp[?]].underlying,
Map.empty,
zt.value))
case ORMap.RemoveKeyDeltaOp(op, k, zt) =>
b.addEntries(
createEntryWithKey(
rd.ORMapDeltaOp.ORMapRemoveKey,
- op.asInstanceOf[ORSet.RemoveDeltaOp[_]].underlying,
+ op.asInstanceOf[ORSet.RemoveDeltaOp[?]].underlying,
k,
zt.value))
case ORMap.UpdateDeltaOp(op, m, zt) =>
b.addEntries(
- createEntry(rd.ORMapDeltaOp.ORMapUpdate, op.asInstanceOf[ORSet.AddDeltaOp[_]].underlying, m, zt.value))
+ createEntry(rd.ORMapDeltaOp.ORMapUpdate, op.asInstanceOf[ORSet.AddDeltaOp[?]].underlying, m, zt.value))
case ORMap.DeltaGroup(_) =>
throw new IllegalArgumentException("ORMap.DeltaGroup should not be nested")
}
b.build()
}
- def lwwmapToProto(lwwmap: LWWMap[_, _]): rd.LWWMap = {
+ def lwwmapToProto(lwwmap: LWWMap[?, ?]): rd.LWWMap = {
val lwwmapBuilder = rd.LWWMap.newBuilder()
val entries: jl.Iterable[rd.LWWMap.Entry] =
getEntries(lwwmap.underlying.entries, rd.LWWMap.Entry.newBuilder _, lwwRegisterToProto)
@@ -933,22 +933,22 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
new LWWMap(new ORMap(keys = orsetFromProto(lwwmap.getKeys), entries, LWWMap.LWWMapTag))
}
- def pncountermapToProto(pncountermap: PNCounterMap[_]): rd.PNCounterMap = {
+ def pncountermapToProto(pncountermap: PNCounterMap[?]): rd.PNCounterMap = {
val pncountermapBuilder = rd.PNCounterMap.newBuilder()
val entries: jl.Iterable[rd.PNCounterMap.Entry] =
getEntries(pncountermap.underlying.entries, rd.PNCounterMap.Entry.newBuilder _, pncounterToProto)
pncountermapBuilder.setKeys(orsetToProto(pncountermap.underlying.keys)).addAllEntries(entries).build()
}
- def pncountermapFromBinary(bytes: Array[Byte]): PNCounterMap[_] =
+ def pncountermapFromBinary(bytes: Array[Byte]): PNCounterMap[?] =
pncountermapFromProto(rd.PNCounterMap.parseFrom(decompress(bytes)))
- def pncountermapFromProto(pncountermap: rd.PNCounterMap): PNCounterMap[_] = {
+ def pncountermapFromProto(pncountermap: rd.PNCounterMap): PNCounterMap[?] = {
val entries = mapTypeFromProto(pncountermap.getEntriesList, pncounterFromProto)
new PNCounterMap(new ORMap(keys = orsetFromProto(pncountermap.getKeys), entries, PNCounterMap.PNCounterMapTag))
}
- def multimapToProto(multimap: ORMultiMap[_, _]): rd.ORMultiMap = {
+ def multimapToProto(multimap: ORMultiMap[?, ?]): rd.ORMultiMap = {
val ormultimapBuilder = rd.ORMultiMap.newBuilder()
val entries: jl.Iterable[rd.ORMultiMap.Entry] =
getEntries(multimap.underlying.entries, rd.ORMultiMap.Entry.newBuilder _, orsetToProto)
diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala
index 528b23fe7c..e7c31f9510 100644
--- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala
+++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala
@@ -224,14 +224,14 @@ class ReplicatorMessageSerializer(val system: ExtendedActorSystem)
case _: ReadResult => ReadResultManifest
case _: DeltaPropagation => DeltaPropagationManifest
case _: Status => StatusManifest
- case _: Get[_] => GetManifest
- case _: GetSuccess[_] => GetSuccessManifest
+ case _: Get[?] => GetManifest
+ case _: GetSuccess[?] => GetSuccessManifest
case _: DurableDataEnvelope => DurableDataEnvelopeManifest
- case _: Changed[_] => ChangedManifest
- case _: NotFound[_] => NotFoundManifest
- case _: GetFailure[_] => GetFailureManifest
- case _: Subscribe[_] => SubscribeManifest
- case _: Unsubscribe[_] => UnsubscribeManifest
+ case _: Changed[?] => ChangedManifest
+ case _: NotFound[?] => NotFoundManifest
+ case _: GetFailure[?] => GetFailureManifest
+ case _: Subscribe[?] => SubscribeManifest
+ case _: Unsubscribe[?] => UnsubscribeManifest
case _: Gossip => GossipManifest
case WriteNack => WriteNackManifest
case DeltaNack => DeltaNackManifest
@@ -247,14 +247,14 @@ class ReplicatorMessageSerializer(val system: ExtendedActorSystem)
case m: ReadResult => readResultToProto(m).toByteArray
case m: Status => statusToProto(m).toByteArray
case m: DeltaPropagation => deltaPropagationToProto(m).toByteArray
- case m: Get[_] => getToProto(m).toByteArray
- case m: GetSuccess[_] => getSuccessToProto(m).toByteArray
+ case m: Get[?] => getToProto(m).toByteArray
+ case m: GetSuccess[?] => getSuccessToProto(m).toByteArray
case m: DurableDataEnvelope => durableDataEnvelopeToProto(m).toByteArray
- case m: Changed[_] => changedToProto(m).toByteArray
- case m: NotFound[_] => notFoundToProto(m).toByteArray
- case m: GetFailure[_] => getFailureToProto(m).toByteArray
- case m: Subscribe[_] => subscribeToProto(m).toByteArray
- case m: Unsubscribe[_] => unsubscribeToProto(m).toByteArray
+ case m: Changed[?] => changedToProto(m).toByteArray
+ case m: NotFound[?] => notFoundToProto(m).toByteArray
+ case m: GetFailure[?] => getFailureToProto(m).toByteArray
+ case m: Subscribe[?] => subscribeToProto(m).toByteArray
+ case m: Unsubscribe[?] => unsubscribeToProto(m).toByteArray
case m: Gossip => compress(gossipToProto(m))
case WriteNack => dm.Empty.getDefaultInstance.toByteArray
case DeltaNack => dm.Empty.getDefaultInstance.toByteArray
@@ -353,7 +353,7 @@ class ReplicatorMessageSerializer(val system: ExtendedActorSystem)
}.toMap)
}
- private def getToProto(get: Get[_]): dm.Get = {
+ private def getToProto(get: Get[?]): dm.Get = {
val timoutInMillis = get.consistency.timeout.toMillis
require(timoutInMillis <= 0xFFFFFFFFL, "Timeouts must fit in a 32-bit unsigned int")
@@ -380,7 +380,7 @@ class ReplicatorMessageSerializer(val system: ExtendedActorSystem)
b.build()
}
- private def getFromBinary(bytes: Array[Byte]): Get[_] = {
+ private def getFromBinary(bytes: Array[Byte]): Get[?] = {
val get = dm.Get.parseFrom(bytes)
val key = otherMessageFromProto(get.getKey).asInstanceOf[KeyR]
val request = if (get.hasRequest()) Some(otherMessageFromProto(get.getRequest)) else None
@@ -403,7 +403,7 @@ class ReplicatorMessageSerializer(val system: ExtendedActorSystem)
Get(key, consistency, request)
}
- private def getSuccessToProto(getSuccess: GetSuccess[_]): dm.GetSuccess = {
+ private def getSuccessToProto(getSuccess: GetSuccess[?]): dm.GetSuccess = {
val b = dm.GetSuccess
.newBuilder()
.setKey(otherMessageToProto(getSuccess.key))
@@ -413,7 +413,7 @@ class ReplicatorMessageSerializer(val system: ExtendedActorSystem)
b.build()
}
- private def getSuccessFromBinary(bytes: Array[Byte]): GetSuccess[_] = {
+ private def getSuccessFromBinary(bytes: Array[Byte]): GetSuccess[?] = {
val getSuccess = dm.GetSuccess.parseFrom(bytes)
val key = otherMessageFromProto(getSuccess.getKey).asInstanceOf[KeyR]
val request = if (getSuccess.hasRequest()) Some(otherMessageFromProto(getSuccess.getRequest)) else None
@@ -421,66 +421,66 @@ class ReplicatorMessageSerializer(val system: ExtendedActorSystem)
GetSuccess(key, request)(data)
}
- private def notFoundToProto(notFound: NotFound[_]): dm.NotFound = {
+ private def notFoundToProto(notFound: NotFound[?]): dm.NotFound = {
val b = dm.NotFound.newBuilder().setKey(otherMessageToProto(notFound.key))
notFound.request.foreach(o => b.setRequest(otherMessageToProto(o)))
b.build()
}
- private def notFoundFromBinary(bytes: Array[Byte]): NotFound[_] = {
+ private def notFoundFromBinary(bytes: Array[Byte]): NotFound[?] = {
val notFound = dm.NotFound.parseFrom(bytes)
val request = if (notFound.hasRequest()) Some(otherMessageFromProto(notFound.getRequest)) else None
val key = otherMessageFromProto(notFound.getKey).asInstanceOf[KeyR]
NotFound(key, request)
}
- private def getFailureToProto(getFailure: GetFailure[_]): dm.GetFailure = {
+ private def getFailureToProto(getFailure: GetFailure[?]): dm.GetFailure = {
val b = dm.GetFailure.newBuilder().setKey(otherMessageToProto(getFailure.key))
getFailure.request.foreach(o => b.setRequest(otherMessageToProto(o)))
b.build()
}
- private def getFailureFromBinary(bytes: Array[Byte]): GetFailure[_] = {
+ private def getFailureFromBinary(bytes: Array[Byte]): GetFailure[?] = {
val getFailure = dm.GetFailure.parseFrom(bytes)
val request = if (getFailure.hasRequest()) Some(otherMessageFromProto(getFailure.getRequest)) else None
val key = otherMessageFromProto(getFailure.getKey).asInstanceOf[KeyR]
GetFailure(key, request)
}
- private def subscribeToProto(subscribe: Subscribe[_]): dm.Subscribe =
+ private def subscribeToProto(subscribe: Subscribe[?]): dm.Subscribe =
dm.Subscribe
.newBuilder()
.setKey(otherMessageToProto(subscribe.key))
.setRef(Serialization.serializedActorPath(subscribe.subscriber))
.build()
- private def subscribeFromBinary(bytes: Array[Byte]): Subscribe[_] = {
+ private def subscribeFromBinary(bytes: Array[Byte]): Subscribe[?] = {
val subscribe = dm.Subscribe.parseFrom(bytes)
val key = otherMessageFromProto(subscribe.getKey).asInstanceOf[KeyR]
Subscribe(key, resolveActorRef(subscribe.getRef))
}
- private def unsubscribeToProto(unsubscribe: Unsubscribe[_]): dm.Unsubscribe =
+ private def unsubscribeToProto(unsubscribe: Unsubscribe[?]): dm.Unsubscribe =
dm.Unsubscribe
.newBuilder()
.setKey(otherMessageToProto(unsubscribe.key))
.setRef(Serialization.serializedActorPath(unsubscribe.subscriber))
.build()
- private def unsubscribeFromBinary(bytes: Array[Byte]): Unsubscribe[_] = {
+ private def unsubscribeFromBinary(bytes: Array[Byte]): Unsubscribe[?] = {
val unsubscribe = dm.Unsubscribe.parseFrom(bytes)
val key = otherMessageFromProto(unsubscribe.getKey).asInstanceOf[KeyR]
Unsubscribe(key, resolveActorRef(unsubscribe.getRef))
}
- private def changedToProto(changed: Changed[_]): dm.Changed =
+ private def changedToProto(changed: Changed[?]): dm.Changed =
dm.Changed
.newBuilder()
.setKey(otherMessageToProto(changed.key))
.setData(otherMessageToProto(changed.dataValue))
.build()
- private def changedFromBinary(bytes: Array[Byte]): Changed[_] = {
+ private def changedFromBinary(bytes: Array[Byte]): Changed[?] = {
val changed = dm.Changed.parseFrom(bytes)
val data = otherMessageFromProto(changed.getData).asInstanceOf[ReplicatedData]
val key = otherMessageFromProto(changed.getKey).asInstanceOf[KeyR]
diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/JepsenInspiredInsertSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/JepsenInspiredInsertSpec.scala
index 6674c52df2..3cfa058864 100644
--- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/JepsenInspiredInsertSpec.scala
+++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/JepsenInspiredInsertSpec.scala
@@ -135,8 +135,8 @@ class JepsenInspiredInsertSpec
replicator.tell(Update(key, ORSet(), WriteLocal, Some(i))(_ :+ i), writeProbe.ref)
writeProbe.receiveOne(3.seconds)
}
- val successWriteAcks = writeAcks.collect { case success: UpdateSuccess[_] => success }
- val failureWriteAcks = writeAcks.collect { case fail: UpdateFailure[_] => fail }
+ val successWriteAcks = writeAcks.collect { case success: UpdateSuccess[?] => success }
+ val failureWriteAcks = writeAcks.collect { case fail: UpdateFailure[?] => fail }
successWriteAcks.map(_.request.get).toSet should be(myData.toSet)
successWriteAcks.size should be(myData.size)
failureWriteAcks should be(Nil)
@@ -168,8 +168,8 @@ class JepsenInspiredInsertSpec
replicator.tell(Update(key, ORSet(), writeMajority, Some(i))(_ :+ i), writeProbe.ref)
writeProbe.receiveOne(timeout + 1.second)
}
- val successWriteAcks = writeAcks.collect { case success: UpdateSuccess[_] => success }
- val failureWriteAcks = writeAcks.collect { case fail: UpdateFailure[_] => fail }
+ val successWriteAcks = writeAcks.collect { case success: UpdateSuccess[?] => success }
+ val failureWriteAcks = writeAcks.collect { case fail: UpdateFailure[?] => fail }
successWriteAcks.map(_.request.get).toSet should be(myData.toSet)
successWriteAcks.size should be(myData.size)
failureWriteAcks should be(Nil)
@@ -212,8 +212,8 @@ class JepsenInspiredInsertSpec
replicator.tell(Update(key, ORSet(), WriteLocal, Some(i))(_ :+ i), writeProbe.ref)
writeProbe.receiveOne(3.seconds)
}
- val successWriteAcks = writeAcks.collect { case success: UpdateSuccess[_] => success }
- val failureWriteAcks = writeAcks.collect { case fail: UpdateFailure[_] => fail }
+ val successWriteAcks = writeAcks.collect { case success: UpdateSuccess[?] => success }
+ val failureWriteAcks = writeAcks.collect { case fail: UpdateFailure[?] => fail }
successWriteAcks.map(_.request.get).toSet should be(myData.toSet)
successWriteAcks.size should be(myData.size)
failureWriteAcks should be(Nil)
@@ -257,8 +257,8 @@ class JepsenInspiredInsertSpec
replicator.tell(Update(key, ORSet(), writeMajority, Some(i))(_ :+ i), writeProbe.ref)
writeProbe.receiveOne(timeout + 1.second)
}
- val successWriteAcks = writeAcks.collect { case success: UpdateSuccess[_] => success }
- val failureWriteAcks = writeAcks.collect { case fail: UpdateFailure[_] => fail }
+ val successWriteAcks = writeAcks.collect { case success: UpdateSuccess[?] => success }
+ val failureWriteAcks = writeAcks.collect { case fail: UpdateFailure[?] => fail }
runOn(n1, n4, n5) {
successWriteAcks.map(_.request.get).toSet should be(myData.toSet)
successWriteAcks.size should be(myData.size)
diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorChaosSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorChaosSpec.scala
index c59c755d66..d0197a3a7c 100644
--- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorChaosSpec.scala
+++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorChaosSpec.scala
@@ -85,8 +85,8 @@ class ReplicatorChaosSpec extends MultiNodeSpec(ReplicatorChaosSpec) with STMult
g.dataValue match {
case c: GCounter => c.value
case c: PNCounter => c.value
- case c: GSet[_] => c.elements
- case c: ORSet[_] => c.elements
+ case c: GSet[?] => c.elements
+ case c: ORSet[?] => c.elements
case _ => fail()
}
}
@@ -125,7 +125,7 @@ class ReplicatorChaosSpec extends MultiNodeSpec(ReplicatorChaosSpec) with STMult
replicator ! Update(KeyB, PNCounter(), WriteLocal)(_.decrement(1))
replicator ! Update(KeyC, GCounter(), WriteAll(timeout))(_ :+ 1)
}
- receiveN(15).map(_.getClass).toSet should be(Set(classOf[UpdateSuccess[_]]))
+ receiveN(15).map(_.getClass).toSet should be(Set(classOf[UpdateSuccess[?]]))
}
runOn(second) {
diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorDeltaSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorDeltaSpec.scala
index 6d076cbfd2..23f77425e3 100644
--- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorDeltaSpec.scala
+++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorDeltaSpec.scala
@@ -251,8 +251,8 @@ class ReplicatorDeltaSpec extends MultiNodeSpec(ReplicatorDeltaSpec) with STMult
val p1 = TestProbe()
fullStateReplicator.tell(Update(KeyD, ORSet.empty[String], writeAll)(_ :+ "A"), p1.ref)
deltaReplicator.tell(Update(KeyD, ORSet.empty[String], writeAll)(_ :+ "A"), p1.ref)
- p1.expectMsgType[UpdateSuccess[_]]
- p1.expectMsgType[UpdateSuccess[_]]
+ p1.expectMsgType[UpdateSuccess[?]]
+ p1.expectMsgType[UpdateSuccess[?]]
}
enterBarrier("write-1")
@@ -268,9 +268,9 @@ class ReplicatorDeltaSpec extends MultiNodeSpec(ReplicatorDeltaSpec) with STMult
deltaReplicator.tell(Update(KeyD, ORSet.empty[String], writeAll)(_ :+ "B"), p1.ref)
deltaReplicator.tell(Update(KeyD, ORSet.empty[String], writeAll)(_ :+ "C"), p1.ref)
deltaReplicator.tell(Update(KeyD, ORSet.empty[String], writeAll)(_ :+ "D"), p1.ref)
- p1.expectMsgType[UpdateSuccess[_]]
- p1.expectMsgType[UpdateSuccess[_]]
- p1.expectMsgType[UpdateSuccess[_]]
+ p1.expectMsgType[UpdateSuccess[?]]
+ p1.expectMsgType[UpdateSuccess[?]]
+ p1.expectMsgType[UpdateSuccess[?]]
}
enterBarrier("write-2")
deltaReplicator.tell(Get(KeyD, ReadLocal), p.ref)
@@ -280,7 +280,7 @@ class ReplicatorDeltaSpec extends MultiNodeSpec(ReplicatorDeltaSpec) with STMult
runOn(first) {
val p1 = TestProbe()
fullStateReplicator.tell(Update(KeyD, ORSet.empty[String], writeAll)(_ :+ "A" :+ "B" :+ "C" :+ "D"), p1.ref)
- p1.expectMsgType[UpdateSuccess[_]]
+ p1.expectMsgType[UpdateSuccess[?]]
}
enterBarrier("write-3")
fullStateReplicator.tell(Get(KeyD, ReadLocal), p.ref)
@@ -293,7 +293,7 @@ class ReplicatorDeltaSpec extends MultiNodeSpec(ReplicatorDeltaSpec) with STMult
runOn(first) {
val p1 = TestProbe()
deltaReplicator.tell(Update(KeyHigh, Highest(0), WriteLocal)(_.incr(1)), p1.ref)
- p1.expectMsgType[UpdateSuccess[_]]
+ p1.expectMsgType[UpdateSuccess[?]]
}
enterBarrier("write-1")
@@ -316,11 +316,11 @@ class ReplicatorDeltaSpec extends MultiNodeSpec(ReplicatorDeltaSpec) with STMult
runOn(first) {
val p1 = TestProbe()
deltaReplicator.tell(Update(KeyHigh, Highest(0), writeAll)(_.incr(2)), p1.ref)
- p1.expectMsgType[UpdateSuccess[_]]
+ p1.expectMsgType[UpdateSuccess[?]]
deltaReplicator.tell(Update(KeyHigh, Highest(0), WriteLocal)(_.incrNoDelta(5)), p1.ref)
deltaReplicator.tell(Update(KeyHigh, Highest(0), WriteLocal)(_.incr(10)), p1.ref)
- p1.expectMsgType[UpdateSuccess[_]]
- p1.expectMsgType[UpdateSuccess[_]]
+ p1.expectMsgType[UpdateSuccess[?]]
+ p1.expectMsgType[UpdateSuccess[?]]
}
enterBarrier("write-2")
@@ -347,7 +347,7 @@ class ReplicatorDeltaSpec extends MultiNodeSpec(ReplicatorDeltaSpec) with STMult
// delta versions again. Same would happen via full state gossip.
// Thereafter delta can be propagated and applied again.
deltaReplicator.tell(Update(KeyHigh, Highest(0), writeAll)(_.incr(100)), p1.ref)
- p1.expectMsgType[UpdateSuccess[_]]
+ p1.expectMsgType[UpdateSuccess[?]]
// Flush the deltaPropagation buffer, otherwise it will contain
// NoDeltaPlaceholder from previous updates and the incr(4) delta will also
// be folded into NoDeltaPlaceholder and not propagated as delta. A few DeltaPropagationTick
@@ -356,7 +356,7 @@ class ReplicatorDeltaSpec extends MultiNodeSpec(ReplicatorDeltaSpec) with STMult
deltaReplicator ! Replicator.Internal.DeltaPropagationTick
}
deltaReplicator.tell(Update(KeyHigh, Highest(0), WriteLocal)(_.incr(4)), p1.ref)
- p1.expectMsgType[UpdateSuccess[_]]
+ p1.expectMsgType[UpdateSuccess[?]]
}
enterBarrier("write-3")
diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorGossipSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorGossipSpec.scala
index a2a9bf4d96..25f882404d 100644
--- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorGossipSpec.scala
+++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorGossipSpec.scala
@@ -93,11 +93,11 @@ class ReplicatorGossipSpec extends MultiNodeSpec(ReplicatorGossipSpec) with STMu
runOn(first) {
(0 until numberOfSmall).foreach { i =>
replicator ! Update(smallORSetKeys(i), ORSet.empty[String], WriteLocal)(_ :+ smallPayload())
- expectMsgType[UpdateSuccess[_]]
+ expectMsgType[UpdateSuccess[?]]
}
(0 until numberOfLarge).foreach { i =>
replicator ! Update(largeORSetKeys(i), ORSet.empty[String], WriteLocal)(_ :+ largePayload())
- expectMsgType[UpdateSuccess[_]]
+ expectMsgType[UpdateSuccess[?]]
}
}
enterBarrier("updated-first")
diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorORSetDeltaSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorORSetDeltaSpec.scala
index 638feb968d..58b4a7bf4e 100644
--- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorORSetDeltaSpec.scala
+++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorORSetDeltaSpec.scala
... 9500 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org