diff --git a/csw-alarm/csw-alarm-cli/src/main/scala/csw/alarm/cli/args/ArgsParser.scala b/csw-alarm/csw-alarm-cli/src/main/scala/csw/alarm/cli/args/ArgsParser.scala index 01ed4ae5ec..34f0fbedee 100644 --- a/csw-alarm/csw-alarm-cli/src/main/scala/csw/alarm/cli/args/ArgsParser.scala +++ b/csw-alarm/csw-alarm-cli/src/main/scala/csw/alarm/cli/args/ArgsParser.scala @@ -24,15 +24,15 @@ class ArgsParser(name: String) { .children( cmd("get") .action((_, args) => args.copy(subCmd = "get")) - .children(optionalAlarmKey: _*) + .children(optionalAlarmKey*) .text("get severity of a subsystem/component/alarm"), cmd("set") .action((_, args) => args.copy(subCmd = "set")) - .children(requiredAlarmKey :+ severity :+ refresh: _*) + .children(requiredAlarmKey :+ severity :+ refresh*) .text("set severity of an alarm"), cmd("subscribe") .action((_, args) => args.copy(subCmd = "subscribe")) - .children(optionalAlarmKey: _*) + .children(optionalAlarmKey*) .text("subscribe to severity of a subsystem/component/alarm") ) @@ -41,53 +41,53 @@ class ArgsParser(name: String) { .children( cmd("get") .action((_, args) => args.copy(subCmd = "get")) - .children(optionalAlarmKey: _*) + .children(optionalAlarmKey*) .text("get health of a subsystem/component/alarm"), cmd("subscribe") .action((_, args) => args.copy(subCmd = "subscribe")) - .children(optionalAlarmKey: _*) + .children(optionalAlarmKey*) .text("subscribe to health of a subsystem/component/alarm") ) cmd("acknowledge") .action((_, args) => args.copy(cmd = "acknowledge")) .text("acknowledge an alarm") - .children(requiredAlarmKey: _*) + .children(requiredAlarmKey*) cmd("unacknowledge") .action((_, args) => args.copy(cmd = "unacknowledge")) .text("unacknowledge an alarm") - .children(requiredAlarmKey: _*) + .children(requiredAlarmKey*) cmd("activate") .action((_, args) => args.copy(cmd = "activate")) .text("activate an alarm") - .children(requiredAlarmKey: _*) + .children(requiredAlarmKey*) cmd("deactivate") .action((_, args) => args.copy(cmd = "deactivate")) .text("deactivate an alarm") - .children(requiredAlarmKey: _*) + .children(requiredAlarmKey*) cmd("shelve") .action((_, args) => args.copy(cmd = "shelve")) .text("shelve an alarm") - .children(requiredAlarmKey: _*) + .children(requiredAlarmKey*) cmd("unshelve") .action((_, args) => args.copy(cmd = "unshelve")) .text("unshelve an alarm") - .children(requiredAlarmKey: _*) + .children(requiredAlarmKey*) cmd("reset") .action((_, args) => args.copy(cmd = "reset")) .text("reset latched severity of an alarm") - .children(requiredAlarmKey: _*) + .children(requiredAlarmKey*) cmd("list") .action((_, args) => args.copy(cmd = "list")) .text("list alarms") - .children(optionalAlarmKey :+ metadata :+ status: _*) + .children(optionalAlarmKey :+ metadata :+ status*) opt[String]("locationHost") action { (x, c) => c.copy(locationHost = x) diff --git a/csw-alarm/csw-alarm-cli/src/test/scala/csw/alarm/cli/AlarmCliTestSetup.scala b/csw-alarm/csw-alarm-cli/src/test/scala/csw/alarm/cli/AlarmCliTestSetup.scala index a2e2b67db8..9f944b9f69 100644 --- a/csw-alarm/csw-alarm-cli/src/test/scala/csw/alarm/cli/AlarmCliTestSetup.scala +++ b/csw-alarm/csw-alarm-cli/src/test/scala/csw/alarm/cli/AlarmCliTestSetup.scala @@ -31,8 +31,8 @@ trait AlarmCliTestSetup extends HTTPLocationService with EmbeddedRedis with Even val argsParser = new ArgsParser(BuildInfo.name) val logBuffer: mutable.Buffer[String] = mutable.Buffer.empty[String] - var redisSentinel: RedisSentinel = _ - var redisServer: RedisServer = _ + var redisSentinel: RedisSentinel = scala.compiletime.uninitialized + var redisServer: RedisServer = scala.compiletime.uninitialized private def printLine(msg: Any): Unit = logBuffer += msg.toString diff --git a/csw-alarm/csw-alarm-cli/src/test/scala/csw/alarm/cli/CliAppTest.scala b/csw-alarm/csw-alarm-cli/src/test/scala/csw/alarm/cli/CliAppTest.scala index e0510839d1..122d77a882 100644 --- a/csw-alarm/csw-alarm-cli/src/test/scala/csw/alarm/cli/CliAppTest.scala +++ b/csw-alarm/csw-alarm-cli/src/test/scala/csw/alarm/cli/CliAppTest.scala @@ -232,7 +232,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication { val cmd = Options("list") cliApp.execute(cmd) - logBuffer.toList shouldEqualContentsOf "list/all_alarms.txt" + logBuffer.toList `shouldEqualContentsOf` "list/all_alarms.txt" } // DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms) @@ -241,7 +241,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication { val cmd = Options("list", maybeSubsystem = Some(NFIRAOS)) cliApp.execute(cmd) - logBuffer.toList shouldEqualContentsOf "list/subsystem_alarms.txt" + logBuffer.toList `shouldEqualContentsOf` "list/subsystem_alarms.txt" } // DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms) @@ -254,7 +254,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication { ) cliApp.execute(cmd) - logBuffer.toList shouldEqualContentsOf "list/component_alarms.txt" + logBuffer.toList `shouldEqualContentsOf` "list/component_alarms.txt" } // DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms) @@ -268,7 +268,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication { ) cliApp.execute(cmd) - logBuffer.toList shouldEqualContentsOf "list/with_name_alarms.txt" + logBuffer.toList `shouldEqualContentsOf` "list/with_name_alarms.txt" } // DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms) @@ -283,7 +283,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication { ) cliApp.execute(cmd) - logBuffer.toList shouldEqualContentsOf "metadata.txt" + logBuffer.toList `shouldEqualContentsOf` "metadata.txt" } // DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms) @@ -300,7 +300,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication { cliApp.execute(cmd) // alarm time changes on every run hence filter out time before assertion - logBuffer.toList shouldEqualContentsOf "status.txt" + logBuffer.toList `shouldEqualContentsOf` "status.txt" } diff --git a/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/AlarmServiceFactory.scala b/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/AlarmServiceFactory.scala index 224f8359de..9889dacbec 100644 --- a/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/AlarmServiceFactory.scala +++ b/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/AlarmServiceFactory.scala @@ -43,7 +43,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) { * @param system an actor system required for underlying actors * @return an instance of [[csw.alarm.api.scaladsl.AlarmAdminService]] */ - def makeAdminApi(locationService: LocationService)(implicit system: ActorSystem[_]): AlarmAdminService = { + def makeAdminApi(locationService: LocationService)(implicit system: ActorSystem[?]): AlarmAdminService = { implicit val ec: ExecutionContext = system.executionContext alarmService(new AlarmServiceLocationResolver(locationService)) } @@ -56,7 +56,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) { * @param system an actor system required for underlying actors * @return an instance of [[csw.alarm.api.scaladsl.AlarmAdminService]] */ - def makeAdminApi(host: String, port: Int)(implicit system: ActorSystem[_]): AlarmAdminService = { + def makeAdminApi(host: String, port: Int)(implicit system: ActorSystem[?]): AlarmAdminService = { implicit val ec: ExecutionContext = system.executionContext alarmService(new AlarmServiceHostPortResolver(host, port)) } @@ -68,7 +68,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) { * @param system an actor system required for underlying actors * @return an instance of [[csw.alarm.api.scaladsl.AlarmService]] */ - def makeClientApi(locationService: LocationService)(implicit system: ActorSystem[_]): AlarmService = + def makeClientApi(locationService: LocationService)(implicit system: ActorSystem[?]): AlarmService = makeAdminApi(locationService) /** @@ -79,7 +79,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) { * @param system an actor system required for underlying actors * @return an instance of [[csw.alarm.api.scaladsl.AlarmService]] */ - def makeClientApi(host: String, port: Int)(implicit system: ActorSystem[_]): AlarmService = makeAdminApi(host, port) + def makeClientApi(host: String, port: Int)(implicit system: ActorSystem[?]): AlarmService = makeAdminApi(host, port) /** * Creates [[csw.alarm.api.javadsl.IAlarmService]] instance for non admin users using [[csw.location.api.javadsl.ILocationService]] @@ -88,7 +88,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) { * @param system an actor system required for underlying actors * @return an instance of [[csw.alarm.api.javadsl.IAlarmService]] */ - def jMakeClientApi(locationService: ILocationService, system: ActorSystem[_]): IAlarmService = + def jMakeClientApi(locationService: ILocationService, system: ActorSystem[?]): IAlarmService = new JAlarmServiceImpl(makeAdminApi(locationService.asScala)(system)) /** @@ -99,20 +99,20 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) { * @param system an actor system required for underlying actors * @return an instance of [[csw.alarm.api.javadsl.IAlarmService]] */ - def jMakeClientApi(host: String, port: Int, system: ActorSystem[_]): IAlarmService = + def jMakeClientApi(host: String, port: Int, system: ActorSystem[?]): IAlarmService = new JAlarmServiceImpl(makeAdminApi(host, port)(system)) /** * ********** INTERNAL *********** */ - private def alarmService(alarmServiceResolver: AlarmServiceResolver)(implicit system: ActorSystem[_], ec: ExecutionContext) = { + private def alarmService(alarmServiceResolver: AlarmServiceResolver)(implicit system: ActorSystem[?], ec: ExecutionContext) = { val settings = new Settings(ConfigFactory.load()) val redisConnectionsFactory = new RedisConnectionsFactory(alarmServiceResolver, settings.masterId, new RomaineFactory(redisClient)) new AlarmServiceImpl(redisConnectionsFactory, settings) } - private[alarm] def makeAlarmImpl(locationService: LocationService)(implicit system: ActorSystem[_]) = { + private[alarm] def makeAlarmImpl(locationService: LocationService)(implicit system: ActorSystem[?]) = { implicit val ec: ExecutionContext = system.executionContext alarmService(new AlarmServiceLocationResolver(locationService)) } diff --git a/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/AlarmServiceImpl.scala b/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/AlarmServiceImpl.scala index 2c6ea8d348..1f6fa9302e 100644 --- a/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/AlarmServiceImpl.scala +++ b/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/AlarmServiceImpl.scala @@ -17,7 +17,7 @@ private[alarm] class AlarmServiceImpl( override val redisConnectionsFactory: RedisConnectionsFactory, override val settings: Settings )(implicit - override val actorSystem: typed.ActorSystem[_], + override val actorSystem: typed.ActorSystem[?], val ec: ExecutionContext ) extends AlarmAdminService with MetadataServiceModule diff --git a/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/services/HealthServiceModule.scala b/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/services/HealthServiceModule.scala index 584af7faaa..e31665fb79 100644 --- a/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/services/HealthServiceModule.scala +++ b/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/services/HealthServiceModule.scala @@ -21,7 +21,7 @@ private[client] trait HealthServiceModule extends HealthService { self: SeverityService => val redisConnectionsFactory: RedisConnectionsFactory - implicit val actorSystem: typed.ActorSystem[_] + implicit val actorSystem: typed.ActorSystem[?] import redisConnectionsFactory._ private val log = AlarmServiceLogger.getLogger diff --git a/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/services/SeverityServiceModule.scala b/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/services/SeverityServiceModule.scala index 1d4d6e0a32..bb35ec7c3c 100644 --- a/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/services/SeverityServiceModule.scala +++ b/csw-alarm/csw-alarm-client/src/main/scala/csw/alarm/client/internal/services/SeverityServiceModule.scala @@ -27,11 +27,11 @@ import cps.compat.FutureAsync.* import scala.concurrent.Future private[client] trait SeverityServiceModule extends SeverityService { - self: MetadataService with StatusService => + self: MetadataService & StatusService => val redisConnectionsFactory: RedisConnectionsFactory def settings: Settings - implicit val actorSystem: typed.ActorSystem[_] + implicit val actorSystem: typed.ActorSystem[?] import redisConnectionsFactory._ private val log = AlarmServiceLogger.getLogger diff --git a/csw-alarm/csw-alarm-client/src/test/scala/csw/alarm/client/internal/helpers/TestDataFeeder.scala b/csw-alarm/csw-alarm-client/src/test/scala/csw/alarm/client/internal/helpers/TestDataFeeder.scala index b3a4c17a04..a525ad756d 100644 --- a/csw-alarm/csw-alarm-client/src/test/scala/csw/alarm/client/internal/helpers/TestDataFeeder.scala +++ b/csw-alarm/csw-alarm-client/src/test/scala/csw/alarm/client/internal/helpers/TestDataFeeder.scala @@ -17,7 +17,7 @@ import csw.prefix.models.Prefix import csw.prefix.models.Subsystem.AOESW trait TestDataFeeder { - self: SeverityServiceModule with MetadataServiceModule with StatusServiceModule => + self: SeverityServiceModule & MetadataServiceModule & StatusServiceModule => def feedTestData(testCase: SetSeverityTestCase): Unit = feedTestData( diff --git a/csw-alarm/csw-alarm-models/src/main/scala/csw/alarm/models/Key.scala b/csw-alarm/csw-alarm-models/src/main/scala/csw/alarm/models/Key.scala index eefcffa826..0729b1e94c 100644 --- a/csw-alarm/csw-alarm-models/src/main/scala/csw/alarm/models/Key.scala +++ b/csw-alarm/csw-alarm-models/src/main/scala/csw/alarm/models/Key.scala @@ -36,7 +36,7 @@ sealed abstract class Key private[alarm] (subsystem: String, component: String, case null => false case _ => val x = that.asInstanceOf[AnyRef] - (x eq this.asInstanceOf[AnyRef]) || (x eq self.asInstanceOf[AnyRef]) || (x equals self) + (x eq this.asInstanceOf[AnyRef]) || (x eq self.asInstanceOf[AnyRef]) || (x `equals` self) } override def toString: String = "" + self } diff --git a/csw-benchmark/src/main/scala/csw/benchmark/command/CommandServiceBenchmark.scala b/csw-benchmark/src/main/scala/csw/benchmark/command/CommandServiceBenchmark.scala index 11abf4d084..0e2b7f3cee 100644 --- a/csw-benchmark/src/main/scala/csw/benchmark/command/CommandServiceBenchmark.scala +++ b/csw-benchmark/src/main/scala/csw/benchmark/command/CommandServiceBenchmark.scala @@ -39,11 +39,11 @@ import scala.concurrent.duration.DurationInt @Measurement(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS, batchSize = 1) class CommandServiceBenchmark { - implicit var timeout: util.Timeout = _ - implicit var scheduler: Scheduler = _ - var setupCommand: commands.Setup = _ - var componentRef: CommandService = _ - private var adminWiring: ServerWiring = _ + implicit var timeout: util.Timeout = scala.compiletime.uninitialized + implicit var scheduler: Scheduler = scala.compiletime.uninitialized + var setupCommand: commands.Setup = scala.compiletime.uninitialized + var componentRef: CommandService = scala.compiletime.uninitialized + private var adminWiring: ServerWiring = scala.compiletime.uninitialized @Setup(Level.Trial) def setup(): Unit = { diff --git a/csw-benchmark/src/main/scala/csw/benchmark/event/Data.scala b/csw-benchmark/src/main/scala/csw/benchmark/event/Data.scala index 92426ab656..0512b62a70 100644 --- a/csw-benchmark/src/main/scala/csw/benchmark/event/Data.scala +++ b/csw-benchmark/src/main/scala/csw/benchmark/event/Data.scala @@ -24,7 +24,7 @@ object Data { private val arrayDataKey = KeyType.IntArrayKey.make("intarrays") private val matrixDataKey = KeyType.IntMatrixKey.make("intmatrices") - private val paramSet: Set[Parameter[_]] = Set( + private val paramSet: Set[Parameter[?]] = Set( byteKey.set(100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100), intKey.set(100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100), doubleKey.set(100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, diff --git a/csw-benchmark/src/main/scala/csw/benchmark/logging/E2ELoggingBenchmark.scala b/csw-benchmark/src/main/scala/csw/benchmark/logging/E2ELoggingBenchmark.scala index a32bdc7c7f..7c08b0aa2e 100644 --- a/csw-benchmark/src/main/scala/csw/benchmark/logging/E2ELoggingBenchmark.scala +++ b/csw-benchmark/src/main/scala/csw/benchmark/logging/E2ELoggingBenchmark.scala @@ -34,10 +34,10 @@ import scala.concurrent.duration.DurationLong // DEOPSCSW-279: Test logging performance @State(Scope.Benchmark) class E2ELoggingBenchmark { - var actorSystem: typed.ActorSystem[SpawnProtocol.Command] = _ - var log: Logger = _ - var fileAppender: FileAppender = _ - var person: Person = _ + var actorSystem: typed.ActorSystem[SpawnProtocol.Command] = scala.compiletime.uninitialized + var log: Logger = scala.compiletime.uninitialized + var fileAppender: FileAppender = scala.compiletime.uninitialized + var person: Person = scala.compiletime.uninitialized @Setup(Level.Trial) def setup(): Unit = { diff --git a/csw-benchmark/src/main/scala/csw/benchmark/logging/FileAppenderBenchmark.scala b/csw-benchmark/src/main/scala/csw/benchmark/logging/FileAppenderBenchmark.scala index 8148b20576..a2da5b79ee 100644 --- a/csw-benchmark/src/main/scala/csw/benchmark/logging/FileAppenderBenchmark.scala +++ b/csw-benchmark/src/main/scala/csw/benchmark/logging/FileAppenderBenchmark.scala @@ -33,8 +33,8 @@ import scala.concurrent.duration.DurationLong // DEOPSCSW-279: Test logging performance @State(Scope.Benchmark) class FileAppenderBenchmark { - var actorSystem: typed.ActorSystem[SpawnProtocol.Command] = _ - var fileAppender: FileAppender = _ + var actorSystem: typed.ActorSystem[SpawnProtocol.Command] = scala.compiletime.uninitialized + var fileAppender: FileAppender = scala.compiletime.uninitialized @Setup(Level.Trial) def setup(): Unit = { diff --git a/csw-benchmark/src/main/scala/csw/benchmark/logging/JsonUtilBenchmark.scala b/csw-benchmark/src/main/scala/csw/benchmark/logging/JsonUtilBenchmark.scala index 227c2b9de7..6e257a97b0 100644 --- a/csw-benchmark/src/main/scala/csw/benchmark/logging/JsonUtilBenchmark.scala +++ b/csw-benchmark/src/main/scala/csw/benchmark/logging/JsonUtilBenchmark.scala @@ -47,8 +47,8 @@ class JsonUtilBenchmark { val expectedLogMsgJson1: JsObject = Json.parse(logMsgString1).as[JsObject] - var gson: Gson = _ - var jacksonObjectMapper: ObjectMapper = _ + var gson: Gson = scala.compiletime.uninitialized + var jacksonObjectMapper: ObjectMapper = scala.compiletime.uninitialized @Setup(Level.Trial) def setup() = { diff --git a/csw-benchmark/src/main/scala/csw/benchmark/params/ImageDeSerializationBenchmark.scala b/csw-benchmark/src/main/scala/csw/benchmark/params/ImageDeSerializationBenchmark.scala index 9bbd14e66e..e677bd6d46 100644 --- a/csw-benchmark/src/main/scala/csw/benchmark/params/ImageDeSerializationBenchmark.scala +++ b/csw-benchmark/src/main/scala/csw/benchmark/params/ImageDeSerializationBenchmark.scala @@ -38,14 +38,14 @@ import scala.concurrent.duration.DurationDouble // DEOPSCSW-331: Complex payload - Include byte in paramset for Event and ObserveEvent @State(Scope.Benchmark) class ImageDeSerializationBenchmark { - private final var system: ActorSystem[_] = _ - private final var serialization: Serialization = _ - private final var prefixStr: String = _ - private final var obsId: ObsId = _ + private final var system: ActorSystem[?] = scala.compiletime.uninitialized + private final var serialization: Serialization = scala.compiletime.uninitialized + private final var prefixStr: String = scala.compiletime.uninitialized + private final var obsId: ObsId = scala.compiletime.uninitialized - private final var img_32k_tuple: (Array[Byte], Observe) = _ - private final var img_128k_tuple: (Array[Byte], Observe) = _ - private final var img_512k_tuple: (Array[Byte], Observe) = _ + private final var img_32k_tuple: (Array[Byte], Observe) = scala.compiletime.uninitialized + private final var img_128k_tuple: (Array[Byte], Observe) = scala.compiletime.uninitialized + private final var img_512k_tuple: (Array[Byte], Observe) = scala.compiletime.uninitialized @Setup(Level.Trial) def setup(): Unit = { @@ -71,7 +71,7 @@ class ImageDeSerializationBenchmark { val imageKey: Key[ArrayData[Byte]] = ByteArrayKey.make("imageKey") val binaryImgData: ArrayData[Byte] = ArrayData.fromArray(binaryData) - val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData withUnits pascal + val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData `withUnits` pascal val observe = Observe(Prefix("csw.originationPrefix"), CommandName(prefixStr), Some(obsId)).add(param) val observeSerializer = serialization.findSerializerFor(observe) diff --git a/csw-benchmark/src/main/scala/csw/benchmark/params/ImageSerializationBenchmark.scala b/csw-benchmark/src/main/scala/csw/benchmark/params/ImageSerializationBenchmark.scala index 639278893f..5e7a664d58 100644 --- a/csw-benchmark/src/main/scala/csw/benchmark/params/ImageSerializationBenchmark.scala +++ b/csw-benchmark/src/main/scala/csw/benchmark/params/ImageSerializationBenchmark.scala @@ -37,16 +37,16 @@ import scala.concurrent.duration.DurationDouble // DEOPSCSW-187: Efficient serialization to/from binary @State(Scope.Benchmark) class ImageSerializationBenchmark { - private var img_32k_Path: Path = _ - private var img_32k_Bytes: Array[Byte] = _ - private var img_128k_Path: Path = _ - private var img_128k_Bytes: Array[Byte] = _ - private var img_512k_Path: Path = _ - private var img_512k_Bytes: Array[Byte] = _ - private final var system: ActorSystem[_] = _ - private final var serialization: Serialization = _ - private final var prefixStr: String = _ - private final var obsId: ObsId = _ + private var img_32k_Path: Path = scala.compiletime.uninitialized + private var img_32k_Bytes: Array[Byte] = scala.compiletime.uninitialized + private var img_128k_Path: Path = scala.compiletime.uninitialized + private var img_128k_Bytes: Array[Byte] = scala.compiletime.uninitialized + private var img_512k_Path: Path = scala.compiletime.uninitialized + private var img_512k_Bytes: Array[Byte] = scala.compiletime.uninitialized + private final var system: ActorSystem[?] = scala.compiletime.uninitialized + private final var serialization: Serialization = scala.compiletime.uninitialized + private final var prefixStr: String = scala.compiletime.uninitialized + private final var obsId: ObsId = scala.compiletime.uninitialized @Setup(Level.Trial) def setup() = { @@ -79,7 +79,7 @@ class ImageSerializationBenchmark { val imageKey: Key[ArrayData[Byte]] = ByteArrayKey.make("imageKey") val binaryImgData: ArrayData[Byte] = ArrayData.fromArray(img_32k_Bytes) - val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData withUnits pascal + val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData `withUnits` pascal val observe = Observe(Prefix("csw.originationPrefix"), CommandName(prefixStr), Some(obsId)).add(param) val observeSerializer = serialization.findSerializerFor(observe) @@ -94,7 +94,7 @@ class ImageSerializationBenchmark { val imageKey: Key[ArrayData[Byte]] = ByteArrayKey.make("imageKey") val binaryImgData: ArrayData[Byte] = ArrayData.fromArray(img_128k_Bytes) - val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData withUnits pascal + val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData `withUnits` pascal val observe = Observe(Prefix("csw.originationPrefix"), CommandName(prefixStr), Some(obsId)).add(param) val observeSerializer = serialization.findSerializerFor(observe) @@ -109,7 +109,7 @@ class ImageSerializationBenchmark { val imageKey: Key[ArrayData[Byte]] = ByteArrayKey.make("imageKey") val binaryImgData: ArrayData[Byte] = ArrayData.fromArray(img_512k_Bytes) - val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData withUnits pascal + val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData `withUnits` pascal val observe = Observe(Prefix("csw.originationPrefix"), CommandName(prefixStr), Some(obsId)).add(param) val observeSerializer = serialization.findSerializerFor(observe) diff --git a/csw-benchmark/src/main/scala/csw/benchmark/time/SchedulerBenchmark.scala b/csw-benchmark/src/main/scala/csw/benchmark/time/SchedulerBenchmark.scala index e30d1bce86..2d80d9ec76 100644 --- a/csw-benchmark/src/main/scala/csw/benchmark/time/SchedulerBenchmark.scala +++ b/csw-benchmark/src/main/scala/csw/benchmark/time/SchedulerBenchmark.scala @@ -24,8 +24,8 @@ class SchedulerBenchmark { final private val Offset = 20L final private val OperationsPerInvocation = 1 - private val actorSystem: ActorSystem[_] = ActorSystem(Behaviors.empty, "test") - private var timeServiceScheduler: TimeServiceScheduler = _ + private val actorSystem: ActorSystem[?] = ActorSystem(Behaviors.empty, "test") + private var timeServiceScheduler: TimeServiceScheduler = scala.compiletime.uninitialized @Setup def setup(): Unit = { diff --git a/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/StateMatchers.scala b/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/StateMatchers.scala index ce40397207..ad5280b29f 100644 --- a/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/StateMatchers.scala +++ b/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/StateMatchers.scala @@ -78,7 +78,7 @@ case class DemandMatcher(demand: DemandState, withUnits: Boolean = false, timeou */ def check(current: CurrentState): Boolean = { demand.paramSet.forall { di => - val foundItem: Option[Parameter[_]] = current.find(di) + val foundItem: Option[Parameter[?]] = current.find(di) foundItem.fold(false)(if (withUnits) _ == di else _.values.sameElements(di.values)) } } diff --git a/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/client/CommandServiceClient.scala b/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/client/CommandServiceClient.scala index 8399f288d9..74ab567207 100644 --- a/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/client/CommandServiceClient.scala +++ b/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/client/CommandServiceClient.scala @@ -27,7 +27,7 @@ import scala.concurrent.Future class CommandServiceClient( httpTransport: Transport[CommandServiceRequest], websocketTransport: Transport[CommandServiceStreamRequest] -)(implicit actorSystem: ActorSystem[_]) +)(implicit actorSystem: ActorSystem[?]) extends CommandService with CommandServiceCodecs { diff --git a/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/utils/CommandServiceExtension.scala b/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/utils/CommandServiceExtension.scala index b4af23b759..fbb3d233bf 100644 --- a/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/utils/CommandServiceExtension.scala +++ b/csw-command/csw-command-api/shared/src/main/scala/csw/command/api/utils/CommandServiceExtension.scala @@ -18,7 +18,7 @@ import cps.compat.FutureAsync.* import scala.concurrent.{Future, Promise, TimeoutException} import scala.util.{Failure, Success} -class CommandServiceExtension(commandService: CommandService)(implicit val actorSystem: ActorSystem[_]) { +class CommandServiceExtension(commandService: CommandService)(implicit val actorSystem: ActorSystem[?]) { import actorSystem.executionContext def submitAndWait(controlCommand: ControlCommand)(implicit timeout: Timeout): Future[SubmitResponse] = { diff --git a/csw-command/csw-command-client/src/main/scala/csw/command/client/CommandResponseManager.scala b/csw-command/csw-command-client/src/main/scala/csw/command/client/CommandResponseManager.scala index ec7f005441..5cd46876bd 100644 --- a/csw-command/csw-command-client/src/main/scala/csw/command/client/CommandResponseManager.scala +++ b/csw-command/csw-command-client/src/main/scala/csw/command/client/CommandResponseManager.scala @@ -24,7 +24,7 @@ import scala.jdk.FutureConverters.* * @param actorSystem actor system for allowing sending messages in API */ class CommandResponseManager(val commandResponseManagerActor: ActorRef[MiniCRM.CRMMessage])(implicit - val actorSystem: ActorSystem[_] + val actorSystem: ActorSystem[?] ) { /** @@ -60,7 +60,7 @@ class CommandResponseManager(val commandResponseManagerActor: ActorRef[MiniCRM.C */ def queryFinalAll(commands: java.util.List[CompletableFuture[SubmitResponse]]): CompletableFuture[OverallResponse] = { val args = commands.asScala.toList.map(_.asScala) - queryFinalAll(args: _*).asJava.toCompletableFuture + queryFinalAll(args*).asJava.toCompletableFuture } // Returns true if all the commands in the response set have returned without Error diff --git a/csw-command/csw-command-client/src/main/scala/csw/command/client/CommandServiceFactory.scala b/csw-command/csw-command-client/src/main/scala/csw/command/client/CommandServiceFactory.scala index 35ddf86654..da2b50e7e2 100644 --- a/csw-command/csw-command-client/src/main/scala/csw/command/client/CommandServiceFactory.scala +++ b/csw-command/csw-command-client/src/main/scala/csw/command/client/CommandServiceFactory.scala @@ -21,7 +21,7 @@ import msocket.http.ws.WebsocketTransport object CommandServiceFactory { - private[csw] def make(component: ActorRef[ComponentMessage])(implicit actorSystem: ActorSystem[_]): CommandService = + private[csw] def make(component: ActorRef[ComponentMessage])(implicit actorSystem: ActorSystem[?]): CommandService = new CommandServiceImpl(component) /** @@ -31,7 +31,7 @@ object CommandServiceFactory { * @param actorSystem of the component used for executing commands to other components and wait for the responses * @return an instance of type CommandService */ - def make(componentLocation: Location)(implicit actorSystem: ActorSystem[_]): CommandService = { + def make(componentLocation: Location)(implicit actorSystem: ActorSystem[?]): CommandService = { componentLocation match { case _: TcpLocation => throw new RuntimeException("Only PekkoLocation and HttpLocation can be used to access a component") case pekkoLocation: PekkoLocation => new CommandServiceImpl(pekkoLocation.componentRef) @@ -46,10 +46,10 @@ object CommandServiceFactory { * @param actorSystem of the component used for executing commands to other components and wait for the responses * @return an instance of type ICommandService */ - def jMake(componentLocation: Location, actorSystem: ActorSystem[_]): ICommandService = + def jMake(componentLocation: Location, actorSystem: ActorSystem[?]): ICommandService = new JCommandServiceImpl(make(componentLocation)(actorSystem)) - private def httpClient(httpLocation: HttpLocation)(implicit system: ActorSystem[_]) = { + private def httpClient(httpLocation: HttpLocation)(implicit system: ActorSystem[?]) = { import csw.command.api.codecs.CommandServiceCodecs._ val baseUri = httpLocation.uri.toString val webSocketUri = Uri(baseUri).withScheme("ws").withPath(Path("/websocket-endpoint")).toString() diff --git a/csw-command/csw-command-client/src/main/scala/csw/command/client/SequencerCommandServiceImpl.scala b/csw-command/csw-command-client/src/main/scala/csw/command/client/SequencerCommandServiceImpl.scala index c7b8adf962..9ea77e4dd8 100644 --- a/csw-command/csw-command-client/src/main/scala/csw/command/client/SequencerCommandServiceImpl.scala +++ b/csw-command/csw-command-client/src/main/scala/csw/command/client/SequencerCommandServiceImpl.scala @@ -27,7 +27,7 @@ import scala.concurrent.Future * @param actorSystem required for sending sequence commands or querying the sequencer */ class SequencerCommandServiceImpl(sequencerLocation: PekkoLocation)(implicit - actorSystem: ActorSystem[_] + actorSystem: ActorSystem[?] ) extends SequencerCommandService { import actorSystem.executionContext diff --git a/csw-command/csw-command-client/src/main/scala/csw/command/client/cbor/MessageCodecs.scala b/csw-command/csw-command-client/src/main/scala/csw/command/client/cbor/MessageCodecs.scala index a8c6d39a6c..62f00e85e1 100644 --- a/csw-command/csw-command-client/src/main/scala/csw/command/client/cbor/MessageCodecs.scala +++ b/csw-command/csw-command-client/src/main/scala/csw/command/client/cbor/MessageCodecs.scala @@ -17,7 +17,7 @@ import io.bullet.borer.derivation.MapBasedCodecs.deriveAllCodecs import io.bullet.borer.{Codec, Decoder, Encoder} trait MessageCodecs extends MessageCodecsBase { - implicit def pubSubCodec[T: Encoder: Decoder, PS[_] <: PubSub[_]]: Codec[PS[T]] = pubSubCodecValue[T].asInstanceOf[Codec[PS[T]]] + implicit def pubSubCodec[T: Encoder: Decoder, PS[_] <: PubSub[?]]: Codec[PS[T]] = pubSubCodecValue[T].asInstanceOf[Codec[PS[T]]] implicit lazy val messageRemoteMsgCodec: Codec[RemoteMsg] = deriveAllCodecs } diff --git a/csw-command/csw-command-client/src/main/scala/csw/command/client/extensions/PekkoLocationExt.scala b/csw-command/csw-command-client/src/main/scala/csw/command/client/extensions/PekkoLocationExt.scala index 5737815e4c..cfc09153cc 100644 --- a/csw-command/csw-command-client/src/main/scala/csw/command/client/extensions/PekkoLocationExt.scala +++ b/csw-command/csw-command-client/src/main/scala/csw/command/client/extensions/PekkoLocationExt.scala @@ -17,7 +17,7 @@ import scala.reflect.ClassTag object PekkoLocationExt { implicit class RichPekkoLocation(val pekkoLocation: PekkoLocation) { - private def typedRef[T: ClassTag](implicit actorSystem: ActorSystem[_]): ActorRef[T] = { + private def typedRef[T: ClassTag](implicit actorSystem: ActorSystem[?]): ActorRef[T] = { val typeManifest = scala.reflect.classTag[T].runtimeClass.getSimpleName val messageManifest = pekkoLocation.connection.componentId.componentType.messageManifest @@ -34,21 +34,21 @@ object PekkoLocationExt { * * @return a typed ActorRef that understands only ComponentMessage */ - def componentRef(implicit actorSystem: ActorSystem[_]): ActorRef[ComponentMessage] = typedRef[ComponentMessage] + def componentRef(implicit actorSystem: ActorSystem[?]): ActorRef[ComponentMessage] = typedRef[ComponentMessage] /** * If the component type is Container, use this to get the correct ActorRef * * @return a typed ActorRef that understands only ContainerMessage */ - def containerRef(implicit actorSystem: ActorSystem[_]): ActorRef[ContainerMessage] = typedRef[ContainerMessage] + def containerRef(implicit actorSystem: ActorSystem[?]): ActorRef[ContainerMessage] = typedRef[ContainerMessage] /** * If the component type is Sequencer, use this to get the correct ActorRef * * @return a typed ActorRef that understands only SequencerMsg */ - def sequencerRef(implicit actorSystem: ActorSystem[_]): ActorRef[SequencerMsg] = typedRef[SequencerMsg] + def sequencerRef(implicit actorSystem: ActorSystem[?]): ActorRef[SequencerMsg] = typedRef[SequencerMsg] } } diff --git a/csw-command/csw-command-client/src/main/scala/csw/command/client/internal/CommandServiceImpl.scala b/csw-command/csw-command-client/src/main/scala/csw/command/client/internal/CommandServiceImpl.scala index 9dd48a1563..9b9da4e82e 100644 --- a/csw-command/csw-command-client/src/main/scala/csw/command/client/internal/CommandServiceImpl.scala +++ b/csw-command/csw-command-client/src/main/scala/csw/command/client/internal/CommandServiceImpl.scala @@ -30,7 +30,7 @@ import msocket.api.Subscription import scala.concurrent.duration.DurationInt import scala.concurrent.{ExecutionContext, Future} -private[command] class CommandServiceImpl(component: ActorRef[ComponentMessage])(implicit val actorSystem: ActorSystem[_]) +private[command] class CommandServiceImpl(component: ActorRef[ComponentMessage])(implicit val actorSystem: ActorSystem[?]) extends CommandService { private implicit val ec: ExecutionContext = actorSystem.executionContext diff --git a/csw-command/csw-command-client/src/test/scala/csw/params/core/InterOperabilityTest.scala b/csw-command/csw-command-client/src/test/scala/csw/params/core/InterOperabilityTest.scala index 04607c1ca4..08df1f3171 100644 --- a/csw-command/csw-command-client/src/test/scala/csw/params/core/InterOperabilityTest.scala +++ b/csw-command/csw-command-client/src/test/scala/csw/params/core/InterOperabilityTest.scala @@ -27,7 +27,7 @@ import org.scalatest.matchers.should.Matchers case class CommandMsg( command: Command, - ackTo: ActorRef[java.util.Set[Parameter[_]]], + ackTo: ActorRef[java.util.Set[Parameter[?]]], replyTo: ActorRef[SystemEvent], obsIdAck: ActorRef[Optional[ObsId]] ) @@ -43,7 +43,7 @@ class InterOperabilityTest extends AnyFunSuite with Matchers with BeforeAndAfter private val intParam = intKey.set(22, 33) private val stringParam = stringKey.set("First", "Second") - private implicit val system: ActorSystem[_] = ActorSystem(Behaviors.empty, "test") + private implicit val system: ActorSystem[?] = ActorSystem(Behaviors.empty, "test") implicit val testKit: TestKitSettings = TestKitSettings(system) private val scalaSetup = Setup(Prefix(prefixStr), CommandName(prefixStr), Some(obsId)).add(intParam).add(stringParam) @@ -60,13 +60,13 @@ class InterOperabilityTest extends AnyFunSuite with Matchers with BeforeAndAfter // 2. onMessage, Java actor extracts paramSet from Setup command and replies back to scala actor // 3. also, java actor creates StatusEvent and forward it to scala actor test("should able to send commands/events from scala code to java and vice a versa | DEOPSCSW-184") { - val ackProbe = TestProbe[java.util.Set[Parameter[_]]]() + val ackProbe = TestProbe[java.util.Set[Parameter[?]]]() val replyToProbe = TestProbe[SystemEvent]() val obsIdProbe = TestProbe[Optional[ObsId]]() jCommandHandlerActor ! CommandMsg(scalaSetup, ackProbe.ref, replyToProbe.ref, obsIdProbe.ref) - val set = ackProbe.expectMessageType[java.util.Set[Parameter[_]]] + val set = ackProbe.expectMessageType[java.util.Set[Parameter[?]]] set.asScala.toSet shouldBe Set(intParam, stringParam) val eventFromJava = replyToProbe.expectMessageType[SystemEvent] diff --git a/csw-commons/src/main/scala/csw/commons/CborPekkoSerializer.scala b/csw-commons/src/main/scala/csw/commons/CborPekkoSerializer.scala index 41fdc3ffe0..1077db503e 100644 --- a/csw-commons/src/main/scala/csw/commons/CborPekkoSerializer.scala +++ b/csw-commons/src/main/scala/csw/commons/CborPekkoSerializer.scala @@ -12,7 +12,7 @@ import scala.reflect.ClassTag abstract class CborPekkoSerializer[Ser] extends Serializer { - private var registrations: List[(Class[_], Codec[_])] = Nil + private var registrations: List[(Class[?], Codec[?])] = Nil protected def register[T <: Ser: Encoder: Decoder: ClassTag]: Unit = { registrations ::= scala.reflect.classTag[T].runtimeClass -> Codec.of[T] @@ -23,16 +23,16 @@ abstract class CborPekkoSerializer[Ser] extends Serializer { override def toBinary(o: AnyRef): Array[Byte] = { val codec = getCodec(o.getClass, "encoding") val encoder = codec.encoder.asInstanceOf[Encoder[AnyRef]] - Cbor.encode(o)(encoder).toByteArray + Cbor.encode(o)(using encoder).toByteArray } - override def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef = { + override def fromBinary(bytes: Array[Byte], manifest: Option[Class[?]]): AnyRef = { val codec = getCodec(manifest.get, "decoding") val decoder = codec.decoder.asInstanceOf[Decoder[AnyRef]] - Cbor.decode(bytes).to[AnyRef](decoder).value + Cbor.decode(bytes).to[AnyRef](using decoder).value } - private def getCodec(classValue: Class[_], action: String): Codec[_] = { + private def getCodec(classValue: Class[?], action: String): Codec[?] = { registrations .collectFirst { case (clazz, codec) if clazz.isAssignableFrom(classValue) => codec diff --git a/csw-commons/src/test/scala/csw/commons/AskProxyTestKit.scala b/csw-commons/src/test/scala/csw/commons/AskProxyTestKit.scala index 6a2475960d..c023c752b0 100644 --- a/csw-commons/src/test/scala/csw/commons/AskProxyTestKit.scala +++ b/csw-commons/src/test/scala/csw/commons/AskProxyTestKit.scala @@ -12,7 +12,7 @@ import org.apache.pekko.actor.typed.{ActorRef, ActorSystem} import scala.language.reflectiveCalls import scala.reflect.Selectable.reflectiveSelectable -abstract class AskProxyTestKit[Msg, Impl](implicit actorSystem: ActorSystem[_]) { +abstract class AskProxyTestKit[Msg, Impl](implicit actorSystem: ActorSystem[?]) { protected def make(actorRef: ActorRef[Msg]): Impl def withBehavior(pf: PartialFunction[Msg, Unit]): Assertable = { diff --git a/csw-config/csw-config-api/src/main/scala/csw/config/api/ConfigData.scala b/csw-config/csw-config-api/src/main/scala/csw/config/api/ConfigData.scala index 6f4a42e270..79804d02ad 100644 --- a/csw-config/csw-config-api/src/main/scala/csw/config/api/ConfigData.scala +++ b/csw-config/csw-config-api/src/main/scala/csw/config/api/ConfigData.scala @@ -32,7 +32,7 @@ class ConfigData private (val source: Source[ByteString, Any], val length: Long) * @param system an pekko system required to start the stream of file data that will form a string out of bytes * @return a future that completes with string representation of file data */ - def toStringF(implicit system: ActorSystem[_]): Future[String] = + def toStringF(implicit system: ActorSystem[?]): Future[String] = source.runFold("")((str, bs) => str + bs.utf8String) /** @@ -42,7 +42,7 @@ class ConfigData private (val source: Source[ByteString, Any], val length: Long) * and parse it to `Config` model * @return a future that completes with `Config` model representing the file data */ - def toConfigObject(implicit system: ActorSystem[_]): Future[Config] = { + def toConfigObject(implicit system: ActorSystem[?]): Future[Config] = { import system.executionContext toStringF.map { s => ConfigFactory.parseString(s) } } @@ -53,7 +53,7 @@ class ConfigData private (val source: Source[ByteString, Any], val length: Long) * @param system required to start the stream of file data that will form a string out of bytes * @return a CompletableFuture that completes with string representation of file data */ - private[config] def toJStringF(implicit system: ActorSystem[_]): CompletableFuture[String] = + private[config] def toJStringF(implicit system: ActorSystem[?]): CompletableFuture[String] = toStringF.asJava.toCompletableFuture /** @@ -63,7 +63,7 @@ class ConfigData private (val source: Source[ByteString, Any], val length: Long) * and parse it to `Config` model * @return a CompletableFuture that completes with `Config` model representing the file data */ - private[config] def toJConfigObject(implicit system: ActorSystem[_]): CompletableFuture[Config] = + private[config] def toJConfigObject(implicit system: ActorSystem[?]): CompletableFuture[Config] = toConfigObject.asJava.toCompletableFuture /** @@ -73,7 +73,7 @@ class ConfigData private (val source: Source[ByteString, Any], val length: Long) * @param system an pekko system required to start the stream of file data and dump it onto the provided `path` * @return a future of path that represents the file path on local machine */ - def toPath(path: Path)(implicit system: ActorSystem[_]): Future[Path] = { + def toPath(path: Path)(implicit system: ActorSystem[?]): Future[Path] = { import system.executionContext source .toMat(FileIO.toPath(path))(Keep.right) @@ -87,7 +87,7 @@ class ConfigData private (val source: Source[ByteString, Any], val length: Long) * @param system an pekko system required to start the stream of file data and convert it to InputStream * @return an inputStream which emits the bytes read from source of file data */ - private[config] def toInputStream(implicit system: ActorSystem[_]): InputStream = + private[config] def toInputStream(implicit system: ActorSystem[?]): InputStream = source.runWith(StreamConverters.asInputStream()) } diff --git a/csw-config/csw-config-api/src/main/scala/csw/config/api/internal/ConfigStreamExts.scala b/csw-config/csw-config-api/src/main/scala/csw/config/api/internal/ConfigStreamExts.scala index 6f3524b09e..35e4afc75c 100644 --- a/csw-config/csw-config-api/src/main/scala/csw/config/api/internal/ConfigStreamExts.scala +++ b/csw-config/csw-config-api/src/main/scala/csw/config/api/internal/ConfigStreamExts.scala @@ -31,7 +31,7 @@ private[config] object ConfigStreamExts { * * @param n number of elements to be extracted as prefix */ - def prefixAndStitch(n: Int)(implicit system: ActorSystem[_]): (Future[Seq[Out]], Source[Out, Future[NotUsed]]) = { + def prefixAndStitch(n: Int)(implicit system: ActorSystem[?]): (Future[Seq[Out]], Source[Out, Future[NotUsed]]) = { import system.executionContext val p = Promise[Seq[Out]]() val futureSource = source.prefixAndTail(n).runWith(Sink.head).map { case (prefix, remainingSource) => diff --git a/csw-config/csw-config-cli/src/test/scala/csw/config/cli/CommandLineRunnerTest.scala b/csw-config/csw-config-cli/src/test/scala/csw/config/cli/CommandLineRunnerTest.scala index 462a8930ca..2f888d1ba0 100644 --- a/csw-config/csw-config-cli/src/test/scala/csw/config/cli/CommandLineRunnerTest.scala +++ b/csw-config/csw-config-cli/src/test/scala/csw/config/cli/CommandLineRunnerTest.scala @@ -30,7 +30,7 @@ import org.scalatest.matchers.should.Matchers // DEOPSCSW-576: Auth token for Configuration service class CommandLineRunnerTest extends HTTPLocationService with Matchers with BeforeAndAfterEach with MockedAuthentication { - private val clientSystem: typed.ActorSystem[_] = typed.ActorSystem(Behaviors.empty, "config-cli") + private val clientSystem: typed.ActorSystem[?] = typed.ActorSystem(Behaviors.empty, "config-cli") private val locationService = HttpLocationServiceFactory.makeLocalClient(clientSystem) private val nativeAuthAdapter: InstalledAppAuthAdapter = mock[InstalledAppAuthAdapter] private val clientWiring = Wiring.noPrinting(locationService, factory, nativeAuthAdapter) diff --git a/csw-config/csw-config-client/src/main/scala/csw/config/client/HttpCodecs.scala b/csw-config/csw-config-client/src/main/scala/csw/config/client/HttpCodecs.scala index fe8a44b8ff..c631073423 100644 --- a/csw-config/csw-config-client/src/main/scala/csw/config/client/HttpCodecs.scala +++ b/csw-config/csw-config-client/src/main/scala/csw/config/client/HttpCodecs.scala @@ -22,13 +22,13 @@ trait HttpCodecs { implicit def unmarshaller[A: Decoder]: FromEntityUnmarshaller[A] = { Unmarshaller.byteStringUnmarshaller - .forContentTypes(unmarshallerContentTypes: _*) + .forContentTypes(unmarshallerContentTypes*) .map(Json.decode(_).to[A].value) } implicit def marshaller[A: Encoder]: ToEntityMarshaller[A] = { Marshaller - .oneOf(mediaTypes: _*)(Marshaller.byteStringMarshaller(_)) + .oneOf(mediaTypes*)(Marshaller.byteStringMarshaller(_)) .compose(Json.encode(_).to[ByteString].result) } } diff --git a/csw-config/csw-config-client/src/main/scala/csw/config/client/commons/ConfigUtils.scala b/csw-config/csw-config-client/src/main/scala/csw/config/client/commons/ConfigUtils.scala index 83f8f0821a..091bce2cd8 100644 --- a/csw-config/csw-config-client/src/main/scala/csw/config/client/commons/ConfigUtils.scala +++ b/csw-config/csw-config-client/src/main/scala/csw/config/client/commons/ConfigUtils.scala @@ -15,7 +15,7 @@ import csw.config.api.scaladsl.ConfigClientService import cps.compat.FutureAsync.* import scala.concurrent.Future -class ConfigUtils(configClientService: ConfigClientService)(implicit system: ActorSystem[_]) { +class ConfigUtils(configClientService: ConfigClientService)(implicit system: ActorSystem[?]) { import system.executionContext diff --git a/csw-config/csw-config-client/src/main/scala/csw/config/client/internal/ActorRuntime.scala b/csw-config/csw-config-client/src/main/scala/csw/config/client/internal/ActorRuntime.scala index d65722506c..cdf3f0efb1 100644 --- a/csw-config/csw-config-client/src/main/scala/csw/config/client/internal/ActorRuntime.scala +++ b/csw-config/csw-config-client/src/main/scala/csw/config/client/internal/ActorRuntime.scala @@ -13,8 +13,8 @@ import scala.concurrent.{ExecutionContextExecutor, Future} /** * A convenient class wrapping actor system and providing handles for execution context and clean up of actor system */ -private[csw] class ActorRuntime(_typedSystem: ActorSystem[_] = ActorSystem(SpawnProtocol(), "config-client-system")) { - implicit val actorSystem: ActorSystem[_] = _typedSystem +private[csw] class ActorRuntime(_typedSystem: ActorSystem[?] = ActorSystem(SpawnProtocol(), "config-client-system")) { + implicit val actorSystem: ActorSystem[?] = _typedSystem implicit val ec: ExecutionContextExecutor = actorSystem.executionContext /** diff --git a/csw-config/csw-config-client/src/main/scala/csw/config/client/javadsl/JConfigClientFactory.scala b/csw-config/csw-config-client/src/main/scala/csw/config/client/javadsl/JConfigClientFactory.scala index 97e04601e2..6a1b55f59c 100644 --- a/csw-config/csw-config-client/src/main/scala/csw/config/client/javadsl/JConfigClientFactory.scala +++ b/csw-config/csw-config-client/src/main/scala/csw/config/client/javadsl/JConfigClientFactory.scala @@ -26,7 +26,7 @@ object JConfigClientFactory { * @return an instance of IConfigService */ def adminApi( - actorSystem: ActorSystem[_], + actorSystem: ActorSystem[?], locationService: ILocationService, tokenFactory: TokenFactory ): IConfigService = make(actorSystem, locationService, Some(tokenFactory)) @@ -38,11 +38,11 @@ object JConfigClientFactory { * @param locationService location service instance which will be used to resolve the location of config server * @return an instance of IConfigClientService */ - def clientApi(actorSystem: ActorSystem[_], locationService: ILocationService): IConfigClientService = + def clientApi(actorSystem: ActorSystem[?], locationService: ILocationService): IConfigClientService = make(actorSystem, locationService) private def make( - actorSystem: ActorSystem[_], + actorSystem: ActorSystem[?], locationService: ILocationService, tokenFactory: Option[TokenFactory] = None ): IConfigService = { diff --git a/csw-config/csw-config-client/src/main/scala/csw/config/client/scaladsl/ConfigClientFactory.scala b/csw-config/csw-config-client/src/main/scala/csw/config/client/scaladsl/ConfigClientFactory.scala index b0a959f054..7092c5c3cd 100644 --- a/csw-config/csw-config-client/src/main/scala/csw/config/client/scaladsl/ConfigClientFactory.scala +++ b/csw-config/csw-config-client/src/main/scala/csw/config/client/scaladsl/ConfigClientFactory.scala @@ -25,7 +25,7 @@ object ConfigClientFactory { * @return an instance of ConfigService */ def adminApi( - actorSystem: ActorSystem[_], + actorSystem: ActorSystem[?], locationService: LocationService, tokenFactory: TokenFactory ): ConfigService = make(new ActorRuntime(actorSystem), locationService, Some(tokenFactory)) @@ -37,7 +37,7 @@ object ConfigClientFactory { * @param locationService location service instance which will be used to resolve the location of config server * @return an instance of ConfigClientService */ - def clientApi(actorSystem: ActorSystem[_], locationService: LocationService): ConfigClientService = + def clientApi(actorSystem: ActorSystem[?], locationService: LocationService): ConfigClientService = make(new ActorRuntime(actorSystem), locationService) private[config] def make( diff --git a/csw-config/csw-config-server/src/main/scala/csw/config/server/files/Sha1.scala b/csw-config/csw-config-server/src/main/scala/csw/config/server/files/Sha1.scala index f59819524b..20bdce04c8 100644 --- a/csw-config/csw-config-server/src/main/scala/csw/config/server/files/Sha1.scala +++ b/csw-config/csw-config-server/src/main/scala/csw/config/server/files/Sha1.scala @@ -20,7 +20,7 @@ import scala.concurrent.Future */ object Sha1 { - private def fromSource(source: Source[ByteString, Any])(implicit system: ActorSystem[_]): Future[String] = + private def fromSource(source: Source[ByteString, Any])(implicit system: ActorSystem[?]): Future[String] = source.runWith(sink) /** @@ -31,7 +31,7 @@ object Sha1 { * of it * @return a future that completes with calculated sha value of the data */ - def fromConfigData(configData: ConfigData)(implicit system: ActorSystem[_]): Future[String] = + def fromConfigData(configData: ConfigData)(implicit system: ActorSystem[?]): Future[String] = fromSource(configData.source) /** @@ -44,7 +44,7 @@ object Sha1 { * of it * @return a future that completes with calculated sha value of the data */ - def fromPath(path: Path)(implicit system: ActorSystem[_]): Future[String] = + def fromPath(path: Path)(implicit system: ActorSystem[?]): Future[String] = fromSource(FileIO.fromPath(path)) /** diff --git a/csw-config/csw-config-server/src/main/scala/csw/config/server/http/HttpCodecs.scala b/csw-config/csw-config-server/src/main/scala/csw/config/server/http/HttpCodecs.scala index ad6fade136..0e01846859 100644 --- a/csw-config/csw-config-server/src/main/scala/csw/config/server/http/HttpCodecs.scala +++ b/csw-config/csw-config-server/src/main/scala/csw/config/server/http/HttpCodecs.scala @@ -24,13 +24,13 @@ trait HttpCodecs { implicit def unmarshaller[A: Decoder]: FromEntityUnmarshaller[A] = { Unmarshaller.byteStringUnmarshaller - .forContentTypes(unmarshallerContentTypes: _*) + .forContentTypes(unmarshallerContentTypes*) .map(Json.decode(_).to[A].value) } implicit def marshaller[A: Encoder]: ToEntityMarshaller[A] = { Marshaller - .oneOf(mediaTypes: _*)(Marshaller.byteStringMarshaller(_)) + .oneOf(mediaTypes*)(Marshaller.byteStringMarshaller(_)) .compose(Json.encode(_).to[ByteString].result) } diff --git a/csw-config/csw-config-server/src/test/scala/csw/config/server/MainTest.scala b/csw-config/csw-config-server/src/test/scala/csw/config/server/MainTest.scala index fe3d06149c..6ada440ee8 100644 --- a/csw-config/csw-config-server/src/test/scala/csw/config/server/MainTest.scala +++ b/csw-config/csw-config-server/src/test/scala/csw/config/server/MainTest.scala @@ -26,7 +26,7 @@ import scala.concurrent.duration.* // DEOPSCSW-130: Command line App for HTTP server class MainTest extends HTTPLocationService { - implicit val actorSystem: ActorSystem[_] = ActorSystem(Behaviors.empty, "config-server") + implicit val actorSystem: ActorSystem[?] = ActorSystem(Behaviors.empty, "config-server") private val locationService: LocationService = HttpLocationServiceFactory.makeLocalClient diff --git a/csw-contract/src/main/scala/csw/contract/data/command/CommandContract.scala b/csw-contract/src/main/scala/csw/contract/data/command/CommandContract.scala index fef6d330b6..3a788dc602 100644 --- a/csw-contract/src/main/scala/csw/contract/data/command/CommandContract.scala +++ b/csw-contract/src/main/scala/csw/contract/data/command/CommandContract.scala @@ -24,7 +24,7 @@ object CommandContract extends CommandData with CommandServiceCodecs { ModelType(observe, observeWithoutObsId, setup, setupWithoutObsId), ModelType(commandName), ModelType(OperationalState), - ModelType[Parameter[_]](paramSet.toList), + ModelType[Parameter[?]](paramSet.toList), ModelType(KeyType), ModelType(Units), ModelType(UnitsMap.value), diff --git a/csw-contract/src/main/scala/csw/contract/data/command/CommandData.scala b/csw-contract/src/main/scala/csw/contract/data/command/CommandData.scala index 21efdf68ea..34aa3f14a8 100644 --- a/csw-contract/src/main/scala/csw/contract/data/command/CommandData.scala +++ b/csw-contract/src/main/scala/csw/contract/data/command/CommandData.scala @@ -24,7 +24,7 @@ trait CommandData { val values = 100 - val paramSet: Set[Parameter[_]] = ParamSetData.paramSet + val paramSet: Set[Parameter[?]] = ParamSetData.paramSet val prefix = new Prefix(Subsystem.CSW, "ncc.trombone") val id: Id = Id() diff --git a/csw-contract/src/main/scala/csw/contract/data/command/ParamSetData.scala b/csw-contract/src/main/scala/csw/contract/data/command/ParamSetData.scala index ce07928bd0..f35e13b000 100644 --- a/csw-contract/src/main/scala/csw/contract/data/command/ParamSetData.scala +++ b/csw-contract/src/main/scala/csw/contract/data/command/ParamSetData.scala @@ -67,7 +67,7 @@ object ParamSetData { private val altAzCoord = AltAzCoord(Tag("BASE"), 301.degree, 42.5.degree) private val p27 = CoordKey.make("CoordKey").set(eqCoord, solarSystemCoord, minorPlanetCoord, cometCoord, altAzCoord) - val paramSet: Set[Parameter[_]] = + val paramSet: Set[Parameter[?]] = Set( p1, p2, diff --git a/csw-contract/src/main/scala/csw/contract/generator/ContractCodecs.scala b/csw-contract/src/main/scala/csw/contract/generator/ContractCodecs.scala index 9a13cfed71..419f3a2674 100644 --- a/csw-contract/src/main/scala/csw/contract/generator/ContractCodecs.scala +++ b/csw-contract/src/main/scala/csw/contract/generator/ContractCodecs.scala @@ -11,9 +11,9 @@ import io.bullet.borer.derivation.CompactMapBasedCodecs.deriveEncoder object ContractCodecs extends ContractCodecs trait ContractCodecs { implicit lazy val endpointEncoder: Encoder[Endpoint] = deriveEncoder - implicit lazy val modelTypeEncoder: Encoder[ModelType[_]] = Encoder((w, v) => v.write(w)) + implicit lazy val modelTypeEncoder: Encoder[ModelType[?]] = Encoder((w, v) => v.write(w)) - implicit lazy val modelSetEncoder: Encoder[ModelSet] = Encoder[Map[String, ModelType[_]]] + implicit lazy val modelSetEncoder: Encoder[ModelSet] = Encoder[Map[String, ModelType[?]]] .contramap(_.modelTypes.map(x => x.name -> x).toMap) implicit lazy val readmeEncoder: Encoder[Readme] = deriveEncoder diff --git a/csw-contract/src/main/scala/csw/contract/generator/RoundTrip.scala b/csw-contract/src/main/scala/csw/contract/generator/RoundTrip.scala index 0ac8a78c82..b34da1b6bc 100644 --- a/csw-contract/src/main/scala/csw/contract/generator/RoundTrip.scala +++ b/csw-contract/src/main/scala/csw/contract/generator/RoundTrip.scala @@ -8,8 +8,8 @@ package csw.contract.generator import io.bullet.borer.{Codec, Decoder, Encoder, Target} object RoundTrip { - def roundTrip(modelData: Any, codec: Codec[_], format: Target): Any = { - val bytes = format.encode(modelData)(codec.encoder.asInstanceOf[Encoder[Any]]).toByteArray - format.decode(bytes).to[Any](codec.decoder.asInstanceOf[Decoder[Any]]).value + def roundTrip(modelData: Any, codec: Codec[?], format: Target): Any = { + val bytes = format.encode(modelData)(using codec.encoder.asInstanceOf[Encoder[Any]]).toByteArray + format.decode(bytes).to[Any](using codec.decoder.asInstanceOf[Decoder[Any]]).value } } diff --git a/csw-contract/src/main/scala/csw/contract/generator/models.scala b/csw-contract/src/main/scala/csw/contract/generator/models.scala index c62bca82ca..c7dec70c3e 100644 --- a/csw-contract/src/main/scala/csw/contract/generator/models.scala +++ b/csw-contract/src/main/scala/csw/contract/generator/models.scala @@ -23,21 +23,21 @@ object ModelType extends CommonCodecs { def apply[T <: EnumEntry: Enum: ClassTag](`enum`: Enum[T]): ModelType[T] = new ModelType(`enum`.values.toList) } -class ModelSet private (val modelTypes: List[ModelType[_]]) +class ModelSet private (val modelTypes: List[ModelType[?]]) object ModelSet { - def models(modelTypes: ModelType[_]*): ModelSet = new ModelSet(modelTypes.toList) + def models(modelTypes: ModelType[?]*): ModelSet = new ModelSet(modelTypes.toList) } class RequestSet[T: Encoder: Decoder] { - private var requests: List[ModelType[_]] = Nil + private var requests: List[ModelType[?]] = Nil protected def requestType[R <: T: ClassTag](models: R*): Unit = { implicit val codec: Codec[R] = Codec.of[T].asInstanceOf[Codec[R]] requests ::= ModelType(models.toList) } - def modelSet: ModelSet = ModelSet.models(requests.reverse: _*) + def modelSet: ModelSet = ModelSet.models(requests.reverse*) } case class Endpoint(requestType: String, responseType: String, errorTypes: List[String] = Nil, description: Option[String] = None) @@ -45,7 +45,7 @@ case class Endpoint(requestType: String, responseType: String, errorTypes: List[ abstract case class Contract private (endpoints: List[Endpoint], requests: ModelSet) object Contract { - def apply(endpoints: List[Endpoint], requestSet: RequestSet[_]): Contract = new Contract(endpoints, requestSet.modelSet) {} + def apply(endpoints: List[Endpoint], requestSet: RequestSet[?]): Contract = new Contract(endpoints, requestSet.modelSet) {} def empty: Contract = new Contract(Nil, ModelSet.models()) {} } diff --git a/csw-contract/src/test/scala/csw/contract/data/RoundTripTest.scala b/csw-contract/src/test/scala/csw/contract/data/RoundTripTest.scala index 631543c5cd..7ad9ea3a78 100644 --- a/csw-contract/src/test/scala/csw/contract/data/RoundTripTest.scala +++ b/csw-contract/src/test/scala/csw/contract/data/RoundTripTest.scala @@ -36,7 +36,7 @@ class RoundTripTest extends AnyFreeSpec with Matchers { } } - private def validate(modelType: ModelType[_]): Unit = { + private def validate(modelType: ModelType[?]): Unit = { modelType.models.zipWithIndex.foreach { case (modelData, index) => s"${modelData.getClass.getSimpleName.stripSuffix("$")}: $index" - { List(Json, Cbor).foreach { format => diff --git a/csw-database/src/main/scala/csw/database/DatabaseServiceFactory.scala b/csw-database/src/main/scala/csw/database/DatabaseServiceFactory.scala index 3e20022ef8..c42b87f426 100644 --- a/csw-database/src/main/scala/csw/database/DatabaseServiceFactory.scala +++ b/csw-database/src/main/scala/csw/database/DatabaseServiceFactory.scala @@ -39,7 +39,7 @@ private[csw] object DatabaseServiceFactory { * 2) schedule the task of database connection * @param values used for testing purposes, to manually set the values for credentials instead of reading from env vars */ -class DatabaseServiceFactory private[csw] (actorSystem: ActorSystem[_], values: Map[String, String]) { +class DatabaseServiceFactory private[csw] (actorSystem: ActorSystem[?], values: Map[String, String]) { /** * Creates the DatabaseServiceFactory. It is not injected in `CswContext` like other csw services. @@ -50,7 +50,7 @@ class DatabaseServiceFactory private[csw] (actorSystem: ActorSystem[_], values: * 2) schedule the task of database connection * @return DatabaseServiceFactory */ - def this(actorSystem: ActorSystem[_]) = this(actorSystem, Map.empty) + def this(actorSystem: ActorSystem[?]) = this(actorSystem, Map.empty) private val log: Logger = DatabaseLogger.getLogger private val config: Config = actorSystem.settings.config diff --git a/csw-database/src/test/scala/csw/database/DatabaseServiceFactoryFailureTest.scala b/csw-database/src/test/scala/csw/database/DatabaseServiceFactoryFailureTest.scala index d6501b6914..b04196f76b 100644 --- a/csw-database/src/test/scala/csw/database/DatabaseServiceFactoryFailureTest.scala +++ b/csw-database/src/test/scala/csw/database/DatabaseServiceFactoryFailureTest.scala @@ -20,8 +20,8 @@ import org.scalatest.matchers.should.Matchers //DEOPSCSW-615: DB service accessible to CSW component developers class DatabaseServiceFactoryFailureTest extends AnyFunSuite with Matchers with BeforeAndAfterAll { private val system: ActorSystem[SpawnProtocol.Command] = ActorSystem(SpawnProtocol(), "test") - private var postgres: EmbeddedPostgres = _ - private var dbFactory: DatabaseServiceFactory = _ + private var postgres: EmbeddedPostgres = scala.compiletime.uninitialized + private var dbFactory: DatabaseServiceFactory = scala.compiletime.uninitialized override def beforeAll(): Unit = { postgres = DBTestHelper.postgres(0) diff --git a/csw-database/src/test/scala/csw/database/DatabaseServiceFactoryTest.scala b/csw-database/src/test/scala/csw/database/DatabaseServiceFactoryTest.scala index fd84936d41..753849ffc9 100644 --- a/csw-database/src/test/scala/csw/database/DatabaseServiceFactoryTest.scala +++ b/csw-database/src/test/scala/csw/database/DatabaseServiceFactoryTest.scala @@ -33,9 +33,9 @@ class DatabaseServiceFactoryTest extends AnyFunSuite with Matchers with BeforeAn private val dbName: String = "postgres" private val port: Int = 5432 private val locationService: LocationService = HttpLocationServiceFactory.makeLocalClient - private var postgres: EmbeddedPostgres = _ - private var dbFactory: DatabaseServiceFactory = _ - private var testDsl: DSLContext = _ + private var postgres: EmbeddedPostgres = scala.compiletime.uninitialized + private var dbFactory: DatabaseServiceFactory = scala.compiletime.uninitialized + private var testDsl: DSLContext = scala.compiletime.uninitialized override implicit val patienceConfig: PatienceConfig = PatienceConfig(5.seconds) diff --git a/csw-database/src/test/scala/csw/database/DatabaseServiceTest.scala b/csw-database/src/test/scala/csw/database/DatabaseServiceTest.scala index 1074183694..815b754778 100644 --- a/csw-database/src/test/scala/csw/database/DatabaseServiceTest.scala +++ b/csw-database/src/test/scala/csw/database/DatabaseServiceTest.scala @@ -24,8 +24,8 @@ import org.scalatest.matchers.should.Matchers class DatabaseServiceTest extends AnyFunSuite with Matchers with ScalaFutures with BeforeAndAfterAll { private val system: ActorSystem[SpawnProtocol.Command] = ActorSystem(SpawnProtocol(), "test") private implicit val ec: ExecutionContext = system.executionContext - private var postgres: EmbeddedPostgres = _ - private var dsl: DSLContext = _ + private var postgres: EmbeddedPostgres = scala.compiletime.uninitialized + private var dsl: DSLContext = scala.compiletime.uninitialized override implicit val patienceConfig: PatienceConfig = PatienceConfig(5.seconds) diff --git a/csw-event/csw-event-api/src/main/scala/csw/event/api/javadsl/IEventSubscriber.scala b/csw-event/csw-event-api/src/main/scala/csw/event/api/javadsl/IEventSubscriber.scala index 3c225b7e02..98c742e950 100644 --- a/csw-event/csw-event-api/src/main/scala/csw/event/api/javadsl/IEventSubscriber.scala +++ b/csw-event/csw-event-api/src/main/scala/csw/event/api/javadsl/IEventSubscriber.scala @@ -70,7 +70,7 @@ trait IEventSubscriber { * @param callback a function to execute asynchronously on each received event * @return an [[csw.event.api.javadsl.IEventSubscription]] which can be used to unsubscribe from all the Event Keys which were subscribed to */ - def subscribeAsync(eventKeys: util.Set[EventKey], callback: Event => CompletableFuture[_]): IEventSubscription + def subscribeAsync(eventKeys: util.Set[EventKey], callback: Event => CompletableFuture[?]): IEventSubscription /** * Overload for above `subscribeAsync` for receiving event at a `every` frequency according to the specified `mode`. The latest @@ -89,7 +89,7 @@ trait IEventSubscriber { */ def subscribeAsync( eventKeys: util.Set[EventKey], - callback: Event => CompletableFuture[_], + callback: Event => CompletableFuture[?], every: Duration, mode: SubscriptionMode ): IEventSubscription diff --git a/csw-event/csw-event-api/src/main/scala/csw/event/api/scaladsl/EventSubscriber.scala b/csw-event/csw-event-api/src/main/scala/csw/event/api/scaladsl/EventSubscriber.scala index 6ab584426e..a4970581b9 100644 --- a/csw-event/csw-event-api/src/main/scala/csw/event/api/scaladsl/EventSubscriber.scala +++ b/csw-event/csw-event-api/src/main/scala/csw/event/api/scaladsl/EventSubscriber.scala @@ -72,7 +72,7 @@ trait EventSubscriber { * @param callback a function to execute asynchronously on each received event * @return an [[csw.event.api.scaladsl.EventSubscription]] which can be used to unsubscribe from all the Event Keys which were subscribed to */ - def subscribeAsync(eventKeys: Set[EventKey], callback: Event => Future[_]): EventSubscription + def subscribeAsync(eventKeys: Set[EventKey], callback: Event => Future[?]): EventSubscription /** * Overload for above `subscribeAsync` for receiving event at a `every` frequency according to the specified `mode`. The latest events available for the given @@ -91,7 +91,7 @@ trait EventSubscriber { */ def subscribeAsync( eventKeys: Set[EventKey], - callback: Event => Future[_], + callback: Event => Future[?], every: FiniteDuration, mode: SubscriptionMode ): EventSubscription diff --git a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/CliApp.scala b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/CliApp.scala index b4de58e278..5f138f2059 100644 --- a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/CliApp.scala +++ b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/CliApp.scala @@ -11,7 +11,7 @@ import csw.event.cli.args.Options import scala.concurrent.duration.Duration import scala.concurrent.{Await, Future} -class CliApp(commandLineRunner: CommandLineRunner)(implicit val system: ActorSystem[_]) { +class CliApp(commandLineRunner: CommandLineRunner)(implicit val system: ActorSystem[?]) { def start(options: Options): Any = { options.cmd match { diff --git a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/CommandLineRunner.scala b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/CommandLineRunner.scala index c7e32fc62d..8897edfb88 100644 --- a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/CommandLineRunner.scala +++ b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/CommandLineRunner.scala @@ -116,7 +116,7 @@ class CommandLineRunner(eventService: EventService, actorRuntime: ActorRuntime, } } - private def updateEventParams(event: Event, paramSet: Set[Parameter[_]]) = + private def updateEventParams(event: Event, paramSet: Set[Parameter[?]]) = event match { case event: SystemEvent => event.madd(paramSet) case event: ObserveEvent => event.madd(paramSet) diff --git a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/args/Options.scala b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/args/Options.scala index 774715e37b..4203c13ed6 100644 --- a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/args/Options.scala +++ b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/args/Options.scala @@ -19,7 +19,7 @@ case class Options( eventKeys: Seq[EventKey] = Seq.empty, eventsMap: Map[EventKey, Set[String]] = Map.empty, eventData: Option[File] = None, - params: Set[Parameter[_]] = Set.empty, + params: Set[Parameter[?]] = Set.empty, out: String = "oneline", printTimestamp: Boolean = false, printId: Boolean = false, diff --git a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/args/ParameterArgParser.scala b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/args/ParameterArgParser.scala index ee33ee7a01..ccbdf05826 100644 --- a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/args/ParameterArgParser.scala +++ b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/args/ParameterArgParser.scala @@ -12,10 +12,10 @@ import csw.params.core.generics.Parameter object ParameterArgParser { - def parse(cmdLineParamsArg: String): Set[Parameter[_]] = + def parse(cmdLineParamsArg: String): Set[Parameter[?]] = extractParams(cmdLineParamsArg) .map(keyValue) - .map((createParam _).tupled) + .map((createParam).tupled) .toSet private def extractParams(paramsStr: String) = paramsStr.split(PARAMS_SEP) @@ -38,7 +38,7 @@ object ParameterArgParser { } } - private def createParam(keyArg: KeyArg, values: Array[String]): Parameter[_] = { + private def createParam(keyArg: KeyArg, values: Array[String]): Parameter[?] = { import keyArg._ keyType match { case 'i' => IntKey.make(keyName, units).setAll(values.map(_.toInt)) diff --git a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/utils/EventOnelineTransformer.scala b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/utils/EventOnelineTransformer.scala index 7015a98b5b..11f9b6ea93 100644 --- a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/utils/EventOnelineTransformer.scala +++ b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/utils/EventOnelineTransformer.scala @@ -26,7 +26,7 @@ class EventOnelineTransformer(options: Options) { else List(onelines) } - private def traverse(params: Set[Parameter[_]], paths: List[String]): List[Oneline] = + private def traverse(params: Set[Parameter[?]], paths: List[String]): List[Oneline] = params.toList.flatMap { param => val currentPath = param.keyName diff --git a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/utils/Formatter.scala b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/utils/Formatter.scala index 8a3b9da616..ce06b482a5 100644 --- a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/utils/Formatter.scala +++ b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/utils/Formatter.scala @@ -45,7 +45,7 @@ case class OnelineFormatter(options: Options) { } } -case class Oneline(path: String, param: Parameter[_]) { +case class Oneline(path: String, param: Parameter[?]) { private val onelineSeparator = " = " private def values = { diff --git a/csw-event/csw-event-cli/src/test/scala/csw/event/cli/CommandLineRunnerTest.scala b/csw-event/csw-event-cli/src/test/scala/csw/event/cli/CommandLineRunnerTest.scala index 521a77b04f..a01c21f11b 100644 --- a/csw-event/csw-event-cli/src/test/scala/csw/event/cli/CommandLineRunnerTest.scala +++ b/csw-event/csw-event-cli/src/test/scala/csw/event/cli/CommandLineRunnerTest.scala @@ -71,7 +71,7 @@ class CommandLineRunnerTest extends SeedData with Eventually with CommonCodecs { commandLineRunner .get(argsParser.parse(Seq("get", "--id", "-u", "-t", "-e", s"${event1.eventKey},${event2.eventKey}")).get) .await - logBuffer shouldEqualContentsOf "oneline/get_multiple_events.txt" + logBuffer `shouldEqualContentsOf` "oneline/get_multiple_events.txt" } // DEOPSCSW-431: [Event Cli] Get command @@ -81,7 +81,7 @@ class CommandLineRunnerTest extends SeedData with Eventually with CommonCodecs { commandLineRunner .get(argsParser.parse(Seq("get", "-e", s"${event1.eventKey},${event2.eventKey}", "--out", "terse")).get) .await - logBuffer shouldEqualContentsOf "terse/get_multiple_events.txt" + logBuffer `shouldEqualContentsOf` "terse/get_multiple_events.txt" } // DEOPSCSW-432: [Event Cli] Publish command @@ -219,7 +219,7 @@ class CommandLineRunnerTest extends SeedData with Eventually with CommonCodecs { cancellable.cancel() subscriptionF.unsubscribe() - logBuffer shouldEqualContentsOf "oneline/entire_events.txt" + logBuffer `shouldEqualContentsOf` "oneline/entire_events.txt" } // DEOPSCSW-433: [Event Cli] Subscribe command @@ -242,7 +242,7 @@ class CommandLineRunnerTest extends SeedData with Eventually with CommonCodecs { cancellable.cancel() subscriptionF.unsubscribe() - logBuffer shouldEqualContentsOf "terse/entire_events.txt" + logBuffer `shouldEqualContentsOf` "terse/entire_events.txt" } // publish command generates new id and event time while publishing, hence assertions exclude these keys from json diff --git a/csw-event/csw-event-cli/src/test/scala/csw/event/cli/SeedData.scala b/csw-event/csw-event-cli/src/test/scala/csw/event/cli/SeedData.scala index b4ac3a0a64..b5a8c6a39a 100644 --- a/csw-event/csw-event-cli/src/test/scala/csw/event/cli/SeedData.scala +++ b/csw-event/csw-event-cli/src/test/scala/csw/event/cli/SeedData.scala @@ -33,10 +33,10 @@ trait SeedData extends HTTPLocationService with Matchers with BeforeAndAfterEach val argsParser = new ArgsParser("csw-event-cli") val logBuffer: mutable.Buffer[String] = mutable.Buffer.empty[String] - var redisSentinel: RedisSentinel = _ - var redisServer: RedisServer = _ - var event1: SystemEvent = _ - var event2: ObserveEvent = _ + var redisSentinel: RedisSentinel = scala.compiletime.uninitialized + var redisServer: RedisServer = scala.compiletime.uninitialized + var event1: SystemEvent = scala.compiletime.uninitialized + var event2: ObserveEvent = scala.compiletime.uninitialized private def printLine(msg: Any): Unit = logBuffer += msg.toString diff --git a/csw-event/csw-event-cli/src/test/scala/csw/event/cli/utils/EventOnelineTransformerTest.scala b/csw-event/csw-event-cli/src/test/scala/csw/event/cli/utils/EventOnelineTransformerTest.scala index 453a3433ae..b6805dfd46 100644 --- a/csw-event/csw-event-cli/src/test/scala/csw/event/cli/utils/EventOnelineTransformerTest.scala +++ b/csw-event/csw-event-cli/src/test/scala/csw/event/cli/utils/EventOnelineTransformerTest.scala @@ -27,7 +27,7 @@ class EventOnelineTransformerTest extends AnyFunSuite with Matchers { val options = Options(cmd = "inspect", eventsMap = Map(event1.eventKey -> Set.empty)) val onelineOutput = new EventOnelineTransformer(options).transform(List(event1)) - onelineOutput shouldEqualContentsOf "oneline/inspect_entire_event.txt" + onelineOutput `shouldEqualContentsOf` "oneline/inspect_entire_event.txt" } test("should be able to get entire event in oneline format") { @@ -35,7 +35,7 @@ class EventOnelineTransformerTest extends AnyFunSuite with Matchers { val options = Options(cmd = "get", eventsMap = Map(event1.eventKey -> Set.empty)) val onelineOutput = new EventOnelineTransformer(options).transform(List(event1)) - onelineOutput shouldEqualContentsOf "oneline/get_entire_event.txt" + onelineOutput `shouldEqualContentsOf` "oneline/get_entire_event.txt" } test("should be able to get specified paths for event in oneline format") { @@ -43,7 +43,7 @@ class EventOnelineTransformerTest extends AnyFunSuite with Matchers { val options = Options(cmd = "get", eventsMap = Map(event1.eventKey -> Set("epoch", "dec"))) val onelineOutput = new EventOnelineTransformer(options).transform(List(event1)) - onelineOutput shouldEqualContentsOf "oneline/full_paths.txt" + onelineOutput `shouldEqualContentsOf` "oneline/full_paths.txt" } test("should be able to get paths for multiple events in oneline format") { @@ -52,7 +52,7 @@ class EventOnelineTransformerTest extends AnyFunSuite with Matchers { Options(cmd = "get", eventsMap = Map(event1.eventKey -> Set("epoch"), event2.eventKey -> Set("ra"))) val onelineOutput = new EventOnelineTransformer(options).transform(List(event1, event2)) - onelineOutput shouldEqualContentsOf "oneline/get_multiple_paths.txt" + onelineOutput `shouldEqualContentsOf` "oneline/get_multiple_paths.txt" } test("should be able to log timestamp in oneline format") { @@ -60,7 +60,7 @@ class EventOnelineTransformerTest extends AnyFunSuite with Matchers { val options = Options(cmd = "get", eventsMap = Map(event1.eventKey -> Set("epoch")), printTimestamp = true) val onelineOutput = new EventOnelineTransformer(options).transform(List(event1)) - onelineOutput shouldEqualContentsOf "oneline/get_with_timestamp.txt" + onelineOutput `shouldEqualContentsOf` "oneline/get_with_timestamp.txt" } test("should be able to log id per event in oneline format") { @@ -69,7 +69,7 @@ class EventOnelineTransformerTest extends AnyFunSuite with Matchers { val onelineOutput = new EventOnelineTransformer(options).transform(List(event1)) - onelineOutput shouldEqualContentsOf "oneline/get_with_id.txt" + onelineOutput `shouldEqualContentsOf` "oneline/get_with_id.txt" } test("should be able to log units per event in oneline format") { @@ -77,6 +77,6 @@ class EventOnelineTransformerTest extends AnyFunSuite with Matchers { val options = Options(cmd = "get", eventsMap = Map(event1.eventKey -> Set("epoch")), printUnits = true) val onelineOutput = new EventOnelineTransformer(options).transform(List(event1)) - onelineOutput shouldEqualContentsOf "oneline/get_with_units.txt" + onelineOutput `shouldEqualContentsOf` "oneline/get_with_units.txt" } } diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/EventServiceFactory.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/EventServiceFactory.scala index fca684cc25..292a70e7b5 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/EventServiceFactory.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/EventServiceFactory.scala @@ -38,7 +38,7 @@ class EventServiceFactory(store: EventStore = RedisStore()) { * @param system an actor system required for underlying event streams * @return [[csw.event.api.scaladsl.EventService]] which provides handles to [[csw.event.api.scaladsl.EventPublisher]] and [[csw.event.api.scaladsl.EventSubscriber]] */ - def make(locationService: LocationService)(implicit system: ActorSystem[_]): EventService = + def make(locationService: LocationService)(implicit system: ActorSystem[?]): EventService = eventService(new EventServiceLocationResolver(locationService)(system.executionContext)) /** @@ -49,7 +49,7 @@ class EventServiceFactory(store: EventStore = RedisStore()) { * @param system an actor system required for underlying event streams * @return [[csw.event.api.scaladsl.EventService]] which provides handles to [[csw.event.api.scaladsl.EventPublisher]] and [[csw.event.api.scaladsl.EventSubscriber]] */ - def make(host: String, port: Int)(implicit system: ActorSystem[_]): EventService = + def make(host: String, port: Int)(implicit system: ActorSystem[?]): EventService = eventService(new EventServiceHostPortResolver(host, port)) /** @@ -59,7 +59,7 @@ class EventServiceFactory(store: EventStore = RedisStore()) { * @param actorSystem an actor system required for underlying event streams * @return [[csw.event.api.javadsl.IEventService]] which provides handles to [[csw.event.api.javadsl.IEventPublisher]] and [[csw.event.api.javadsl.IEventSubscriber]] */ - def jMake(locationService: ILocationService, actorSystem: ActorSystem[_]): IEventService = { + def jMake(locationService: ILocationService, actorSystem: ActorSystem[?]): IEventService = { val eventService = make(locationService.asScala)(actorSystem) new JEventService(eventService) } @@ -72,12 +72,12 @@ class EventServiceFactory(store: EventStore = RedisStore()) { * @param system an actor system required for underlying event streams * @return [[csw.event.api.javadsl.IEventService]] which provides handles to [[csw.event.api.javadsl.IEventPublisher]] and [[csw.event.api.javadsl.IEventSubscriber]] */ - def jMake(host: String, port: Int, system: ActorSystem[_]): IEventService = { + def jMake(host: String, port: Int, system: ActorSystem[?]): IEventService = { val eventService = make(host, port)(system) new JEventService(eventService) } - private def eventService(eventServiceResolver: EventServiceResolver)(implicit system: ActorSystem[_]) = { + private def eventService(eventServiceResolver: EventServiceResolver)(implicit system: ActorSystem[?]) = { def masterId = system.settings.config.getString("csw-event.redis.masterId") store match { case RedisStore(client) => new RedisEventService(eventServiceResolver, masterId, client) diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/EventPublisherUtil.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/EventPublisherUtil.scala index e4c3e8f5a4..4d0477fa1f 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/EventPublisherUtil.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/EventPublisherUtil.scala @@ -20,7 +20,7 @@ import scala.util.control.NonFatal /** * Utility class to provided common functionalities to different implementations of EventPublisher */ -private[event] class EventPublisherUtil(implicit actorSystem: ActorSystem[_]) { +private[event] class EventPublisherUtil(implicit actorSystem: ActorSystem[?]) { private val logger = EventServiceLogger.getLogger diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/EventSubscriberUtil.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/EventSubscriberUtil.scala index e2f9749bda..b677533a43 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/EventSubscriberUtil.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/EventSubscriberUtil.scala @@ -21,7 +21,7 @@ import scala.concurrent.duration.FiniteDuration /** * Utility class to provided common functionalities to different implementations of EventSubscriber */ -class EventSubscriberUtil(implicit actorSystem: ActorSystem[_]) { +class EventSubscriberUtil(implicit actorSystem: ActorSystem[?]) { def subscriptionModeStage( every: FiniteDuration, @@ -32,7 +32,7 @@ class EventSubscriberUtil(implicit actorSystem: ActorSystem[_]) { case RateLimiterMode => new RateLimiterStage[Event](every) } - def subscribeAsync(eventSource: Source[Event, EventSubscription], callback: Event => Future[_]): EventSubscription = + def subscribeAsync(eventSource: Source[Event, EventSubscription], callback: Event => Future[?]): EventSubscription = eventSource.mapAsync(1)(x => callback(x)).withAttributes(attributes).to(Sink.ignore).run() def subscribeCallback(eventSource: Source[Event, EventSubscription], callback: Event => Unit): EventSubscription = diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/javawrappers/JEventSubscriber.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/javawrappers/JEventSubscriber.scala index 019b7b7ebc..408c4f4b95 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/javawrappers/JEventSubscriber.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/commons/javawrappers/JEventSubscriber.scala @@ -46,12 +46,12 @@ class JEventSubscriber(eventSubscriber: EventSubscriber) extends IEventSubscribe .mapMaterializedValue(_.asJava) .asJava - def subscribeAsync(eventKeys: util.Set[EventKey], callback: Event => CompletableFuture[_]): IEventSubscription = + def subscribeAsync(eventKeys: util.Set[EventKey], callback: Event => CompletableFuture[?]): IEventSubscription = eventSubscriber.subscribeAsync(eventKeys.asScala.toSet, e => callback(e).asScala).asJava def subscribeAsync( eventKeys: util.Set[EventKey], - callback: Event => CompletableFuture[_], + callback: Event => CompletableFuture[?], every: Duration, mode: SubscriptionMode ): IEventSubscription = diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaEventService.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaEventService.scala index f92bb0ab84..a4024ab51f 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaEventService.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaEventService.scala @@ -24,7 +24,7 @@ import scala.concurrent.Future */ // $COVERAGE-OFF$ private[event] class KafkaEventService(eventServiceResolver: EventServiceResolver)(implicit - actorSystem: ActorSystem[_] + actorSystem: ActorSystem[?] ) extends EventService { import actorSystem.executionContext diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaPublisher.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaPublisher.scala index 6fbec89fd8..06de92e6df 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaPublisher.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaPublisher.scala @@ -29,7 +29,7 @@ import scala.util.control.NonFatal */ // $COVERAGE-OFF$ private[event] class KafkaPublisher(producerSettings: Future[ProducerSettings[String, Array[Byte]]])(implicit - actorSystem: ActorSystem[_] + actorSystem: ActorSystem[?] ) extends EventPublisher { import actorSystem.executionContext diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaSubscriber.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaSubscriber.scala index 86551c5060..bf23cd5db8 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaSubscriber.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/kafka/KafkaSubscriber.scala @@ -33,7 +33,7 @@ import scala.util.control.NonFatal */ // $COVERAGE-OFF$ private[event] class KafkaSubscriber(consumerSettings: Future[ConsumerSettings[String, Array[Byte]]])(implicit - actorSystem: ActorSystem[_] + actorSystem: ActorSystem[?] ) extends EventSubscriber { import actorSystem.executionContext @@ -72,12 +72,12 @@ private[event] class KafkaSubscriber(consumerSettings: Future[ConsumerSettings[S ): Source[Event, EventSubscription] = subscribe(eventKeys).via(eventSubscriberUtil.subscriptionModeStage(every, mode)) - override def subscribeAsync(eventKeys: Set[EventKey], callback: Event => Future[_]): EventSubscription = + override def subscribeAsync(eventKeys: Set[EventKey], callback: Event => Future[?]): EventSubscription = eventSubscriberUtil.subscribeAsync(subscribe(eventKeys), callback) override def subscribeAsync( eventKeys: Set[EventKey], - callback: Event => Future[_], + callback: Event => Future[?], every: FiniteDuration, mode: SubscriptionMode ): EventSubscription = diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisEventService.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisEventService.scala index 9fb24abe3d..c67d6b8521 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisEventService.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisEventService.scala @@ -22,7 +22,7 @@ import scala.concurrent.Future * @param actorSystem provides Materializer, ExecutionContext, etc. */ private[event] class RedisEventService(eventServiceResolver: EventServiceResolver, masterId: String, redisClient: RedisClient)( - implicit val actorSystem: ActorSystem[_] + implicit val actorSystem: ActorSystem[?] ) extends EventService { import actorSystem.executionContext diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisPublisher.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisPublisher.scala index 244345fffc..8159633234 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisPublisher.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisPublisher.scala @@ -32,7 +32,7 @@ import scala.util.control.NonFatal * @param actorSystem provides Materializer, executionContext, etc */ private[event] class RedisPublisher(redisURI: Future[RedisURI], redisClient: RedisClient)(implicit - actorSystem: ActorSystem[_] + actorSystem: ActorSystem[?] ) extends EventPublisher { import actorSystem.executionContext diff --git a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisSubscriber.scala b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisSubscriber.scala index 274fd4a00a..25dde5629e 100644 --- a/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisSubscriber.scala +++ b/csw-event/csw-event-client/src/main/scala/csw/event/client/internal/redis/RedisSubscriber.scala @@ -34,7 +34,7 @@ import scala.concurrent.duration.FiniteDuration * @param actorSystem to be used for performing asynchronous operations */ private[event] class RedisSubscriber(redisURI: Future[RedisURI], redisClient: RedisClient)(implicit - actorSystem: ActorSystem[_] + actorSystem: ActorSystem[?] ) extends EventSubscriber { import EventRomaineCodecs._ @@ -67,12 +67,12 @@ private[event] class RedisSubscriber(redisURI: Future[RedisURI], redisClient: Re mode: SubscriptionMode ): Source[Event, EventSubscription] = subscribe(eventKeys).via(eventSubscriberUtil.subscriptionModeStage(every, mode)) - override def subscribeAsync(eventKeys: Set[EventKey], callback: Event => Future[_]): EventSubscription = + override def subscribeAsync(eventKeys: Set[EventKey], callback: Event => Future[?]): EventSubscription = eventSubscriberUtil.subscribeAsync(subscribe(eventKeys), callback) override def subscribeAsync( eventKeys: Set[EventKey], - callback: Event => Future[_], + callback: Event => Future[?], every: FiniteDuration, mode: SubscriptionMode ): EventSubscription = eventSubscriberUtil.subscribeAsync(subscribe(eventKeys, every, mode), callback) diff --git a/csw-event/csw-event-client/src/test/scala/csw/event/client/EventPublisherTest.scala b/csw-event/csw-event-client/src/test/scala/csw/event/client/EventPublisherTest.scala index 1d82fd6e3d..9c38417017 100644 --- a/csw-event/csw-event-client/src/test/scala/csw/event/client/EventPublisherTest.scala +++ b/csw-event/csw-event-client/src/test/scala/csw/event/client/EventPublisherTest.scala @@ -43,7 +43,7 @@ class EventPublisherTest extends TestNGSuite with Matchers with Eventually /*wit implicit val patience: PatienceConfig = PatienceConfig(5.seconds, 10.millis) - var redisTestProps: BaseProperties = _ + var redisTestProps: BaseProperties = scala.compiletime.uninitialized // var kafkaTestProps: BaseProperties = _ @BeforeSuite @@ -104,7 +104,7 @@ class EventPublisherTest extends TestNGSuite with Matchers with Eventually /*wit // DEOPSCSW-345: Publish events irrespective of subscriber existence // DEOPSCSW-516: Optionally Publish - API Change - var cancellable: Cancellable = _ + var cancellable: Cancellable = scala.compiletime.uninitialized @Test(dataProvider = "event-service-provider") def should_be_able_to_publish_an_event_with_duration__DEOPSCSW_331_DEOPSCSW_334_DEOPSCSW_335_DEOPSCSW_337_DEOPSCSW_349_DEOPSCSW_395_DEOPSCSW_515_DEOPSCSW_516_DEOPSCSW_345( baseProperties: BaseProperties @@ -328,7 +328,7 @@ class EventPublisherTest extends TestNGSuite with Matchers with Eventually /*wit val payloadKey: Key[Byte] = ByteKey.make("payloadKey") val payload: Array[Byte] = ("0" * 1024 * 2).getBytes("utf-8") - val paramSet: Set[Parameter[_]] = Set(payloadKey.setAll(payload)) + val paramSet: Set[Parameter[?]] = Set(payloadKey.setAll(payload)) val event1 = SystemEvent(Prefix("csw.abc"), EventName("system_1"), paramSet) val eventKey: EventKey = event1.eventKey diff --git a/csw-event/csw-event-client/src/test/scala/csw/event/client/EventSubscriberTest.scala b/csw-event/csw-event-client/src/test/scala/csw/event/client/EventSubscriberTest.scala index 79f8aa5106..b3518a8723 100644 --- a/csw-event/csw-event-client/src/test/scala/csw/event/client/EventSubscriberTest.scala +++ b/csw-event/csw-event-client/src/test/scala/csw/event/client/EventSubscriberTest.scala @@ -41,7 +41,7 @@ class EventSubscriberTest extends TestNGSuite with Matchers with Eventually { implicit val patience: PatienceConfig = PatienceConfig(5.seconds, 10.millis) - var redisTestProps: BaseProperties = _ + var redisTestProps: BaseProperties = scala.compiletime.uninitialized // var kafkaTestProps: BaseProperties = _ @BeforeSuite diff --git a/csw-event/csw-event-client/src/test/scala/csw/event/client/EventSubscriptionFrequencyTest.scala b/csw-event/csw-event-client/src/test/scala/csw/event/client/EventSubscriptionFrequencyTest.scala index fbe27bbb02..c2603caedf 100644 --- a/csw-event/csw-event-client/src/test/scala/csw/event/client/EventSubscriptionFrequencyTest.scala +++ b/csw-event/csw-event-client/src/test/scala/csw/event/client/EventSubscriptionFrequencyTest.scala @@ -29,7 +29,7 @@ import org.scalatest.matchers.should.Matchers class EventSubscriptionFrequencyTest extends TestNGSuite with Matchers with Eventually { implicit val patience: PatienceConfig = PatienceConfig(5.seconds, 10.millis) - var redisTestProps: BaseProperties = _ + var redisTestProps: BaseProperties = scala.compiletime.uninitialized // var kafkaTestProps: BaseProperties = _ @BeforeSuite diff --git a/csw-event/csw-event-client/src/test/scala/csw/event/client/internal/redis/RedisTestProps.scala b/csw-event/csw-event-client/src/test/scala/csw/event/client/internal/redis/RedisTestProps.scala index 854231b881..e542a26cbf 100644 --- a/csw-event/csw-event-client/src/test/scala/csw/event/client/internal/redis/RedisTestProps.scala +++ b/csw-event/csw-event-client/src/test/scala/csw/event/client/internal/redis/RedisTestProps.scala @@ -46,8 +46,8 @@ class RedisTestProps( private lazy val asyncConnection: Future[RedisAsyncCommands[String, String]] = redisClient.connectAsync(new StringCodec(), redisURI).asScala.map(_.async()) - var redisSentinel: RedisSentinel = _ - var redisServer: RedisServer = _ + var redisSentinel: RedisSentinel = scala.compiletime.uninitialized + var redisServer: RedisServer = scala.compiletime.uninitialized override val eventPattern: String = "*" diff --git a/csw-event/csw-event-client/src/test/scala/csw/event/client/perf/InitialPublishLatencyTest.scala b/csw-event/csw-event-client/src/test/scala/csw/event/client/perf/InitialPublishLatencyTest.scala index da66d65985..ce0fc7830f 100644 --- a/csw-event/csw-event-client/src/test/scala/csw/event/client/perf/InitialPublishLatencyTest.scala +++ b/csw-event/csw-event-client/src/test/scala/csw/event/client/perf/InitialPublishLatencyTest.scala @@ -18,7 +18,7 @@ import org.scalatest.funsuite.AnyFunSuite class InitialPublishLatencyTest extends AnyFunSuite with BeforeAndAfterAll { private implicit val system: ActorSystem = ActorSystem() - private implicit val typedSystem: typed.ActorSystem[_] = system.toTyped + private implicit val typedSystem: typed.ActorSystem[?] = system.toTyped private val ls: LocationService = HttpLocationServiceFactory.makeLocalClient private val eventServiceFactory = new EventServiceFactory().make(ls) import eventServiceFactory._ diff --git a/csw-framework/src/main/scala/csw/framework/deploy/containercmd/ContainerCmd.scala b/csw-framework/src/main/scala/csw/framework/deploy/containercmd/ContainerCmd.scala index 563c267a9b..a1848e4660 100644 --- a/csw-framework/src/main/scala/csw/framework/deploy/containercmd/ContainerCmd.scala +++ b/csw-framework/src/main/scala/csw/framework/deploy/containercmd/ContainerCmd.scala @@ -35,7 +35,7 @@ object ContainerCmd { * alone without any container * @return Actor ref of the container or supervisor of the component started without container */ - def start(name: String, subsystem: Subsystem, args: Array[String], defaultConfig: Option[Config] = None): ActorRef[_] = + def start(name: String, subsystem: Subsystem, args: Array[String], defaultConfig: Option[Config] = None): ActorRef[?] = new ContainerCmd(name, subsystem, true, defaultConfig).start(args) } @@ -50,7 +50,7 @@ private[framework] class ContainerCmd( final private lazy val wiring: FrameworkWiring = new FrameworkWiring import wiring.actorRuntime.* - def start(args: Array[String]): ActorRef[_] = + def start(args: Array[String]): ActorRef[?] = new ArgsParser(name).parse(args.toList) match { case None => throw UnableToParseOptions case Some(Options(isLocal, inputFilePath)) => @@ -78,7 +78,7 @@ private[framework] class ContainerCmd( isLocal: Boolean, inputFilePath: Option[Path], defaultConfig: Option[Config] - ): Future[ActorRef[_]] = + ): Future[ActorRef[?]] = async { val config = await(wiring.configUtils.getConfig(isLocal, inputFilePath, defaultConfig)) val isContainerConf = config.hasPath("components") @@ -87,7 +87,7 @@ private[framework] class ContainerCmd( actorRef } - private def createComponent(isContainerConf: Boolean, wiring: FrameworkWiring, config: Config): Future[ActorRef[_]] = + private def createComponent(isContainerConf: Boolean, wiring: FrameworkWiring, config: Config): Future[ActorRef[?]] = if (isContainerConf) Container.spawn(config, wiring) else Standalone.spawn(config, wiring) diff --git a/csw-framework/src/main/scala/csw/framework/deploy/hostconfig/HostConfig.scala b/csw-framework/src/main/scala/csw/framework/deploy/hostconfig/HostConfig.scala index b1898caebb..d32ce17b68 100644 --- a/csw-framework/src/main/scala/csw/framework/deploy/hostconfig/HostConfig.scala +++ b/csw-framework/src/main/scala/csw/framework/deploy/hostconfig/HostConfig.scala @@ -87,7 +87,7 @@ private[hostconfig] class HostConfig(name: String, subsystem: Subsystem, startLo def executeScript(containerScript: String, args: String*): Process = { val cmd = containerScript +: args log.info(s"Executing command : ${cmd.mkString(" ")}") - new ProcessBuilder(cmd: _*).start() + new ProcessBuilder(cmd*).start() } private def shutdown(): Done = Await.result(wiring.actorRuntime.shutdown(), timeout) diff --git a/csw-framework/src/main/scala/csw/framework/internal/supervisor/CommandServiceRoutesFactory.scala b/csw-framework/src/main/scala/csw/framework/internal/supervisor/CommandServiceRoutesFactory.scala index 8d5d272457..6af87e9abe 100644 --- a/csw-framework/src/main/scala/csw/framework/internal/supervisor/CommandServiceRoutesFactory.scala +++ b/csw-framework/src/main/scala/csw/framework/internal/supervisor/CommandServiceRoutesFactory.scala @@ -21,7 +21,7 @@ object CommandServiceRoutesFactory { import CommandServiceCodecs._ - def createRoutes(component: ActorRef[ComponentMessage])(implicit actorSystem: ActorSystem[_]): Route = { + def createRoutes(component: ActorRef[ComponentMessage])(implicit actorSystem: ActorSystem[?]): Route = { import actorSystem.executionContext val commandService = CommandServiceFactory.make(component) val securityDirectives = SecurityDirectives.authDisabled(actorSystem.settings.config)(actorSystem.executionContext) diff --git a/csw-framework/src/main/scala/csw/framework/internal/supervisor/HttpService.scala b/csw-framework/src/main/scala/csw/framework/internal/supervisor/HttpService.scala index e843510581..d3585b4de0 100644 --- a/csw-framework/src/main/scala/csw/framework/internal/supervisor/HttpService.scala +++ b/csw-framework/src/main/scala/csw/framework/internal/supervisor/HttpService.scala @@ -30,7 +30,7 @@ class HttpService( route: Route, log: Logger, httpConnection: HttpConnection -)(implicit actorSystem: ActorSystem[_]) { +)(implicit actorSystem: ActorSystem[?]) { import actorSystem.executionContext diff --git a/csw-framework/src/main/scala/csw/framework/javadsl/JContainerCmd.scala b/csw-framework/src/main/scala/csw/framework/javadsl/JContainerCmd.scala index 7ae0705df6..c03e2e9999 100644 --- a/csw-framework/src/main/scala/csw/framework/javadsl/JContainerCmd.scala +++ b/csw-framework/src/main/scala/csw/framework/javadsl/JContainerCmd.scala @@ -28,7 +28,7 @@ object JContainerCmd { * alone without any container * @return actor ref of the container or supervisor of the component started without container */ - def start(name: String, subsystem: Subsystem, args: Array[String], defaultConfig: Optional[Config]): ActorRef[_] = + def start(name: String, subsystem: Subsystem, args: Array[String], defaultConfig: Optional[Config]): ActorRef[?] = ContainerCmd.start(name, subsystem, args, defaultConfig.toScala) } // $COVERAGE-ON$ diff --git a/csw-framework/src/main/scala/csw/framework/scaladsl/RegistrationFactory.scala b/csw-framework/src/main/scala/csw/framework/scaladsl/RegistrationFactory.scala index 4a87e36a0d..5d00ac2b7d 100644 --- a/csw-framework/src/main/scala/csw/framework/scaladsl/RegistrationFactory.scala +++ b/csw-framework/src/main/scala/csw/framework/scaladsl/RegistrationFactory.scala @@ -27,7 +27,7 @@ class RegistrationFactory { */ def pekkoTyped( pekkoConnection: PekkoConnection, - actorRef: ActorRef[_], + actorRef: ActorRef[?], metadata: Metadata = Metadata.empty ): PekkoRegistration = PekkoRegistrationFactory.make(pekkoConnection, actorRef, metadata) diff --git a/csw-framework/src/test/scala/csw/common/components/command/McsAssemblyComponentHandlers.scala b/csw-framework/src/test/scala/csw/common/components/command/McsAssemblyComponentHandlers.scala index 83d68d040c..a12a4153b3 100644 --- a/csw-framework/src/test/scala/csw/common/components/command/McsAssemblyComponentHandlers.scala +++ b/csw-framework/src/test/scala/csw/common/components/command/McsAssemblyComponentHandlers.scala @@ -32,7 +32,7 @@ class McsAssemblyComponentHandlers(ctx: ActorContext[TopLevelActorMessage], cswC private implicit val timeout: Timeout = 10.seconds private implicit val ec: ExecutionContext = ctx.executionContext - private var hcdComponent: CommandService = _ + private var hcdComponent: CommandService = scala.compiletime.uninitialized private val assemblyPrefix = prefix import cswCtx._ diff --git a/csw-framework/src/test/scala/csw/common/utils/TestAppender.scala b/csw-framework/src/test/scala/csw/common/utils/TestAppender.scala index a076b9e587..548d4d816b 100644 --- a/csw-framework/src/test/scala/csw/common/utils/TestAppender.scala +++ b/csw-framework/src/test/scala/csw/common/utils/TestAppender.scala @@ -18,6 +18,6 @@ class TestAppender(callback: Any => Unit) extends LogAppenderBuilder { * @param stdHeaders the headers that are fixes for this service. * @return the stdout appender. */ - def apply(system: ActorSystem[_], stdHeaders: JsObject): StdOutAppender = + def apply(system: ActorSystem[?], stdHeaders: JsObject): StdOutAppender = new StdOutAppender(system, stdHeaders, callback) } diff --git a/csw-framework/src/test/scala/csw/framework/FrameworkTestMocks.scala b/csw-framework/src/test/scala/csw/framework/FrameworkTestMocks.scala index 75942f6ef9..e16edb39be 100644 --- a/csw-framework/src/test/scala/csw/framework/FrameworkTestMocks.scala +++ b/csw-framework/src/test/scala/csw/framework/FrameworkTestMocks.scala @@ -48,11 +48,11 @@ class FrameworkTestMocks(implicit system: ActorSystem[SpawnProtocol.Command]) ex val registrationResult: RegistrationResult = mock[RegistrationResult] val registrationFactory: RegistrationFactory = mock[RegistrationFactory] - when(registrationFactory.pekkoTyped(any[PekkoConnection], any[ActorRef[_]], any[Metadata])).thenReturn(pekkoRegistration) + when(registrationFactory.pekkoTyped(any[PekkoConnection], any[ActorRef[?]], any[Metadata])).thenReturn(pekkoRegistration) when(locationService.register(pekkoRegistration)).thenReturn(Future.successful(registrationResult)) when(locationService.register(any[HttpRegistration])).thenReturn(Future.successful(registrationResult)) when(locationService.unregister(any[PekkoConnection])).thenReturn(Future.successful(Done)) - when(eventServiceFactory.make(any[LocationService])(any[ActorSystem[_]])).thenReturn(eventService) + when(eventServiceFactory.make(any[LocationService])(any[ActorSystem[?]])).thenReturn(eventService) /////////////////////////////////////////////// val lifecycleStateProbe: TestProbe[LifecycleStateChanged] = TestProbe[LifecycleStateChanged]() @@ -64,7 +64,7 @@ class FrameworkTestMocks(implicit system: ActorSystem[SpawnProtocol.Command]) ex when(loggerFactory.getLogger).thenReturn(logger) when(loggerFactory.getLogger(any[actor.ActorContext])).thenReturn(logger) - when(loggerFactory.getLogger(any[ActorContext[_]])).thenReturn(logger) + when(loggerFactory.getLogger(any[ActorContext[?]])).thenReturn(logger) /////////////////////////////////////////////// val pubSubComponentActor: ActorRef[PubSub[CurrentState]] = diff --git a/csw-framework/src/test/scala/csw/framework/integration/AlarmServiceIntegrationTest.scala b/csw-framework/src/test/scala/csw/framework/integration/AlarmServiceIntegrationTest.scala index 7b8e15c649..ab53b6d6e9 100644 --- a/csw-framework/src/test/scala/csw/framework/integration/AlarmServiceIntegrationTest.scala +++ b/csw-framework/src/test/scala/csw/framework/integration/AlarmServiceIntegrationTest.scala @@ -35,8 +35,8 @@ class AlarmServiceIntegrationTest extends FrameworkIntegrationSuite { import testWiring._ private val masterId: String = ConfigFactory.load().getString("csw-alarm.redis.masterId") - private var sentinel: RedisSentinel = _ - private var server: RedisServer = _ + private var sentinel: RedisSentinel = scala.compiletime.uninitialized + private var server: RedisServer = scala.compiletime.uninitialized private val wiring: FrameworkWiring = FrameworkWiring.make(seedActorSystem) private val adminAlarmService = wiring.alarmServiceFactory.makeAdminApi(wiring.locationService) diff --git a/csw-framework/src/test/scala/csw/framework/integration/DiagnosticDataIntegrationTest.scala b/csw-framework/src/test/scala/csw/framework/integration/DiagnosticDataIntegrationTest.scala index 004296cc16..06929997ea 100644 --- a/csw-framework/src/test/scala/csw/framework/integration/DiagnosticDataIntegrationTest.scala +++ b/csw-framework/src/test/scala/csw/framework/integration/DiagnosticDataIntegrationTest.scala @@ -33,8 +33,8 @@ class DiagnosticDataIntegrationTest extends FrameworkIntegrationSuite { import testWiring._ private val masterId: String = ConfigFactory.load().getString("csw-event.redis.masterId") - private var sentinel: RedisSentinel = _ - private var server: RedisServer = _ + private var sentinel: RedisSentinel = scala.compiletime.uninitialized + private var server: RedisServer = scala.compiletime.uninitialized private val wiring: FrameworkWiring = FrameworkWiring.make(seedActorSystem) diff --git a/csw-framework/src/test/scala/csw/framework/integration/EventServiceIntegrationTest.scala b/csw-framework/src/test/scala/csw/framework/integration/EventServiceIntegrationTest.scala index 0c7fdb4653..8d34a92bca 100644 --- a/csw-framework/src/test/scala/csw/framework/integration/EventServiceIntegrationTest.scala +++ b/csw-framework/src/test/scala/csw/framework/integration/EventServiceIntegrationTest.scala @@ -38,8 +38,8 @@ class EventServiceIntegrationTest extends FrameworkIntegrationSuite with Eventua import testWiring._ private val masterId: String = ConfigFactory.load().getString("csw-event.redis.masterId") - private var sentinel: RedisSentinel = _ - private var server: RedisServer = _ + private var sentinel: RedisSentinel = scala.compiletime.uninitialized + private var server: RedisServer = scala.compiletime.uninitialized private val filterAssemblyConnection = PekkoConnection(api.models.ComponentId(Prefix(Subsystem.TCS, "Filter"), Assembly)) private val disperserHcdConnection = PekkoConnection(api.models.ComponentId(Prefix(Subsystem.TCS, "Disperser"), HCD)) diff --git a/csw-framework/src/test/scala/csw/framework/integration/StandaloneComponentTest.scala b/csw-framework/src/test/scala/csw/framework/integration/StandaloneComponentTest.scala index bd119b6cc3..86ce5ad7aa 100644 --- a/csw-framework/src/test/scala/csw/framework/integration/StandaloneComponentTest.scala +++ b/csw-framework/src/test/scala/csw/framework/integration/StandaloneComponentTest.scala @@ -49,7 +49,7 @@ class StandaloneComponentTest extends FrameworkIntegrationSuite { // all log messages will be captured in log buffer private val logBuffer = mutable.Buffer.empty[JsObject] private val testAppender = new TestAppender(x => logBuffer += Json.parse(x.toString).as[JsObject]) - private var loggingSystem: LoggingSystem = _ + private var loggingSystem: LoggingSystem = scala.compiletime.uninitialized // using standaloneActorSystem to start component instead of seedActorSystem, // to assert shutdown of the component(which will also shutdown standaloneActorSystem) private val standaloneComponentActorSystem: ActorSystem[SpawnProtocol.Command] = diff --git a/csw-framework/src/test/scala/csw/framework/internal/container/ContainerBehaviorTest.scala b/csw-framework/src/test/scala/csw/framework/internal/container/ContainerBehaviorTest.scala index 2fc885b013..c3a98099b3 100644 --- a/csw-framework/src/test/scala/csw/framework/internal/container/ContainerBehaviorTest.scala +++ b/csw-framework/src/test/scala/csw/framework/internal/container/ContainerBehaviorTest.scala @@ -83,7 +83,7 @@ class ContainerBehaviorTest extends AnyFunSuite with Matchers with MockitoSugar private val registrationFactory: RegistrationFactory = mock[RegistrationFactory] - when(registrationFactory.pekkoTyped(any[PekkoConnection], any[ActorRef[_]], any[Metadata])) + when(registrationFactory.pekkoTyped(any[PekkoConnection], any[ActorRef[?]], any[Metadata])) .thenReturn(pekkoRegistration) private val eventualRegistrationResult: Future[RegistrationResult] = diff --git a/csw-framework/src/test/scala/csw/framework/internal/supervisor/SupervisorLifecycleFailureTest.scala b/csw-framework/src/test/scala/csw/framework/internal/supervisor/SupervisorLifecycleFailureTest.scala index 0816e15186..5a6ff50fd7 100644 --- a/csw-framework/src/test/scala/csw/framework/internal/supervisor/SupervisorLifecycleFailureTest.scala +++ b/csw-framework/src/test/scala/csw/framework/internal/supervisor/SupervisorLifecycleFailureTest.scala @@ -51,18 +51,18 @@ import scala.concurrent.{ExecutionContext, Future} class SupervisorLifecycleFailureTest extends FrameworkTestSuite with BeforeAndAfterEach { val supervisorLifecycleStateProbe: TestProbe[SupervisorLifecycleState] = TestProbe[SupervisorLifecycleState]() - var supervisorRef: ActorRef[ComponentMessage] = _ - var initializeAnswer: Answer[Unit] = _ - var submitAnswer: Answer[Future[Unit]] = _ - var shutdownAnswer: Answer[Unit] = _ - var runAnswer: Answer[Future[Unit]] = _ + var supervisorRef: ActorRef[ComponentMessage] = scala.compiletime.uninitialized + var initializeAnswer: Answer[Unit] = scala.compiletime.uninitialized + var submitAnswer: Answer[Future[Unit]] = scala.compiletime.uninitialized + var shutdownAnswer: Answer[Unit] = scala.compiletime.uninitialized + var runAnswer: Answer[Future[Unit]] = scala.compiletime.uninitialized implicit val ec: ExecutionContext = typedSystem.executionContext // all log messages will be captured in log buffer private val logBuffer = mutable.Buffer.empty[JsObject] private val testAppender = new TestAppender(x => logBuffer += Json.parse(x.toString).as[JsObject]) - private var loggingSystem: LoggingSystem = _ + private var loggingSystem: LoggingSystem = scala.compiletime.uninitialized override protected def beforeAll(): Unit = { loggingSystem = new LoggingSystem("sup-failure", "1.0", "localhost", typedSystem) diff --git a/csw-location/csw-location-agent/src/test/scala/csw/location/agent/MainTest.scala b/csw-location/csw-location-agent/src/test/scala/csw/location/agent/MainTest.scala index 5db2150c5f..47aa92cfb9 100644 --- a/csw-location/csw-location-agent/src/test/scala/csw/location/agent/MainTest.scala +++ b/csw-location/csw-location-agent/src/test/scala/csw/location/agent/MainTest.scala @@ -26,7 +26,7 @@ import scala.concurrent.duration.DurationInt // DEOPSCSW-592: Create csw testkit for component writers class MainTest extends ScalaTestFrameworkTestKit with AnyFunSuiteLike with ScalaFutures { - implicit private val system: typed.ActorSystem[_] = typed.ActorSystem(Behaviors.empty, "test-system") + implicit private val system: typed.ActorSystem[?] = typed.ActorSystem(Behaviors.empty, "test-system") private val locationService = HttpLocationServiceFactory.makeLocalClient implicit val patience: PatienceConfig = PatienceConfig(5.seconds, 100.millis) diff --git a/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/PekkoRegistrationFactory.scala b/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/PekkoRegistrationFactory.scala index 766bd24080..2fc5dcecc9 100644 --- a/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/PekkoRegistrationFactory.scala +++ b/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/PekkoRegistrationFactory.scala @@ -30,7 +30,7 @@ class PekkoRegistrationFactory { * @return PekkoRegistration instance. A [[csw.location.api.exceptions.LocalPekkoActorRegistrationNotAllowed]] * is thrown if the actorRefURI provided is not a remote actorRef uri */ - def make(connection: PekkoConnection, actorRef: ActorRef[_], metadata: Metadata): PekkoRegistration = { + def make(connection: PekkoConnection, actorRef: ActorRef[?], metadata: Metadata): PekkoRegistration = { val actorRefURI = actorRef.toURI if (actorRefURI.getPort == -1) { val log: Logger = LocationServiceLogger.getLogger @@ -49,7 +49,7 @@ class PekkoRegistrationFactory { * @return PekkoRegistration instance. A [[csw.location.api.exceptions.LocalPekkoActorRegistrationNotAllowed]] * is thrown if the actorRefURI provided is not a remote actorRef uri */ - def make(connection: PekkoConnection, actorRef: ActorRef[_]): PekkoRegistration = + def make(connection: PekkoConnection, actorRef: ActorRef[?]): PekkoRegistration = make(connection, actorRef, Metadata.empty) } diff --git a/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/extensions/ActorExtension.scala b/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/extensions/ActorExtension.scala index 889da64bc5..f70cefce13 100644 --- a/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/extensions/ActorExtension.scala +++ b/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/extensions/ActorExtension.scala @@ -12,7 +12,7 @@ import org.apache.pekko.actor.typed.scaladsl.adapter.TypedActorRefOps import org.apache.pekko.serialization.Serialization object ActorExtension { - implicit class RichActor(actorRef: ActorRef[_]) { + implicit class RichActor(actorRef: ActorRef[?]) { def toURI: URI = new URI(Serialization.serializedActorPath(actorRef.toClassic)) } } diff --git a/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/extensions/URIExtension.scala b/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/extensions/URIExtension.scala index 6c9bf2514e..1b15c0005c 100644 --- a/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/extensions/URIExtension.scala +++ b/csw-location/csw-location-api/jvm/src/main/scala/csw/location/api/extensions/URIExtension.scala @@ -11,6 +11,6 @@ import org.apache.pekko.actor.typed.{ActorRef, ActorRefResolver, ActorSystem} object URIExtension { implicit class RichURI(val uri: URI) { - def toActorRef(implicit system: ActorSystem[_]): ActorRef[Nothing] = ActorRefResolver(system).resolveActorRef(uri.toString) + def toActorRef(implicit system: ActorSystem[?]): ActorRef[Nothing] = ActorRefResolver(system).resolveActorRef(uri.toString) } } diff --git a/csw-location/csw-location-api/shared/src/main/scala/csw/location/api/client/LocationServiceClient.scala b/csw-location/csw-location-api/shared/src/main/scala/csw/location/api/client/LocationServiceClient.scala index 7084a941b6..29f8781347 100644 --- a/csw-location/csw-location-api/shared/src/main/scala/csw/location/api/client/LocationServiceClient.scala +++ b/csw-location/csw-location-api/shared/src/main/scala/csw/location/api/client/LocationServiceClient.scala @@ -25,7 +25,7 @@ class LocationServiceClient( httpTransport: Transport[LocationRequest], websocketTransport: Transport[LocationStreamRequest], cswVersion: CswVersion -)(implicit actorSystem: ActorSystem[_]) +)(implicit actorSystem: ActorSystem[?]) extends LocationService with LocationServiceCodecs with BasicCodecs { diff --git a/csw-location/csw-location-api/shared/src/main/scala/csw/location/api/models/Connection.scala b/csw-location/csw-location-api/shared/src/main/scala/csw/location/api/models/Connection.scala index 7d0718d0cd..8ae311fd6e 100644 --- a/csw-location/csw-location-api/shared/src/main/scala/csw/location/api/models/Connection.scala +++ b/csw-location/csw-location-api/shared/src/main/scala/csw/location/api/models/Connection.scala @@ -16,7 +16,7 @@ import csw.prefix.models.Prefix * @param connectionType represents a type of connection offered by the Component */ sealed abstract class Connection(val connectionType: ConnectionType) extends LocationSerializable { - self: TypedConnection[_] => + self: TypedConnection[?] => /** * The component that is providing this connection diff --git a/csw-location/csw-location-client/src/main/scala/csw/location/client/javadsl/JHttpLocationServiceFactory.scala b/csw-location/csw-location-client/src/main/scala/csw/location/client/javadsl/JHttpLocationServiceFactory.scala index 5f0ec033fe..d8c8e7d32f 100644 --- a/csw-location/csw-location-client/src/main/scala/csw/location/client/javadsl/JHttpLocationServiceFactory.scala +++ b/csw-location/csw-location-client/src/main/scala/csw/location/client/javadsl/JHttpLocationServiceFactory.scala @@ -19,7 +19,7 @@ object JHttpLocationServiceFactory { * Use this factory method to create http location client when location server is running locally. * HTTP Location server runs on port 7654. */ - def makeLocalClient(actorSystem: ActorSystem[_]): ILocationService = + def makeLocalClient(actorSystem: ActorSystem[?]): ILocationService = HttpLocationServiceFactory.makeLocalClient(actorSystem).asJava(actorSystem.executionContext) } diff --git a/csw-location/csw-location-client/src/main/scala/csw/location/client/scaladsl/HttpLocationServiceFactory.scala b/csw-location/csw-location-client/src/main/scala/csw/location/client/scaladsl/HttpLocationServiceFactory.scala index 4c1097ef99..f53cada7ec 100644 --- a/csw-location/csw-location-client/src/main/scala/csw/location/client/scaladsl/HttpLocationServiceFactory.scala +++ b/csw-location/csw-location-client/src/main/scala/csw/location/client/scaladsl/HttpLocationServiceFactory.scala @@ -27,14 +27,14 @@ object HttpLocationServiceFactory extends LocationServiceCodecs { * Use this factory method to create http location client when location server is running locally. * HTTP Location server runs on port 7654. */ - def makeLocalClient(implicit actorSystem: ActorSystem[_]): LocationService = make("localhost") + def makeLocalClient(implicit actorSystem: ActorSystem[?]): LocationService = make("localhost") /** * Use this factory method to create http location client when location server ip is known. * HTTP Location server runs on port 7654. */ private[csw] def make(serverIp: String, port: Int, tokenFactory: () => Option[String] = () => None)(implicit - actorSystem: ActorSystem[_] + actorSystem: ActorSystem[?] ): LocationService = { val httpUri = s"http://$serverIp:$port/post-endpoint" @@ -46,6 +46,6 @@ object HttpLocationServiceFactory extends LocationServiceCodecs { new LocationServiceClient(httpTransport, websocketTransport, new CswVersionJvm()) } - private[csw] def make(serverIp: String)(implicit actorSystem: ActorSystem[_]): LocationService = + private[csw] def make(serverIp: String)(implicit actorSystem: ActorSystem[?]): LocationService = make(serverIp, httpServerPort) } diff --git a/csw-location/csw-location-server/src/main/scala/csw/location/server/internal/DeathwatchActor.scala b/csw-location/csw-location-server/src/main/scala/csw/location/server/internal/DeathwatchActor.scala index 0c3bfd46e1..6e2e5eccf9 100644 --- a/csw-location/csw-location-server/src/main/scala/csw/location/server/internal/DeathwatchActor.scala +++ b/csw-location/csw-location-server/src/main/scala/csw/location/server/internal/DeathwatchActor.scala @@ -23,7 +23,7 @@ import csw.logging.client.commons.PekkoTypedExtension.UserActorFactory * * @param locationService is used to unregister Actors that are no more alive */ -private[location] class DeathwatchActor(locationService: LocationService)(implicit actorSystem: ActorSystem[_]) { +private[location] class DeathwatchActor(locationService: LocationService)(implicit actorSystem: ActorSystem[?]) { import DeathwatchActor.Msg /** diff --git a/csw-location/csw-location-server/src/test/scala/csw/location/models/RegistrationTest.scala b/csw-location/csw-location-server/src/test/scala/csw/location/models/RegistrationTest.scala index 9557453032..4fcc012007 100644 --- a/csw-location/csw-location-server/src/test/scala/csw/location/models/RegistrationTest.scala +++ b/csw-location/csw-location-server/src/test/scala/csw/location/models/RegistrationTest.scala @@ -35,7 +35,7 @@ class RegistrationTest extends AnyFunSuite with Matchers with BeforeAndAfterAll val hostname = Networks().hostname val pekkoConnection = PekkoConnection(api.models.ComponentId(Prefix(Subsystem.NFIRAOS, "hcd1"), ComponentType.HCD)) - val actorRef: ActorRef[_] = actorSystem.spawn( + val actorRef: ActorRef[?] = actorSystem.spawn( Behaviors.empty, "my-actor-3" ) @@ -50,7 +50,7 @@ class RegistrationTest extends AnyFunSuite with Matchers with BeforeAndAfterAll val hostname = Networks().hostname val pekkoConnection = PekkoConnection(api.models.ComponentId(Prefix(Subsystem.NFIRAOS, "hcd1"), ComponentType.HCD)) - val actorRef: ActorRef[_] = actorSystem.spawn( + val actorRef: ActorRef[?] = actorSystem.spawn( Behaviors.empty, "my-actor-4" ) diff --git a/csw-location/csw-location-server/src/test/scala/csw/location/server/http/LocationAuthTestWithKeycloak.scala b/csw-location/csw-location-server/src/test/scala/csw/location/server/http/LocationAuthTestWithKeycloak.scala index e659cf0e5e..22a4e032db 100644 --- a/csw-location/csw-location-server/src/test/scala/csw/location/server/http/LocationAuthTestWithKeycloak.scala +++ b/csw-location/csw-location-server/src/test/scala/csw/location/server/http/LocationAuthTestWithKeycloak.scala @@ -41,7 +41,7 @@ class LocationAuthTestWithKeycloak private lazy val tokenFactoryWithAdminRole: () => Option[String] = getToken("admin", "password1") private lazy val tokenFactoryWithoutAdminRole: () => Option[String] = getToken("nonAdmin", "password2") - private var keycloakStopHandle: StopHandle = _ + private var keycloakStopHandle: StopHandle = scala.compiletime.uninitialized override def beforeAll(): Unit = { super.beforeAll() @@ -98,8 +98,21 @@ class LocationAuthTestWithKeycloak Realm( name = "TMT", users = Set( - ApplicationUser("admin", "password1", realmRoles = Set(AdminRole)), - ApplicationUser("nonAdmin", "password2") + ApplicationUser( + "admin", + "password1", + firstName = "admin", + lastName = "admin", + email = "admin@tmt.org", + realmRoles = Set(AdminRole) + ), + ApplicationUser( + "nonAdmin", + "password2", + firstName = "noadmin", + lastName = "noadmin", + email = "noadmin@tmt.org" + ) ), clients = Set(locationServerClient), realmRoles = Set(AdminRole) diff --git a/csw-location/csw-location-server/src/test/scala/csw/location/server/http/LocationServiceCompTestWithHttp.scala b/csw-location/csw-location-server/src/test/scala/csw/location/server/http/LocationServiceCompTestWithHttp.scala index 689d7e5fa0..3085421fce 100644 --- a/csw-location/csw-location-server/src/test/scala/csw/location/server/http/LocationServiceCompTestWithHttp.scala +++ b/csw-location/csw-location-server/src/test/scala/csw/location/server/http/LocationServiceCompTestWithHttp.scala @@ -17,7 +17,7 @@ import scala.concurrent.duration.DurationInt // DEOPSCSW-429: [SPIKE] Provide HTTP server and client for location service class LocationServiceCompTestWithHttp extends LocationServiceCompTest("http") { - private var wiring: ServerWiring = _ + private var wiring: ServerWiring = scala.compiletime.uninitialized override protected def beforeAll(): Unit = { wiring = new ServerWiring(false) diff --git a/csw-location/csw-location-server/src/test/scala/csw/location/server/internal/LocationServiceImplTest.scala b/csw-location/csw-location-server/src/test/scala/csw/location/server/internal/LocationServiceImplTest.scala index 16ff4261d0..f89b1ced93 100644 --- a/csw-location/csw-location-server/src/test/scala/csw/location/server/internal/LocationServiceImplTest.scala +++ b/csw-location/csw-location-server/src/test/scala/csw/location/server/internal/LocationServiceImplTest.scala @@ -28,7 +28,7 @@ class LocationServiceImplTest extends AnyFunSuite with Matchers with MockitoSuga test("should select public hostname when network type is public | CSW-97") { val registration = HttpRegistration(connection = httpConnection, port = port, path = "", NetworkType.Outside) - when(mockCswCluster.publicHostname) thenReturn ("some-public-ip") + when(mockCswCluster.publicHostname) `thenReturn` ("some-public-ip") val locationService = new LocationServiceImpl(mockCswCluster) locationService.getLocation(registration).uri.getHost shouldBe "some-public-ip" @@ -37,7 +37,7 @@ class LocationServiceImplTest extends AnyFunSuite with Matchers with MockitoSuga test("should select private hostname when no network type provided | CSW-97") { val registration = HttpRegistration(connection = httpConnection, port = port, path = "") - when(mockCswCluster.hostname) thenReturn ("some-private-ip") + when(mockCswCluster.hostname) `thenReturn` ("some-private-ip") val locationService = new LocationServiceImpl(mockCswCluster) locationService.getLocation(registration).uri.getHost shouldBe "some-private-ip" @@ -50,8 +50,8 @@ class LocationServiceImplTest extends AnyFunSuite with Matchers with MockitoSuga val pekkoRegistration: PekkoRegistration = PekkoRegistrationFactory.make(pekkoConnection, actorRef) - when(mockCswCluster.hostname) thenReturn ("some-private-ip") - when(mockCswCluster.publicHostname) thenReturn ("some-public-ip") + when(mockCswCluster.hostname) `thenReturn` ("some-private-ip") + when(mockCswCluster.publicHostname) `thenReturn` ("some-public-ip") val locationService = new LocationServiceImpl(mockCswCluster) locationService.getLocation(pekkoRegistration).uri shouldBe actorRef.toURI diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/FileAppender.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/FileAppender.scala index 5891ab786f..62d762ee2e 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/FileAppender.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/FileAppender.scala @@ -28,8 +28,8 @@ import scala.concurrent.{ExecutionContextExecutor, Future, Promise} */ private[logging] class FileAppenderHelper(path: String, name: String, category: String) { - private[this] var fileSpanTimestamp: Option[ZonedDateTime] = None - private[this] var maybePrintWriter: Option[PrintWriter] = None + private var fileSpanTimestamp: Option[ZonedDateTime] = None + private var maybePrintWriter: Option[PrintWriter] = None protected val log: Logger = new LoggerImpl(None, None) @@ -102,7 +102,7 @@ private[logging] class FileAppenderHelper(path: String, name: String, category: */ private[logging] class FilesAppender(path: String, name: String, category: String) { - private[this] val fileAppenderHelper = new FileAppenderHelper(path, name, category) + private val fileAppenderHelper = new FileAppenderHelper(path, name, category) def add(maybeTimestamp: Option[ZonedDateTime], line: String, rotateFlag: Boolean): Unit = fileAppenderHelper.appendAdd(maybeTimestamp, line, rotateFlag) @@ -127,7 +127,7 @@ object FileAppender extends LogAppenderBuilder { * @param system typed Actor System. * @param stdHeaders the headers that are fixes for this service. */ - def apply(system: ActorSystem[_], stdHeaders: JsObject): FileAppender = + def apply(system: ActorSystem[?], stdHeaders: JsObject): FileAppender = new FileAppender(system, stdHeaders) def decideTimestampForFile(logDateTime: ZonedDateTime): ZonedDateTime = { @@ -151,18 +151,18 @@ object FileAppender extends LogAppenderBuilder { * @param system typed Actor System * @param stdHeaders the headers that are fixes for this service. */ -class FileAppender(system: ActorSystem[_], stdHeaders: JsObject) extends LogAppender { +class FileAppender(system: ActorSystem[?], stdHeaders: JsObject) extends LogAppender { - private[this] implicit val executionContext: ExecutionContextExecutor = system.executionContext - private[this] val config = + private implicit val executionContext: ExecutionContextExecutor = system.executionContext + private val config = system.settings.config.getConfig("csw-logging.appender-config.file") if (!config.hasPath(FileAppender.BaseLogPath)) throw BaseLogPathNotDefined(FileAppender.TMT_LOG_HOME) - private[this] val fullHeaders = config.getBoolean("fullHeaders") - private[this] val logPath = s"${config.getString(FileAppender.BaseLogPath)}/${config.getString("logPath")}" - private[this] val logLevelLimit = Level(config.getString("logLevelLimit")) - private[this] val rotateFlag = config.getBoolean("rotate") - private[this] val fileAppenders = + private val fullHeaders = config.getBoolean("fullHeaders") + private val logPath = s"${config.getString(FileAppender.BaseLogPath)}/${config.getString("logPath")}" + private val logLevelLimit = Level(config.getString("logLevelLimit")) + private val rotateFlag = config.getBoolean("rotate") + private val fileAppenders = scala.collection.mutable.HashMap[String, FilesAppender]() private val loggingSystemName = stdHeaders.getString(LoggingKeys.NAME) diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/LogAppender.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/LogAppender.scala index 7c48f11529..642c62d326 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/LogAppender.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/LogAppender.scala @@ -22,7 +22,7 @@ trait LogAppenderBuilder { * @param standardHeaders the headers that are fixes for this service * @return an appender */ - def apply(system: ActorSystem[_], standardHeaders: JsObject): LogAppender + def apply(system: ActorSystem[?], standardHeaders: JsObject): LogAppender } /** diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/StdOutAppender.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/StdOutAppender.scala index 7f89c038e4..17e74b58b4 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/StdOutAppender.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/appenders/StdOutAppender.scala @@ -25,7 +25,7 @@ object StdOutAppender extends LogAppenderBuilder { * @param stdHeaders the headers that are fixes for this service * @return the stdout appender */ - def apply(system: ActorSystem[_], stdHeaders: JsObject): StdOutAppender = + def apply(system: ActorSystem[?], stdHeaders: JsObject): StdOutAppender = new StdOutAppender(system, stdHeaders, println) } @@ -36,18 +36,18 @@ object StdOutAppender extends LogAppenderBuilder { * @param system typed Actor System * @param stdHeaders the headers that are fixes for this service */ -class StdOutAppender(system: ActorSystem[_], stdHeaders: JsObject, logPrinter: Any => Unit) extends LogAppender { - private[this] val config = system.settings.config.getConfig("csw-logging.appender-config.stdout") - private[this] val fullHeaders = config.getBoolean("fullHeaders") - private[this] val summary = config.getBoolean("summary") - private[this] val pretty = config.getBoolean("pretty") - private[this] val logLevelLimit = Level(config.getString("logLevelLimit")) - private[csw] val color = config.getBoolean("color") - private[csw] val oneLine = config.getBoolean("oneLine") - - private[this] var categories = Map.empty[String, Int] - private[this] var levels = Map.empty[String, Int] - private[this] var kinds = Map.empty[String, Int] +class StdOutAppender(system: ActorSystem[?], stdHeaders: JsObject, logPrinter: Any => Unit) extends LogAppender { + private val config = system.settings.config.getConfig("csw-logging.appender-config.stdout") + private val fullHeaders = config.getBoolean("fullHeaders") + private val summary = config.getBoolean("summary") + private val pretty = config.getBoolean("pretty") + private val logLevelLimit = Level(config.getString("logLevelLimit")) + private[csw] val color = config.getBoolean("color") + private[csw] val oneLine = config.getBoolean("oneLine") + + private var categories = Map.empty[String, Int] + private var levels = Map.empty[String, Int] + private var kinds = Map.empty[String, Int] /** * Writes a log message to stdout diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/compat/PekkoLogger.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/compat/PekkoLogger.scala index f383c7b9bc..783760f792 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/compat/PekkoLogger.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/compat/PekkoLogger.scala @@ -31,6 +31,6 @@ private[logging] class PekkoLogger extends Actor { case event @ Debug(logSource, logClass, message) => log(DEBUG, logSource, logClass, message, event.timestamp) } - private def log(level: Level, source: String, clazz: Class[_], msg: Any, time: Long, cause: Option[Throwable] = None): Unit = + private def log(level: Level, source: String, clazz: Class[?], msg: Any, time: Long, cause: Option[Throwable] = None): Unit = MessageHandler.sendPekkoMsg(LogPekko(time, level, source, clazz, msg, cause)) } diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/GcLogger.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/GcLogger.scala index a5135f5b16..1f0aafc609 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/GcLogger.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/GcLogger.scala @@ -23,9 +23,9 @@ private[logging] class GcLogger { private val log: Logger = GenericLoggerFactory.getLogger - private[this] val gcbeans = java.lang.management.ManagementFactory.getGarbageCollectorMXBeans + private val gcbeans = java.lang.management.ManagementFactory.getGarbageCollectorMXBeans - private[this] val emitters = for (gcbean <- gcbeans.asScala) yield { + private val emitters = for (gcbean <- gcbeans.asScala) yield { val emitter = gcbean.asInstanceOf[NotificationEmitter] val listener = new NotificationListener() { @Override diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/JLoggerImpl.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/JLoggerImpl.scala index 4d0adfbb0a..fbf1c2b36d 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/JLoggerImpl.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/JLoggerImpl.scala @@ -15,7 +15,7 @@ import csw.logging.models.{AnyId, noId} import scala.jdk.CollectionConverters.* -private[logging] class JLoggerImpl(log: Logger, cls: Class[_]) extends ILogger { +private[logging] class JLoggerImpl(log: Logger, cls: Class[?]) extends ILogger { // SourceFactory makes `class` to appear in log statements override def trace(msg: Supplier[String]): Unit = log.trace(msg.get)(SourceFactory.from(cls)) diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LogActor.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LogActor.scala index 40bc523efd..c850abff16 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LogActor.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LogActor.scala @@ -36,7 +36,7 @@ private[logging] object LogActor { implicit val logSource: LogSource[AnyRef] = new LogSource[AnyRef] { def genString(o: AnyRef): String = o.getClass.getName - override def getClazz(o: AnyRef): Class[_] = o.getClass + override def getClazz(o: AnyRef): Class[?] = o.getClass } var level: Level = initLevel diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LogActorMessages.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LogActorMessages.scala index 222a241a11..8ad57eaccb 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LogActorMessages.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LogActorMessages.scala @@ -40,7 +40,7 @@ private[csw] object LogActorMessages { case class SetSlf4jLevel(level: Level) extends LogActorMessages - case class LogPekko(time: Long, level: Level, source: String, clazz: Class[_], msg: Any, cause: Option[Throwable]) + case class LogPekko(time: Long, level: Level, source: String, clazz: Class[?], msg: Any, cause: Option[Throwable]) extends LogActorMessages case class SetPekkoLevel(level: Level) extends LogActorMessages diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LoggerImpl.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LoggerImpl.scala index 8d0535c64e..50e1801544 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LoggerImpl.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LoggerImpl.scala @@ -21,7 +21,7 @@ import csw.prefix.models.Prefix private[csw] class LoggerImpl(maybePrefix: Option[Prefix], actorName: Option[String]) extends Logger { // default log level will be applied if component specific log level is not provided in logging configuration inside component-log-levels block - private[this] def componentLoggingState: ComponentLoggingState = + private def componentLoggingState: ComponentLoggingState = maybePrefix match { case Some(prefix) => componentsLoggingState.getOrDefault(prefix, ComponentLoggingState(defaultLogLevel)) case None => ComponentLoggingState(defaultLogLevel) diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LoggingSystem.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LoggingSystem.scala index f266a4dfad..e5a3c18b4d 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LoggingSystem.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/internal/LoggingSystem.scala @@ -40,42 +40,42 @@ import scala.jdk.CollectionConverters.* */ class LoggingSystem private[csw] (name: String, version: String, host: String, val system: ActorSystem[SpawnProtocol.Command]) { - private[this] val loggingConfig = system.settings.config.getConfig("csw-logging") + private val loggingConfig = system.settings.config.getConfig("csw-logging") - private[this] val defaultAppenderBuilders: List[LogAppenderBuilder] = + private val defaultAppenderBuilders: List[LogAppenderBuilder] = loggingConfig.getStringList("appenders").asScala.toList.map(getAppenderInstance) @volatile var appenderBuilders: List[LogAppenderBuilder] = defaultAppenderBuilders - private[this] val levels = loggingConfig.getString("logLevel") - private[this] val defaultLevel: Level = + private val levels = loggingConfig.getString("logLevel") + private val defaultLevel: Level = if (Level.hasLevel(levels)) Level(levels) else throw new Exception(s"Bad value $levels for csw-logging.logLevel") LoggingState.logLevel = defaultLevel - private[this] val pekkoLogLevelS = loggingConfig.getString("pekkoLogLevel") - private[this] val defaultPekkoLogLevel: Level = + private val pekkoLogLevelS = loggingConfig.getString("pekkoLogLevel") + private val defaultPekkoLogLevel: Level = if (Level.hasLevel(pekkoLogLevelS)) Level(pekkoLogLevelS) else throw new Exception(s"Bad value $pekkoLogLevelS for csw-logging.pekkoLogLevel") LoggingState.pekkoLogLevel = defaultPekkoLogLevel - private[this] val slf4jLogLevelS = loggingConfig.getString("slf4jLogLevel") - private[this] val defaultSlf4jLogLevel: Level = + private val slf4jLogLevelS = loggingConfig.getString("slf4jLogLevel") + private val defaultSlf4jLogLevel: Level = if (Level.hasLevel(slf4jLogLevelS)) Level(slf4jLogLevelS) else throw new Exception(s"Bad value $slf4jLogLevelS for csw-logging.slf4jLogLevel") LoggingState.slf4jLogLevel = defaultSlf4jLogLevel - private[this] val gc = loggingConfig.getBoolean("gc") - private[this] val time = loggingConfig.getBoolean("time") + private val gc = loggingConfig.getBoolean("gc") + private val time = loggingConfig.getBoolean("time") - private[this] implicit val ec: ExecutionContext = system.executionContext - private[this] val done = Promise[Unit]() - private[this] val timeActorDonePromise = Promise[Unit]() + private implicit val ec: ExecutionContext = system.executionContext + private val done = Promise[Unit]() + private val timeActorDonePromise = Promise[Unit]() - private[this] val initialComponentsLoggingState = ComponentLoggingStateManager.from(loggingConfig) + private val initialComponentsLoggingState = ComponentLoggingStateManager.from(loggingConfig) LoggingState.componentsLoggingState.putAll(initialComponentsLoggingState) @@ -89,11 +89,11 @@ class LoggingSystem private[csw] (name: String, version: String, host: String, v LoggingState.doTime = false LoggingState.timeActorOption = None - @volatile private[this] var appenders = appenderBuilders.map { + @volatile private var appenders = appenderBuilders.map { _.apply(system, standardHeaders) } - private[this] val logActor = system.spawn( + private val logActor = system.spawn( LogActor.behavior(done, appenders, defaultLevel, defaultSlf4jLogLevel, defaultPekkoLogLevel), name = "LoggingActor", MailboxSelector.fromConfig("logging-dispatcher") diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/javadsl/loggers.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/javadsl/loggers.scala index 4263f7fcc4..10a974b0d8 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/javadsl/loggers.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/javadsl/loggers.scala @@ -17,13 +17,13 @@ import csw.logging.client.scaladsl.LoggerFactory import csw.prefix.models.Prefix abstract class JBaseLoggerFactory private[logging] (maybePrefix: Option[Prefix]) { - def getLogger[T](ctx: ActorContext[T], klass: Class[_]): ILogger = new JLoggerImpl(logger(Some(actorPath(ctx.getSelf))), klass) - def getLogger(ctx: actor.ActorContext, klass: Class[_]): ILogger = new JLoggerImpl(logger(Some(actorPath(ctx.self))), klass) - def getLogger(klass: Class[_]): ILogger = new JLoggerImpl(logger(None), klass) + def getLogger[T](ctx: ActorContext[T], klass: Class[?]): ILogger = new JLoggerImpl(logger(Some(actorPath(ctx.getSelf))), klass) + def getLogger(ctx: actor.ActorContext, klass: Class[?]): ILogger = new JLoggerImpl(logger(Some(actorPath(ctx.self))), klass) + def getLogger(klass: Class[?]): ILogger = new JLoggerImpl(logger(None), klass) private def logger(maybeActorRef: Option[String]): Logger = new LoggerImpl(maybePrefix, maybeActorRef) private def actorPath(actorRef: ActorRef): String = ActorPath.fromString(Serialization.serializedActorPath(actorRef)).toString - private def actorPath(actorRef: typed.ActorRef[_]): String = actorPath(actorRef.toClassic) + private def actorPath(actorRef: typed.ActorRef[?]): String = actorPath(actorRef.toClassic) } /** diff --git a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/scaladsl/LoggingSystemFactory.scala b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/scaladsl/LoggingSystemFactory.scala index e81c213091..e87e3b6f0d 100644 --- a/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/scaladsl/LoggingSystemFactory.scala +++ b/csw-logging/csw-logging-client/src/main/scala/csw/logging/client/scaladsl/LoggingSystemFactory.scala @@ -12,14 +12,14 @@ import csw.logging.client.appenders.{LogAppenderBuilder, StdOutAppender} import csw.logging.client.internal.LoggingSystem import play.api.libs.json.JsObject -private[csw] class StdOutTestAppender(system: ActorSystem[_], stdHeaders: JsObject, logPrinter: Any => Unit) +private[csw] class StdOutTestAppender(system: ActorSystem[?], stdHeaders: JsObject, logPrinter: Any => Unit) extends StdOutAppender(system, stdHeaders, logPrinter) { override val color = true override val oneLine = true } private[csw] object StdOutTestAppender extends LogAppenderBuilder { - def apply(system: ActorSystem[_], stdHeaders: JsObject): StdOutTestAppender = + def apply(system: ActorSystem[?], stdHeaders: JsObject): StdOutTestAppender = new StdOutTestAppender(system, stdHeaders, println) } diff --git a/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/appenders/CustomAppenderTest.scala b/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/appenders/CustomAppenderTest.scala index c7534861c1..b074532f26 100644 --- a/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/appenders/CustomAppenderTest.scala +++ b/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/appenders/CustomAppenderTest.scala @@ -39,21 +39,21 @@ class MyFavComponent { class CustomAppenderBuilderClass extends LogAppenderBuilder { val logBuffer: mutable.Buffer[JsObject] = mutable.Buffer.empty[JsObject] - override def apply(system: typed.ActorSystem[_], standardHeaders: JsObject): LogAppender = + override def apply(system: typed.ActorSystem[?], standardHeaders: JsObject): LogAppender = new CustomAppender(system, standardHeaders, x => logBuffer += Json.parse(x.toString).as[JsObject]) } object CustomAppenderBuilderObject extends LogAppenderBuilder { val logBuffer: mutable.Buffer[JsObject] = mutable.Buffer.empty[JsObject] - override def apply(system: typed.ActorSystem[_], standardHeaders: JsObject): LogAppender = + override def apply(system: typed.ActorSystem[?], standardHeaders: JsObject): LogAppender = new CustomAppender(system, standardHeaders, x => logBuffer += Json.parse(x.toString).as[JsObject]) } -class CustomAppender(system: typed.ActorSystem[_], stdHeaders: JsObject, callback: Any => Unit) extends LogAppender { +class CustomAppender(system: typed.ActorSystem[?], stdHeaders: JsObject, callback: Any => Unit) extends LogAppender { - private[this] val config = system.settings.config.getConfig("csw-logging.appender-config.my-fav-appender") - private[this] val logIpAddress = config.getBoolean("logIpAddress") + private val config = system.settings.config.getConfig("csw-logging.appender-config.my-fav-appender") + private val logIpAddress = config.getBoolean("logIpAddress") override def stop(): Future[Unit] = Future.successful(()) diff --git a/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/scaladsl/LoggingSystemTest.scala b/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/scaladsl/LoggingSystemTest.scala index 040b6c173b..2f8d4833ae 100644 --- a/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/scaladsl/LoggingSystemTest.scala +++ b/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/scaladsl/LoggingSystemTest.scala @@ -22,7 +22,7 @@ import org.scalatest.matchers.should.Matchers class LoggingSystemTest extends AnyFunSuite with Matchers with BeforeAndAfterAll { // This will load default configuration in application.conf file if provided - private var loggingSystem: LoggingSystem = _ + private var loggingSystem: LoggingSystem = scala.compiletime.uninitialized private val config = ConfigFactory.load().getConfig("csw-logging") override protected def beforeAll(): Unit = loggingSystem = LoggingSystemFactory.start() diff --git a/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/utils/TestAppender.scala b/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/utils/TestAppender.scala index f9c7c4a2da..9917b9ea0a 100644 --- a/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/utils/TestAppender.scala +++ b/csw-logging/csw-logging-client/src/test/scala/csw/logging/client/utils/TestAppender.scala @@ -18,6 +18,6 @@ class TestAppender(callback: Any => Unit) extends LogAppenderBuilder { * @param stdHeaders the headers that are fixes for this service. * @return the stdout appender. */ - def apply(system: ActorSystem[_], stdHeaders: JsObject): StdOutAppender = + def apply(system: ActorSystem[?], stdHeaders: JsObject): StdOutAppender = new StdOutAppender(system, stdHeaders, callback) } diff --git a/csw-logging/csw-logging-macros/src/main/scala/csw/logging/macros/SourceFactory.scala b/csw-logging/csw-logging-macros/src/main/scala/csw/logging/macros/SourceFactory.scala index 3bf1b7b6f4..cdcc0e2e44 100644 --- a/csw-logging/csw-logging-macros/src/main/scala/csw/logging/macros/SourceFactory.scala +++ b/csw-logging/csw-logging-macros/src/main/scala/csw/logging/macros/SourceFactory.scala @@ -14,7 +14,7 @@ object SourceFactory { def from(f: () => SourceLocation): SourceFactory = () => f() - def from(cls: Class[_]): SourceFactory = from(() => SourceLocation("", "", cls.getName, -1)) + def from(cls: Class[?]): SourceFactory = from(() => SourceLocation("", "", cls.getName, -1)) private inline def getSourceLocation: SourceFactory = () => diff --git a/csw-params/jvm/src/test/scala/csw/params/core/formats/JsonTest.scala b/csw-params/jvm/src/test/scala/csw/params/core/formats/JsonTest.scala index f7502c499b..95d6248c1e 100644 --- a/csw-params/jvm/src/test/scala/csw/params/core/formats/JsonTest.scala +++ b/csw-params/jvm/src/test/scala/csw/params/core/formats/JsonTest.scala @@ -178,7 +178,7 @@ class JsonTest extends AnyFunSpec { val items = sc1.paramSet val js3 = JsonSupport.writes(items) - val in1 = JsonSupport.reads[Set[Parameter[_]]](js3) + val in1 = JsonSupport.reads[Set[Parameter[?]]](js3) assert(in1 == items) } } diff --git a/csw-params/jvm/src/test/scala/csw/params/core/generics/BinaryImageByteArrayTest.scala b/csw-params/jvm/src/test/scala/csw/params/core/generics/BinaryImageByteArrayTest.scala index 2582319fce..9770002ba7 100644 --- a/csw-params/jvm/src/test/scala/csw/params/core/generics/BinaryImageByteArrayTest.scala +++ b/csw-params/jvm/src/test/scala/csw/params/core/generics/BinaryImageByteArrayTest.scala @@ -27,7 +27,7 @@ class BinaryImageByteArrayTest extends AnyFunSpec with Matchers { val imgBytes = Files.readAllBytes(imgPath) val binaryImgData: ArrayData[Byte] = ArrayData.fromArray(imgBytes) - val binaryParam: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData withUnits encoder + val binaryParam: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData `withUnits` encoder binaryParam.head shouldBe binaryImgData binaryParam.value(0) shouldBe binaryImgData diff --git a/csw-params/shared/src/main/scala/csw/params/commands/Result.scala b/csw-params/shared/src/main/scala/csw/params/commands/Result.scala index bf81fabcda..a3c5c607f7 100644 --- a/csw-params/shared/src/main/scala/csw/params/commands/Result.scala +++ b/csw-params/shared/src/main/scala/csw/params/commands/Result.scala @@ -10,7 +10,7 @@ import csw.params.core.generics.{Parameter, ParameterSetType} /** * A result containing parameters for command response */ -case class Result private[params] (paramSet: Set[Parameter[_]]) extends ParameterSetType[Result] { +case class Result private[params] (paramSet: Set[Parameter[?]]) extends ParameterSetType[Result] { def nonEmpty: Boolean = paramSet.nonEmpty @@ -20,7 +20,7 @@ case class Result private[params] (paramSet: Set[Parameter[_]]) extends Paramete * @param data set of parameters * @return a new instance of Result with provided data */ - override protected def create(data: Set[Parameter[_]]): Result = copy(paramSet = data) + override protected def create(data: Set[Parameter[?]]): Result = copy(paramSet = data) /** * A java helper to construct Result @@ -43,7 +43,7 @@ object Result { * @param paramSet a Set of parameters (keys with values) * @return a Result instance with provided paramSet */ - def apply(paramSet: Set[Parameter[_]]): Result = emptyResult.madd(paramSet) + def apply(paramSet: Set[Parameter[?]]): Result = emptyResult.madd(paramSet) /** * A helper method to create Result instance @@ -51,5 +51,5 @@ object Result { * @param params an optional list of parameters (keys with values) * @return a Result instance with provided paramSet */ - def apply(params: Parameter[_]*): Result = Result(params.toSet) + def apply(params: Parameter[?]*): Result = Result(params.toSet) } diff --git a/csw-params/shared/src/main/scala/csw/params/commands/commands.scala b/csw-params/shared/src/main/scala/csw/params/commands/commands.scala index 72948844dc..db207d7643 100644 --- a/csw-params/shared/src/main/scala/csw/params/commands/commands.scala +++ b/csw-params/shared/src/main/scala/csw/params/commands/commands.scala @@ -22,7 +22,7 @@ sealed trait Command extends ParameterSetType[Command] { * * @return a handle to ParameterSetType extended by concrete implementation of this class */ - def paramType: ParameterSetType[_] = this + def paramType: ParameterSetType[?] = this /** * A name identifying the type of parameter set, such as "setup", "observe". @@ -35,7 +35,7 @@ sealed trait Command extends ParameterSetType[Command] { /** * An optional initial set of parameters (keys with values) */ - val paramSet: Set[Parameter[_]] + val paramSet: Set[Parameter[?]] /** * Prefix representing source of the command @@ -85,7 +85,7 @@ case class Setup private[params] ( source: Prefix, commandName: CommandName, maybeObsId: Option[ObsId] = None, - paramSet: Set[Parameter[_]] + paramSet: Set[Parameter[?]] ) extends ParameterSetType[Setup] with ControlCommand { @@ -101,7 +101,7 @@ case class Setup private[params] ( * @param data set of parameters * @return a new instance of Setup with provided data */ - override protected def create(data: Set[Parameter[_]]): Setup = copy(paramSet = data) + override protected def create(data: Set[Parameter[?]]): Setup = copy(paramSet = data) } object Setup { @@ -126,7 +126,7 @@ object Setup { * @param paramSet an initial set of parameters (keys with values) * @return a new instance of Setup */ - def apply(source: Prefix, commandName: CommandName, maybeObsId: Option[ObsId], paramSet: Set[Parameter[_]]): Setup = + def apply(source: Prefix, commandName: CommandName, maybeObsId: Option[ObsId], paramSet: Set[Parameter[?]]): Setup = apply(source, commandName, maybeObsId).madd(paramSet) } @@ -137,7 +137,7 @@ case class Observe private[params] ( source: Prefix, commandName: CommandName, maybeObsId: Option[ObsId] = None, - paramSet: Set[Parameter[_]] + paramSet: Set[Parameter[?]] ) extends ParameterSetType[Observe] with ControlCommand { @@ -153,7 +153,7 @@ case class Observe private[params] ( * @param data set of parameters * @return a new instance of Observe with new provided data */ - override protected def create(data: Set[Parameter[_]]): Observe = copy(paramSet = data) + override protected def create(data: Set[Parameter[?]]): Observe = copy(paramSet = data) } object Observe { @@ -178,7 +178,7 @@ object Observe { * @param paramSet an initial set of parameters (keys with values) * @return a new instance of Observe */ - def apply(source: Prefix, commandName: CommandName, maybeObsId: Option[ObsId], paramSet: Set[Parameter[_]]): Observe = + def apply(source: Prefix, commandName: CommandName, maybeObsId: Option[ObsId], paramSet: Set[Parameter[?]]): Observe = apply(source, commandName, maybeObsId).madd(paramSet) } @@ -189,7 +189,7 @@ case class Wait private[params] ( source: Prefix, commandName: CommandName, maybeObsId: Option[ObsId] = None, - paramSet: Set[Parameter[_]] + paramSet: Set[Parameter[?]] ) extends ParameterSetType[Wait] with SequenceCommand { @@ -205,7 +205,7 @@ case class Wait private[params] ( * @param data set of parameters * @return a new instance of Wait with new provided data */ - override protected def create(data: Set[Parameter[_]]): Wait = copy(paramSet = data) + override protected def create(data: Set[Parameter[?]]): Wait = copy(paramSet = data) } object Wait { @@ -230,6 +230,6 @@ object Wait { * @param paramSet an initial set of parameters (keys with values) * @return a new instance of Wait */ - def apply(source: Prefix, commandName: CommandName, maybeObsId: Option[ObsId], paramSet: Set[Parameter[_]]): Wait = + def apply(source: Prefix, commandName: CommandName, maybeObsId: Option[ObsId], paramSet: Set[Parameter[?]]): Wait = new Wait(source, commandName, maybeObsId, Set.empty).madd(paramSet) } diff --git a/csw-params/shared/src/main/scala/csw/params/core/formats/ParamCodecs.scala b/csw-params/shared/src/main/scala/csw/params/core/formats/ParamCodecs.scala index bc0d3471fb..3d2b082c5f 100644 --- a/csw-params/shared/src/main/scala/csw/params/core/formats/ParamCodecs.scala +++ b/csw-params/shared/src/main/scala/csw/params/core/formats/ParamCodecs.scala @@ -97,12 +97,12 @@ trait ParamCodecsBase extends CommonCodecs { implicit def paramCodec[T: ArrayEnc: ArrayDec]: Codec[Parameter[T]] = Codec.bimap[Map[String, ParamCore[T]], Parameter[T]](ParamCore.fromParam, ParamCore.toParam) - implicit lazy val paramEncExistential: Encoder[Parameter[_]] = { (w: Writer, value: Parameter[_]) => + implicit lazy val paramEncExistential: Encoder[Parameter[?]] = { (w: Writer, value: Parameter[?]) => val encoder: Encoder[Parameter[Any]] = value.keyType.paramEncoder.asInstanceOf[Encoder[Parameter[Any]]] encoder.write(w, value.asInstanceOf[Parameter[Any]]) } - implicit lazy val paramDecExistential: Decoder[Parameter[_]] = { (r: Reader) => + implicit lazy val paramDecExistential: Decoder[Parameter[?]] = { (r: Reader) => r.tryReadMapHeader(1) || r.tryReadMapStart() || r.tryReadArrayHeader(1) || r.tryReadArrayStart() val keyTypeName = r.readString() val keyType = KeyType.withNameInsensitive(keyTypeName) diff --git a/csw-params/shared/src/main/scala/csw/params/core/generics/GChoiceKey.scala b/csw-params/shared/src/main/scala/csw/params/core/generics/GChoiceKey.scala index 0925ed77da..419209e78f 100644 --- a/csw-params/shared/src/main/scala/csw/params/core/generics/GChoiceKey.scala +++ b/csw-params/shared/src/main/scala/csw/params/core/generics/GChoiceKey.scala @@ -33,6 +33,6 @@ class GChoiceKey(name: String, keyType: KeyType[Choice], units: Units, val choic */ override def set(value: Choice, values: Choice*): Parameter[Choice] = { validate(value +: values.toList) - super.set(value, values: _*) + super.set(value, values*) } } diff --git a/csw-params/shared/src/main/scala/csw/params/core/generics/KeyType.scala b/csw-params/shared/src/main/scala/csw/params/core/generics/KeyType.scala index 174d621784..f4abbbf165 100644 --- a/csw-params/shared/src/main/scala/csw/params/core/generics/KeyType.scala +++ b/csw-params/shared/src/main/scala/csw/params/core/generics/KeyType.scala @@ -86,12 +86,12 @@ class MatrixKeyType[S: ClassTag: ArrayEnc: ArrayDec] extends SimpleKeyType[Matri /** * KeyTypes defined for consumption in Scala code */ -object KeyType extends Enum[KeyType[_]] { +object KeyType extends Enum[KeyType[?]] { /** * values return a Seq of all KeyTypes provided by `csw-messages` */ - override def values: IndexedSeq[KeyType[_]] = findValues + override def values: IndexedSeq[KeyType[?]] = findValues sealed class SKT[S: ClassTag: ArrayEnc: ArrayDec] extends SimpleKeyType[S] with KeyType[S] sealed class SKTWU[S: ClassTag: ArrayEnc: ArrayDec](value: Units) extends SimpleKeyTypeWithUnits[S](value) with KeyType[S] @@ -106,7 +106,7 @@ object KeyType extends Enum[KeyType[_]] { new GChoiceKey(name, this, units, Choices(restChoices.toSet + firstChoice)) def make(name: String, firstChoice: Choice, restChoices: Choice*): GChoiceKey = - make(name, NoUnits, firstChoice, restChoices: _*) + make(name, NoUnits, firstChoice, restChoices*) } case object StringKey extends SKT[String] diff --git a/csw-params/shared/src/main/scala/csw/params/core/generics/ParameterSetType.scala b/csw-params/shared/src/main/scala/csw/params/core/generics/ParameterSetType.scala index bbfb99758e..3725a4e3e6 100644 --- a/csw-params/shared/src/main/scala/csw/params/core/generics/ParameterSetType.scala +++ b/csw-params/shared/src/main/scala/csw/params/core/generics/ParameterSetType.scala @@ -28,12 +28,12 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => /** * Holds the parameters for this parameter set */ - def paramSet: Set[Parameter[_]] + def paramSet: Set[Parameter[?]] /** * A Java helper to get parameters for this parameter set */ - def jParamSet: util.Set[Parameter[_]] = paramSet.asJava + def jParamSet: util.Set[Parameter[?]] = paramSet.asJava /** * The number of parameters in this parameter set @@ -49,9 +49,9 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => * @tparam P the Parameter type * @return a new instance of this parameter set with the given parameter added */ - def add[P <: Parameter[_]](parameter: P): T = doAdd(this, parameter) + def add[P <: Parameter[?]](parameter: P): T = doAdd(this, parameter) - private def doAdd[P <: Parameter[_]](c: T, parameter: P): T = create(removeByKeyname(c, parameter.keyName).paramSet + parameter) + private def doAdd[P <: Parameter[?]](c: T, parameter: P): T = create(removeByKeyname(c, parameter.keyName).paramSet + parameter) /** * Adds several parameters to the parameter set @@ -62,8 +62,8 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => * @return a new instance of this parameter set with the given parameter added */ @varargs - def madd[P <: Parameter[_]](parametersToAdd: P*): T = madd(parametersToAdd.toSet) - def jMadd[P <: Parameter[_]](parametersToAdd: java.util.Set[P]): T = madd(parametersToAdd.asScala.toSet) + def madd[P <: Parameter[?]](parametersToAdd: P*): T = madd(parametersToAdd.toSet) + def jMadd[P <: Parameter[?]](parametersToAdd: java.util.Set[P]): T = madd(parametersToAdd.asScala.toSet) /** * Adds several parameters to the parameter set @@ -73,7 +73,7 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => * @tparam P must be a subclass of Parameter * @return a new instance of this parameter set with the given parameter added */ - def madd[P <: Parameter[_]](parametersToAdd: Set[P]): T = parametersToAdd.foldLeft(this)((c, parameter) => doAdd(c, parameter)) + def madd[P <: Parameter[?]](parametersToAdd: Set[P]): T = parametersToAdd.foldLeft(this)((c, parameter) => doAdd(c, parameter)) /** * Returns an Option with the parameter for the key if found, otherwise None @@ -179,7 +179,7 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => * @tparam P the type of the parameter to be removed * @return a new T, where T is a parameter set child with the parameter removed or identical if the parameter is not present */ - def remove[P <: Parameter[_]](parameter: P): T = removeByParameter(this, parameter) + def remove[P <: Parameter[?]](parameter: P): T = removeByParameter(this, parameter) /** * Function removes a parameter from the parameter set c based on keyname @@ -189,7 +189,7 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => * @tparam P the Parameter type * @return a new T, where T is a parameter set child with the parameter removed or identical if the parameter is not present */ - private def removeByKeyname[P <: Parameter[_]](c: ParameterSetType[T], keyname: String): T = { + private def removeByKeyname[P <: Parameter[?]](c: ParameterSetType[T], keyname: String): T = { val f: Option[P] = getByKeyname(c.paramSet, keyname) f match { case Some(parameter) => create(c.paramSet - parameter) @@ -205,7 +205,7 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => * @tparam P the Parameter type * @return a new T, where T is a parameter set child with the parameter removed or identical if the parameter is not presen */ - private def removeByParameter[P <: Parameter[_]](c: ParameterSetType[T], parameterIn: P): T = { + private def removeByParameter[P <: Parameter[?]](c: ParameterSetType[T], parameterIn: P): T = { val f: Option[P] = getByParameter(c.paramSet, parameterIn) f match { case Some(parameter) => create(c.paramSet.-(parameter)) @@ -214,11 +214,11 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => } // Function to find a parameter by keyname - private def getByKeyname[P](parametersIn: Set[Parameter[_]], keyname: String): Option[P] = + private def getByKeyname[P](parametersIn: Set[Parameter[?]], keyname: String): Option[P] = parametersIn.find(_.keyName == keyname).asInstanceOf[Option[P]] // Function to find a given parameter in the parameter set - private def getByParameter[P](parametersIn: Set[Parameter[_]], parameter: Parameter[_]): Option[P] = + private def getByParameter[P](parametersIn: Set[Parameter[?]], parameter: Parameter[?]): Option[P] = parametersIn.find(_.equals(parameter)).asInstanceOf[Option[P]] /** @@ -228,7 +228,7 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => * @param data a new set of Parameters after addition or deletion * @return a concrete implementation of type T */ - protected def create(data: Set[Parameter[_]]): T + protected def create(data: Set[Parameter[?]]): T /** * A comma separated string representation of parameters @@ -243,7 +243,7 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => /** * Returns true if the data contains the given key */ - def contains(key: Key[_]): Boolean = paramSet.exists(_.keyName == key.keyName) + def contains(key: Key[?]): Boolean = paramSet.exists(_.keyName == key.keyName) /** * Returns a set containing the names of any of the given keys that are missing in the data @@ -251,7 +251,7 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => * @param keys one or more keys * @return a Set of key names */ - def missingKeys(keys: Key[_]*): Set[String] = { + def missingKeys(keys: Key[?]*): Set[String] = { val argKeySet = keys.map(_.keyName).toSet val parametersKeySet = paramSet.map(_.keyName) argKeySet.diff(parametersKeySet) @@ -263,7 +263,7 @@ abstract class ParameterSetType[+T <: ParameterSetType[T]] { self: T => * @param keys one or more keys */ @varargs - def jMissingKeys(keys: Key[_]*): java.util.Set[String] = missingKeys(keys: _*).asJava + def jMissingKeys(keys: Key[?]*): java.util.Set[String] = missingKeys(keys*).asJava /** * Returns a map based on this object where the keys and values are in string get diff --git a/csw-params/shared/src/main/scala/csw/params/core/models/choices.scala b/csw-params/shared/src/main/scala/csw/params/core/models/choices.scala index 74f7687a12..c1514cce8b 100644 --- a/csw-params/shared/src/main/scala/csw/params/core/models/choices.scala +++ b/csw-params/shared/src/main/scala/csw/params/core/models/choices.scala @@ -76,7 +76,7 @@ object Choices { */ @varargs def from(choices: String*): Choices = Choices(choices.map(Choice(_)).toSet) - def from(choices: java.util.Set[String]): Choices = from(choices.asScala.toSeq: _*) + def from(choices: java.util.Set[String]): Choices = from(choices.asScala.toSeq*) /** * Creates Choices from provided values @@ -86,5 +86,5 @@ object Choices { */ @varargs def fromChoices(choices: Choice*): Choices = Choices(choices.toSet) - def fromChoices(choices: java.util.Set[Choice]): Choices = fromChoices(choices.asScala.toSeq: _*) + def fromChoices(choices: java.util.Set[Choice]): Choices = fromChoices(choices.asScala.toSeq*) } diff --git a/csw-params/shared/src/main/scala/csw/params/core/states/StateVariable.scala b/csw-params/shared/src/main/scala/csw/params/core/states/StateVariable.scala index 16efb2151f..3cd2159553 100644 --- a/csw-params/shared/src/main/scala/csw/params/core/states/StateVariable.scala +++ b/csw-params/shared/src/main/scala/csw/params/core/states/StateVariable.scala @@ -26,7 +26,7 @@ sealed trait StateVariable extends CommandSerializable { /** * an optional initial set of items (keys with values) */ - val paramSet: Set[Parameter[_]] + val paramSet: Set[Parameter[?]] /** * identifies the name of the state @@ -90,7 +90,7 @@ object StateVariable { * @param stateName identifies the name of the state * @param paramSet initial set of items (keys with values) */ -case class DemandState(prefix: Prefix, stateName: StateName, paramSet: Set[Parameter[_]]) +case class DemandState(prefix: Prefix, stateName: StateName, paramSet: Set[Parameter[?]]) extends ParameterSetType[DemandState] with ParameterSetKeyData with StateVariable { @@ -98,7 +98,7 @@ case class DemandState(prefix: Prefix, stateName: StateName, paramSet: Set[Param /** * A Java helper method to construct with String */ - def this(prefix: Prefix, stateName: StateName) = this(prefix, stateName, Set.empty[Parameter[_]]) + def this(prefix: Prefix, stateName: StateName) = this(prefix, stateName, Set.empty[Parameter[?]]) /** * A Java helper method to create a DemandState from a Setup @@ -111,7 +111,7 @@ case class DemandState(prefix: Prefix, stateName: StateName, paramSet: Set[Param * @param data set of parameters * @return a new instance of DemandState with provided data */ - override protected def create(data: Set[Parameter[_]]): DemandState = copy(paramSet = data) + override protected def create(data: Set[Parameter[?]]): DemandState = copy(paramSet = data) } object DemandState { @@ -124,7 +124,7 @@ object DemandState { * @param paramSet an optional initial set of items (keys with values) * @return an instance of DemandState */ - def apply(prefix: Prefix, stateName: StateName, paramSet: Set[Parameter[_]] = Set.empty[Parameter[_]]): DemandState = + def apply(prefix: Prefix, stateName: StateName, paramSet: Set[Parameter[?]] = Set.empty[Parameter[?]]): DemandState = new DemandState(prefix, stateName).madd(paramSet) } @@ -138,7 +138,7 @@ object DemandState { case class CurrentState( prefix: Prefix, stateName: StateName, - paramSet: Set[Parameter[_]] + paramSet: Set[Parameter[?]] ) extends ParameterSetType[CurrentState] with ParameterSetKeyData with StateVariable { @@ -146,7 +146,7 @@ case class CurrentState( /** * A Java helper method to construct with String */ - def this(prefix: Prefix, currentStateName: StateName) = this(prefix, currentStateName, Set.empty[Parameter[_]]) + def this(prefix: Prefix, currentStateName: StateName) = this(prefix, currentStateName, Set.empty[Parameter[?]]) /** * A Java helper method to create a CurrentState from a Setup @@ -159,7 +159,7 @@ case class CurrentState( * @param data set of parameters * @return a new instance of CurrentState with provided data */ - override protected def create(data: Set[Parameter[_]]): CurrentState = copy(paramSet = data) + override protected def create(data: Set[Parameter[?]]): CurrentState = copy(paramSet = data) } object CurrentState { @@ -175,7 +175,7 @@ object CurrentState { def apply( prefix: Prefix, stateName: StateName, - paramSet: Set[Parameter[_]] = Set.empty[Parameter[_]] + paramSet: Set[Parameter[?]] = Set.empty[Parameter[?]] ): CurrentState = new CurrentState(prefix, stateName).madd(paramSet) implicit object NameableCurrentState extends Nameable[CurrentState] { diff --git a/csw-params/shared/src/main/scala/csw/params/events/DetectorEvent.scala b/csw-params/shared/src/main/scala/csw/params/events/DetectorEvent.scala index 7d13af7469..df9846a913 100644 --- a/csw-params/shared/src/main/scala/csw/params/events/DetectorEvent.scala +++ b/csw-params/shared/src/main/scala/csw/params/events/DetectorEvent.scala @@ -160,7 +160,7 @@ private[events] class DetectorEvent(detectorExpStateName: EventName) { errorMessage: String, operationalState: OperationalState ): ObserveEvent = { - val params: Set[Parameter[_]] = Set( + val params: Set[Parameter[?]] = Set( ParamFactories.exposureIdParam(exposureId), ParamFactories.operationalStateParam(operationalState), ParamFactories.errorMessageParam(errorMessage), diff --git a/csw-params/shared/src/main/scala/csw/params/events/IRDetectorEvent.scala b/csw-params/shared/src/main/scala/csw/params/events/IRDetectorEvent.scala index c03178f4f8..9e5699ce4e 100644 --- a/csw-params/shared/src/main/scala/csw/params/events/IRDetectorEvent.scala +++ b/csw-params/shared/src/main/scala/csw/params/events/IRDetectorEvent.scala @@ -42,7 +42,7 @@ object IRDetectorEvent extends DetectorEvent(ObserveEventNames.IRDetectorExposur exposureTime: Long, remainingExposureTime: Long ): ObserveEvent = { - val params: Set[Parameter[_]] = Set( + val params: Set[Parameter[?]] = Set( ParamFactories.exposureIdParam(exposureId), ParamFactories.readsInRampParam(readsInRamp), ParamFactories.readsCompleteParam(readsComplete), diff --git a/csw-params/shared/src/main/scala/csw/params/events/OpticalDetectorEvent.scala b/csw-params/shared/src/main/scala/csw/params/events/OpticalDetectorEvent.scala index 8937d93070..679a6976c2 100644 --- a/csw-params/shared/src/main/scala/csw/params/events/OpticalDetectorEvent.scala +++ b/csw-params/shared/src/main/scala/csw/params/events/OpticalDetectorEvent.scala @@ -39,7 +39,7 @@ object OpticalDetectorEvent extends DetectorEvent(ObserveEventNames.OpticalDetec exposureTime: Long, remainingExposureTime: Long ): ObserveEvent = { - val params: Set[Parameter[_]] = Set( + val params: Set[Parameter[?]] = Set( ParamFactories.exposureIdParam(exposureId), ParamFactories.exposureTimeParam(exposureTime), ParamFactories.remainingExposureTimeParam(remainingExposureTime), diff --git a/csw-params/shared/src/main/scala/csw/params/events/WFSDetectorEvent.scala b/csw-params/shared/src/main/scala/csw/params/events/WFSDetectorEvent.scala index bcd2fda288..105b1ed2b9 100644 --- a/csw-params/shared/src/main/scala/csw/params/events/WFSDetectorEvent.scala +++ b/csw-params/shared/src/main/scala/csw/params/events/WFSDetectorEvent.scala @@ -57,7 +57,7 @@ object WFSDetectorEvent { operationalState: OperationalState, errorMessage: String ): ObserveEvent = { - val params: Set[Parameter[_]] = Set( + val params: Set[Parameter[?]] = Set( ParamFactories.exposureIdParam(exposureId), ParamFactories.operationalStateParam(operationalState), ParamFactories.errorMessageParam(errorMessage), diff --git a/csw-params/shared/src/main/scala/csw/params/events/events.scala b/csw-params/shared/src/main/scala/csw/params/events/events.scala index e24bbe7a06..111aac9263 100644 --- a/csw-params/shared/src/main/scala/csw/params/events/events.scala +++ b/csw-params/shared/src/main/scala/csw/params/events/events.scala @@ -22,7 +22,7 @@ sealed trait Event extends ParameterSetType[Event] { * * @return a handle to ParameterSetType extended by concrete implementation of this class */ - def paramType: ParameterSetType[_] = this + def paramType: ParameterSetType[?] = this /** * unique Id for event @@ -47,7 +47,7 @@ sealed trait Event extends ParameterSetType[Event] { /** * An optional initial set of parameters (keys with values) */ - val paramSet: Set[Parameter[_]] + val paramSet: Set[Parameter[?]] /** * A name identifying the type of parameter set, such as "SystemEvent", "ObserveEvent". @@ -106,7 +106,7 @@ case class SystemEvent private[csw] ( source: Prefix, eventName: EventName, eventTime: UTCTime, - paramSet: Set[Parameter[_]] + paramSet: Set[Parameter[?]] ) extends ParameterSetType[SystemEvent] with Event { @@ -121,7 +121,7 @@ case class SystemEvent private[csw] ( * @param data set of parameters * @return a new instance of SystemEvent with new eventId, eventTime and provided data */ - override protected def create(data: Set[Parameter[_]]): SystemEvent = + override protected def create(data: Set[Parameter[?]]): SystemEvent = copy(eventId = Id(), eventTime = UTCTime.now(), paramSet = data) } @@ -145,7 +145,7 @@ object SystemEvent { * @param paramSet an initial set of parameters (keys with values) * @return a new instance of SystemEvent with auto-generated eventId and eventTime */ - def apply(source: Prefix, eventName: EventName, paramSet: Set[Parameter[_]]): SystemEvent = + def apply(source: Prefix, eventName: EventName, paramSet: Set[Parameter[?]]): SystemEvent = apply(source, eventName).madd(paramSet) } @@ -157,7 +157,7 @@ case class ObserveEvent private[csw] ( source: Prefix, eventName: EventName, eventTime: UTCTime, - paramSet: Set[Parameter[_]] + paramSet: Set[Parameter[?]] ) extends ParameterSetType[ObserveEvent] with Event { @@ -167,7 +167,7 @@ case class ObserveEvent private[csw] ( * @param data set of parameters * @return a new instance of ObserveEvent with new eventId, eventTime and provided data */ - override protected def create(data: Set[Parameter[_]]): ObserveEvent = + override protected def create(data: Set[Parameter[?]]): ObserveEvent = copy(eventId = Id(), eventTime = UTCTime.now(), paramSet = data) } @@ -191,6 +191,6 @@ private[csw] object ObserveEvent { * @param paramSet an initial set of parameters (keys with values) * @return a new instance of ObserveEvent with auto-generated eventId and eventTime */ - def apply(source: Prefix, eventName: EventName, paramSet: Set[Parameter[_]]): ObserveEvent = + def apply(source: Prefix, eventName: EventName, paramSet: Set[Parameter[?]]): ObserveEvent = apply(source, eventName).madd(paramSet) } diff --git a/csw-params/shared/src/test/scala/csw/params/events/SequencerObserveEventTest.scala b/csw-params/shared/src/test/scala/csw/params/events/SequencerObserveEventTest.scala index 199093e1e8..db781948b1 100644 --- a/csw-params/shared/src/test/scala/csw/params/events/SequencerObserveEventTest.scala +++ b/csw-params/shared/src/test/scala/csw/params/events/SequencerObserveEventTest.scala @@ -19,8 +19,8 @@ class SequencerObserveEventTest extends AnyFunSpec with Matchers { val obsId = "2020A-001-123" val exposureId = ExposureId("2020A-001-123-TCS-DET-SCI0-0001") val prefix = Prefix(ESW, "filter.wheel") - val obsIdParam: Parameter[_] = ObserveEventKeys.obsId.set(obsId) - val exposureIdParam: Parameter[_] = ObserveEventKeys.exposureId.set(exposureId.toString) + val obsIdParam: Parameter[?] = ObserveEventKeys.obsId.set(obsId) + val exposureIdParam: Parameter[?] = ObserveEventKeys.exposureId.set(exposureId.toString) val sequencerObserveEvent = SequencerObserveEvent(prefix) val filename = "some/nested/folder/file123.conf" diff --git a/csw-params/shared/src/test/scala/csw/params/testdata/ParamSetData.scala b/csw-params/shared/src/test/scala/csw/params/testdata/ParamSetData.scala index 5ccf28c6a2..269b9cadaf 100644 --- a/csw-params/shared/src/test/scala/csw/params/testdata/ParamSetData.scala +++ b/csw-params/shared/src/test/scala/csw/params/testdata/ParamSetData.scala @@ -65,7 +65,7 @@ object ParamSetData { private val altAzCoord = AltAzCoord(Tag("BASE"), 301.degree, 42.5.degree) private val p27 = CoordKey.make("CoordKey").set(eqCoord, solarSystemCoord, minorPlanetCoord, cometCoord, altAzCoord) - val paramSet: Set[Parameter[_]] = + val paramSet: Set[Parameter[?]] = Set( p1, p2, diff --git a/csw-services/src/main/scala/csw/services/AuthServer.scala b/csw-services/src/main/scala/csw/services/AuthServer.scala index ffb0528d21..6bb8deaa72 100644 --- a/csw-services/src/main/scala/csw/services/AuthServer.scala +++ b/csw-services/src/main/scala/csw/services/AuthServer.scala @@ -37,48 +37,72 @@ class AuthServer(locationService: LocationService, settings: Settings)(implicit private val configUser: ApplicationUser = ApplicationUser( "config-user1", - "config-user1" + "config-user1", + firstName = "config", + lastName = "user1", + email = "config-user1@tmt.org" ) private val eswUser1: ApplicationUser = ApplicationUser( "esw-user1", "esw-user1", + firstName = "esw", + lastName = "user1", + email = "esw-user1@tmt.org", realmRoles = Set("esw-user", configAdminRole) ) private val oswUser1: ApplicationUser = ApplicationUser( username = "osw-user1", password = "osw-user1", + firstName = "osw", + lastName = "user1", + email = "osw-user1@tmt.org", realmRoles = oswUserRoles ) private val irisUser1: ApplicationUser = ApplicationUser( "iris-user1", "iris-user1", + firstName = "iris", + lastName = "user1", + email = "iris-user1@tmt.org", realmRoles = Set("iris-user") ) private val tcsUser1: ApplicationUser = ApplicationUser( "tcs-user1", "tcs-user1", + firstName = "tcs", + lastName = "user1", + email = "tcs-user1@tmt.org", realmRoles = Set("tcs-user") ) private val wfosUser1: ApplicationUser = ApplicationUser( "wfos-user1", "wfos-user1", + firstName = "wfos", + lastName = "user1", + email = "wfos-user1@tmt.org", realmRoles = Set("wfos-user") ) private val applicationUser: ApplicationUser = ApplicationUser( "dummy-user", "dummy-user", + firstName = "dummy", + lastName = "user", + email = "dummy-user@tmt.org", realmRoles = Set(personRole, exampleAdminRole) ) private val configAdminUser: ApplicationUser = ApplicationUser( configAdminUsername, configAdminPassword, + firstName = configAdminUsername, + lastName = configAdminUsername, + email = s"$configAdminUsername@tmt.org", realmRoles = Set(configAdminRole) ) diff --git a/csw-services/src/main/scala/csw/services/Main.scala b/csw-services/src/main/scala/csw/services/Main.scala index 072960b0c2..4cd70bb2c3 100644 --- a/csw-services/src/main/scala/csw/services/Main.scala +++ b/csw-services/src/main/scala/csw/services/Main.scala @@ -42,5 +42,5 @@ object Main extends CommandsEntryPoint { } } - override def commands: Seq[Command[_]] = List(StartCommand) + override def commands: Seq[Command[?]] = List(StartCommand) } diff --git a/csw-testkit/src/main/scala/csw/testkit/FrameworkTestKit.scala b/csw-testkit/src/main/scala/csw/testkit/FrameworkTestKit.scala index 236e01e318..f116a1a078 100644 --- a/csw-testkit/src/main/scala/csw/testkit/FrameworkTestKit.scala +++ b/csw-testkit/src/main/scala/csw/testkit/FrameworkTestKit.scala @@ -71,7 +71,7 @@ final class FrameworkTestKit private ( lazy val timeout: Timeout = locationTestKit.timeout - private var locationTestkitWithAuth: LocationTestKit = _ + private var locationTestkitWithAuth: LocationTestKit = scala.compiletime.uninitialized private var configStarted = false private var eventStarted = false diff --git a/csw-testkit/src/main/scala/csw/testkit/TestKitSettings.scala b/csw-testkit/src/main/scala/csw/testkit/TestKitSettings.scala index 6cf9f6b63f..10ff4e2388 100644 --- a/csw-testkit/src/main/scala/csw/testkit/TestKitSettings.scala +++ b/csw-testkit/src/main/scala/csw/testkit/TestKitSettings.scala @@ -16,7 +16,7 @@ object TestKitSettings { /** * Reads configuration settings from `csw.testkit` section. */ - def apply(system: ActorSystem[_]): TestKitSettings = apply(system.settings.config) + def apply(system: ActorSystem[?]): TestKitSettings = apply(system.settings.config) /** * Reads configuration settings from given `Config` that @@ -27,7 +27,7 @@ object TestKitSettings { /** * Java API: Reads configuration settings from ``csw.testkit`` section. */ - def create(system: ActorSystem[_]): TestKitSettings = apply(system) + def create(system: ActorSystem[?]): TestKitSettings = apply(system) /** * Reads configuration settings from given `Config` that diff --git a/csw-testkit/src/main/scala/csw/testkit/javadsl/FrameworkTestKitJunitResource.scala b/csw-testkit/src/main/scala/csw/testkit/javadsl/FrameworkTestKitJunitResource.scala index cc186a86ee..210e7bfe6c 100644 --- a/csw-testkit/src/main/scala/csw/testkit/javadsl/FrameworkTestKitJunitResource.scala +++ b/csw-testkit/src/main/scala/csw/testkit/javadsl/FrameworkTestKitJunitResource.scala @@ -79,7 +79,7 @@ final class FrameworkTestKitJunitResource(val frameworkTestKit: FrameworkTestKit def spawnStandalone(config: Config): ActorRef[ComponentMessage] = frameworkTestKit.spawnStandalone(config) /** Start FrameworkTestKit */ - override def before(): Unit = frameworkTestKit.start(services.asScala.toList: _*) + override def before(): Unit = frameworkTestKit.start(services.asScala.toList*) /** Shuts down the FrameworkTestKit */ override def after(): Unit = frameworkTestKit.shutdown() diff --git a/csw-testkit/src/main/scala/csw/testkit/redis/RedisStore.scala b/csw-testkit/src/main/scala/csw/testkit/redis/RedisStore.scala index 48445259b4..850a781a2c 100644 --- a/csw-testkit/src/main/scala/csw/testkit/redis/RedisStore.scala +++ b/csw-testkit/src/main/scala/csw/testkit/redis/RedisStore.scala @@ -21,7 +21,7 @@ import scala.concurrent.ExecutionContext private[testkit] trait RedisStore extends EmbeddedRedis { - implicit def system: typed.ActorSystem[_] + implicit def system: typed.ActorSystem[?] implicit def timeout: Timeout protected def masterId: String protected def connection: TcpConnection diff --git a/examples/src/main/scala/example/alarm/AlarmServiceClientExampleApp.scala b/examples/src/main/scala/example/alarm/AlarmServiceClientExampleApp.scala index 5c80dadfb4..82a2540086 100644 --- a/examples/src/main/scala/example/alarm/AlarmServiceClientExampleApp.scala +++ b/examples/src/main/scala/example/alarm/AlarmServiceClientExampleApp.scala @@ -24,7 +24,7 @@ import scala.util.{Failure, Success} object AlarmServiceClientExampleApp { - implicit val actorSystem: ActorSystem[_] = typed.ActorSystem(Behaviors.empty, "") + implicit val actorSystem: ActorSystem[?] = typed.ActorSystem(Behaviors.empty, "") implicit val ec: ExecutionContext = actorSystem.executionContext private val locationService = HttpLocationServiceFactory.makeLocalClient diff --git a/examples/src/main/scala/example/auth/installed/AdapterFactory.scala b/examples/src/main/scala/example/auth/installed/AdapterFactory.scala index 1816f26913..5cb6a99f27 100644 --- a/examples/src/main/scala/example/auth/installed/AdapterFactory.scala +++ b/examples/src/main/scala/example/auth/installed/AdapterFactory.scala @@ -18,7 +18,7 @@ import scala.concurrent.ExecutionContextExecutor // #adapter-factory object AdapterFactory { - def makeAdapter(implicit actorSystem: typed.ActorSystem[_]): InstalledAppAuthAdapter = { + def makeAdapter(implicit actorSystem: typed.ActorSystem[?]): InstalledAppAuthAdapter = { implicit val ec: ExecutionContextExecutor = actorSystem.executionContext val locationService: LocationService = HttpLocationServiceFactory.makeLocalClient(actorSystem) val authStore = new FileAuthStore(Paths.get("/tmp/demo-cli/auth")) diff --git a/examples/src/main/scala/example/auth/installed/Main.scala b/examples/src/main/scala/example/auth/installed/Main.scala index 897721b348..f05a92ffe3 100644 --- a/examples/src/main/scala/example/auth/installed/Main.scala +++ b/examples/src/main/scala/example/auth/installed/Main.scala @@ -18,7 +18,7 @@ object Main { LocationServerStatus.requireUpLocally() - implicit val actorSystem: ActorSystem[_] = ActorSystem(Behaviors.empty, "example-system") + implicit val actorSystem: ActorSystem[?] = ActorSystem(Behaviors.empty, "example-system") val adapter: InstalledAppAuthAdapter = AdapterFactory.makeAdapter diff --git a/examples/src/main/scala/example/auth/installed/SampleRoutes.scala b/examples/src/main/scala/example/auth/installed/SampleRoutes.scala index 160d601b28..366bb62a56 100644 --- a/examples/src/main/scala/example/auth/installed/SampleRoutes.scala +++ b/examples/src/main/scala/example/auth/installed/SampleRoutes.scala @@ -22,7 +22,7 @@ import spray.json._ import scala.concurrent.ExecutionContext -class SampleRoutes(securityDirectives: SecurityDirectives)(implicit actorSystem: ActorSystem[_]) { +class SampleRoutes(securityDirectives: SecurityDirectives)(implicit actorSystem: ActorSystem[?]) { import actorSystem.executionContext import securityDirectives._ @@ -48,7 +48,7 @@ class SampleRoutes(securityDirectives: SecurityDirectives)(implicit actorSystem: object SampleServer { def main(args: Array[String]): Unit = { - implicit val actorSystem: ActorSystem[_] = ActorSystem(Behaviors.empty, "test") + implicit val actorSystem: ActorSystem[?] = ActorSystem(Behaviors.empty, "test") implicit val ec: ExecutionContext = actorSystem.executionContext val config: Config = ConfigFactory.parseString(""" diff --git a/examples/src/main/scala/example/auth/installed/commands/CommandFactory.scala b/examples/src/main/scala/example/auth/installed/commands/CommandFactory.scala index cba6f67815..c9ec694b3b 100644 --- a/examples/src/main/scala/example/auth/installed/commands/CommandFactory.scala +++ b/examples/src/main/scala/example/auth/installed/commands/CommandFactory.scala @@ -11,7 +11,7 @@ import csw.aas.installed.api.InstalledAppAuthAdapter // #command-factory object CommandFactory { def makeCommand(adapter: InstalledAppAuthAdapter, args: Array[String])(implicit - actorSystem: typed.ActorSystem[_] + actorSystem: typed.ActorSystem[?] ): Option[AppCommand] = { // ============ NOTE ============ diff --git a/examples/src/main/scala/example/auth/installed/commands/ReadCommand.scala b/examples/src/main/scala/example/auth/installed/commands/ReadCommand.scala index 9061fcbaa3..53d8ecc9db 100644 --- a/examples/src/main/scala/example/auth/installed/commands/ReadCommand.scala +++ b/examples/src/main/scala/example/auth/installed/commands/ReadCommand.scala @@ -15,7 +15,7 @@ import scala.concurrent.duration.DurationLong import scala.concurrent.{Await, ExecutionContext, ExecutionContextExecutor, Future} // #read-command -class ReadCommand(implicit val actorSystem: typed.ActorSystem[_]) extends AppCommand { +class ReadCommand(implicit val actorSystem: typed.ActorSystem[?]) extends AppCommand { implicit val ec: ExecutionContextExecutor = actorSystem.executionContext override def run(): Unit = { val url = "http://localhost:7000/data" @@ -29,7 +29,7 @@ class ReadCommand(implicit val actorSystem: typed.ActorSystem[_]) extends AppCom // #read-command object ReadCommand { - def convertToString(entity: ResponseEntity)(implicit actorSystem: typed.ActorSystem[_]): Future[String] = { + def convertToString(entity: ResponseEntity)(implicit actorSystem: typed.ActorSystem[?]): Future[String] = { implicit val ec: ExecutionContext = actorSystem.executionContext Unmarshaller.stringUnmarshaller(entity) } diff --git a/examples/src/main/scala/example/database/AssemblyComponentHandlers.scala b/examples/src/main/scala/example/database/AssemblyComponentHandlers.scala index 255a4f7f48..58a6f9efac 100644 --- a/examples/src/main/scala/example/database/AssemblyComponentHandlers.scala +++ b/examples/src/main/scala/example/database/AssemblyComponentHandlers.scala @@ -26,7 +26,7 @@ class AssemblyComponentHandlers(ctx: ActorContext[TopLevelActorMessage], cswCtx: import cswCtx._ implicit val ec: ExecutionContextExecutor = ctx.executionContext - private var dsl: DSLContext = _ + private var dsl: DSLContext = scala.compiletime.uninitialized override def initialize(): Unit = { // #dbFactory-access val dbFactory = new DatabaseServiceFactory(ctx.system) diff --git a/examples/src/main/scala/example/event/ConcurrencyInCallbacksExample.scala b/examples/src/main/scala/example/event/ConcurrencyInCallbacksExample.scala index baab806e8f..d941e78a11 100644 --- a/examples/src/main/scala/example/event/ConcurrencyInCallbacksExample.scala +++ b/examples/src/main/scala/example/event/ConcurrencyInCallbacksExample.scala @@ -19,7 +19,7 @@ import example.event.TemperatureMessage.* import scala.concurrent.ExecutionContext import scala.concurrent.duration.DurationDouble -class ConcurrencyInCallbacksExample(publisher: EventPublisher)(implicit actorSystem: ActorSystem[_]) { +class ConcurrencyInCallbacksExample(publisher: EventPublisher)(implicit actorSystem: ActorSystem[?]) { def behavior(): Behavior[TemperatureMessage] = Behaviors.setup { ctx => diff --git a/examples/src/main/scala/example/event/EventServiceCreationExamples.scala b/examples/src/main/scala/example/event/EventServiceCreationExamples.scala index 3fb28bcea9..6b2b4d4ce2 100644 --- a/examples/src/main/scala/example/event/EventServiceCreationExamples.scala +++ b/examples/src/main/scala/example/event/EventServiceCreationExamples.scala @@ -17,7 +17,7 @@ import io.lettuce.core.{ClientOptions, RedisClient} class EventServiceCreationExamples { - private implicit val actorSystem: typed.ActorSystem[_] = + private implicit val actorSystem: typed.ActorSystem[?] = ActorSystemFactory.remote(SpawnProtocol(), "event-creation-examples") private val locationService = HttpLocationServiceFactory.makeLocalClient diff --git a/examples/src/main/scala/example/event/EventSubscribeExamples.scala b/examples/src/main/scala/example/event/EventSubscribeExamples.scala index e12efc6cc6..c36a84e399 100644 --- a/examples/src/main/scala/example/event/EventSubscribeExamples.scala +++ b/examples/src/main/scala/example/event/EventSubscribeExamples.scala @@ -17,7 +17,7 @@ import csw.prefix.models.Subsystem import scala.concurrent.Future import scala.concurrent.duration.DurationDouble -class EventSubscribeExamples(eventService: EventService, hcd: PekkoLocation)(implicit system: ActorSystem[_]) { +class EventSubscribeExamples(eventService: EventService, hcd: PekkoLocation)(implicit system: ActorSystem[?]) { def callback(): EventSubscription = // #with-callback diff --git a/examples/src/main/scala/example/framework/components/assembly/AssemblyComponentHandlers.scala b/examples/src/main/scala/example/framework/components/assembly/AssemblyComponentHandlers.scala index 3af901568d..eed8cbc8b0 100644 --- a/examples/src/main/scala/example/framework/components/assembly/AssemblyComponentHandlers.scala +++ b/examples/src/main/scala/example/framework/components/assembly/AssemblyComponentHandlers.scala @@ -37,8 +37,8 @@ class AssemblyComponentHandlers(ctx: ActorContext[TopLevelActorMessage], cswCtx: private val log: Logger = loggerFactory.getLogger(ctx) private var runningHcds: Map[Connection, Option[CommandService]] = Map.empty - var diagnosticsPublisher: ActorRef[DiagnosticPublisherMessages] = _ - var commandHandler: ActorRef[CommandHandlerMsgs] = _ + var diagnosticsPublisher: ActorRef[DiagnosticPublisherMessages] = scala.compiletime.uninitialized + var commandHandler: ActorRef[CommandHandlerMsgs] = scala.compiletime.uninitialized val timeout: FiniteDuration = 5.seconds // #initialize-handler diff --git a/examples/src/main/scala/example/framework/components/hcd/HcdComponentHandlers.scala b/examples/src/main/scala/example/framework/components/hcd/HcdComponentHandlers.scala index c87e3e2543..659343e665 100644 --- a/examples/src/main/scala/example/framework/components/hcd/HcdComponentHandlers.scala +++ b/examples/src/main/scala/example/framework/components/hcd/HcdComponentHandlers.scala @@ -41,8 +41,8 @@ class HcdComponentHandlers(ctx: ActorContext[TopLevelActorMessage], cswCtx: CswC implicit val ec: ExecutionContext = ctx.executionContext implicit val timeout: Timeout = 5.seconds implicit val scheduler: Scheduler = ctx.system.scheduler - var current: Int = _ - var stats: Int = _ + var current: Int = scala.compiletime.uninitialized + var stats: Int = scala.compiletime.uninitialized // #initialize-handler override def initialize(): Unit = { diff --git a/examples/src/main/scala/example/location/LocationServiceExampleComponentApp.scala b/examples/src/main/scala/example/location/LocationServiceExampleComponentApp.scala index ee58b9cecb..151b0c57be 100644 --- a/examples/src/main/scala/example/location/LocationServiceExampleComponentApp.scala +++ b/examples/src/main/scala/example/location/LocationServiceExampleComponentApp.scala @@ -50,7 +50,7 @@ object LocationServiceExampleComponent { val connection = PekkoConnection(componentId) // Message sent from client once location has been resolved - case class ClientMessage(replyTo: typed.ActorRef[_]) + case class ClientMessage(replyTo: typed.ActorRef[?]) def behaviour(locationService: LocationService)(implicit ec: ExecutionContextExecutor): Behaviors.Receive[ClientMessage] = Behaviors.receive[ClientMessage]((ctx, msg) => { diff --git a/examples/src/main/scala/example/time/SchedulerExamples.scala b/examples/src/main/scala/example/time/SchedulerExamples.scala index 37278ec8d5..0314173df0 100644 --- a/examples/src/main/scala/example/time/SchedulerExamples.scala +++ b/examples/src/main/scala/example/time/SchedulerExamples.scala @@ -21,7 +21,7 @@ class SchedulerExamples(ctx: ActorContext[UTCTime]) { // #create-scheduler // create time service scheduler using the factory method - implicit val actorSystem: typed.ActorSystem[_] = ctx.system + implicit val actorSystem: typed.ActorSystem[?] = ctx.system implicit val scheduler: Scheduler = actorSystem.scheduler implicit val executionContext: ExecutionContext = actorSystem.executionContext private val timeServiceScheduler: TimeServiceScheduler = new TimeServiceSchedulerFactory().make() diff --git a/examples/src/main/scala/example/tutorial/basic/sampleassembly/SampleAssemblyHandlers.scala b/examples/src/main/scala/example/tutorial/basic/sampleassembly/SampleAssemblyHandlers.scala index 0f090c9bb7..40e84f34b3 100755 --- a/examples/src/main/scala/example/tutorial/basic/sampleassembly/SampleAssemblyHandlers.scala +++ b/examples/src/main/scala/example/tutorial/basic/sampleassembly/SampleAssemblyHandlers.scala @@ -51,7 +51,7 @@ class SampleAssemblyHandlers(ctx: ActorContext[TopLevelActorMessage], cswCtx: Cs private val log = loggerFactory.getLogger private val prefix: Prefix = cswCtx.componentInfo.prefix private val hcdConnection = PekkoConnection(ComponentId(Prefix(Subsystem.ESW, "SampleHcd"), ComponentType.HCD)) - private var hcdLocation: PekkoLocation = _ + private var hcdLocation: PekkoLocation = scala.compiletime.uninitialized private var hcdCS: Option[CommandService] = None // #initialize diff --git a/examples/src/test/scala/example/params/KeysAndParametersExample.scala b/examples/src/test/scala/example/params/KeysAndParametersExample.scala index 19d7e36701..c4662a1a52 100644 --- a/examples/src/test/scala/example/params/KeysAndParametersExample.scala +++ b/examples/src/test/scala/example/params/KeysAndParametersExample.scala @@ -40,7 +40,7 @@ class KeysAndParametersExample extends AnyFunSpec with Matchers { // associating units val weekDays: Array[String] = Array("Sunday", "Monday", "Tuesday") val paramWithUnits1: Parameter[String] = k3.setAll(weekDays) - val paramWithUnits2: Parameter[String] = k3.setAll(weekDays) withUnits Units.day + val paramWithUnits2: Parameter[String] = k3.setAll(weekDays) `withUnits` Units.day // default unit is NoUnits assert(booleanParam.units === Units.NoUnits) @@ -74,7 +74,7 @@ class KeysAndParametersExample extends AnyFunSpec with Matchers { // Store some values using helper class ArrayData val p1: Parameter[ArrayData[Double]] = filterKey.set(ArrayData(arr1), ArrayData(arr2)) - val p2: Parameter[ArrayData[Double]] = filterKey -> ArrayData(arr1 ++ arr2) withUnits Units.liter + val p2: Parameter[ArrayData[Double]] = filterKey -> ArrayData(arr1 ++ arr2) `withUnits` Units.liter // add units to existing parameters val p1AsCount = p1.withUnits(Units.count) @@ -105,7 +105,7 @@ class KeysAndParametersExample extends AnyFunSpec with Matchers { // Store some values using helper class MatrixData val p1: Parameter[MatrixData[Byte]] = encoderKey.set(MatrixData.fromArrays(m1)) - val p2: Parameter[MatrixData[Byte]] = encoderKey.set(m1, m2) withUnits Units.liter + val p2: Parameter[MatrixData[Byte]] = encoderKey.set(m1, m2) `withUnits` Units.liter // add units to existing parameters val p1AsLiter = p1.withUnits(Units.liter) @@ -217,7 +217,7 @@ class KeysAndParametersExample extends AnyFunSpec with Matchers { // default units via set val paramWithUnits1: Parameter[String] = k3.setAll(weekDays) // associating units via withUnits - val paramWithUnits2: Parameter[String] = k3.setAll(weekDays) withUnits Units.day + val paramWithUnits2: Parameter[String] = k3.setAll(weekDays) `withUnits` Units.day // change existing unit val paramWithUnits3: Parameter[Short] = paramOfShorts.withUnits(Units.meter) // #units diff --git a/jitpack.yml b/jitpack.yml index 57e5cb3d91..4af3e45608 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -3,7 +3,7 @@ before_install: - chmod +x coursier - ./coursier java --jvm temurin:1.17 - export JITPACK_VERSION=$VERSION - - wget https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.9.7/sbt-launch-1.9.7.jar + - wget https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.10.0/sbt-launch-1.10.0.jar install: - eval $(./coursier java --jvm temurin:1.17 --env) - - java -Xms2048m -Xmx2048m -XX:ReservedCodeCacheSize=512m -jar sbt-launch-1.9.7.jar -Dsbt.log.noformat=true clean publishM2 + - java -Xms2048m -Xmx2048m -XX:ReservedCodeCacheSize=512m -jar sbt-launch-1.10.0.jar -Dsbt.log.noformat=true clean publishM2 diff --git a/project/Common.scala b/project/Common.scala index 3450fff0ef..a5e19d611f 100644 --- a/project/Common.scala +++ b/project/Common.scala @@ -44,6 +44,9 @@ object Common { "-feature", "-unchecked", "-deprecation", +// "-rewrite", +// "-source", +// "3.4-migration" ), javacOptions ++= Seq( "-Xlint:unchecked" diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 13c2601ccc..5424b30cd4 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -25,8 +25,9 @@ object Dependencies { Libs.`scopt`, Libs.`enumeratum`.value, Pekko.`cluster-sharding`, // akka-management-cluster-http uses lower version, to avoid conflict, this needs to be overridden - Libs.`pekko-management`, + Pekko.`pekko-management`, PekkoHttp.`pekko-http`, + PekkoHttp.`pekko-http-spray-json`, MSocket.`msocket-http`, Libs.`scalatest`.value % Test, Libs.`junit4-interface` % Test, @@ -340,7 +341,7 @@ object Dependencies { Pekko.`pekko-stream-typed`, Pekko.`pekko-actor-typed`, PekkoHttp.`pekko-http`, -// Libs.`scala-reflect`, + PekkoHttp.`pekko-http-spray-json`, Keycloak.`keycloak-adapter-core`, // TODO: make this as provided deps Libs.`scalatest`.value, diff --git a/project/Libs.scala b/project/Libs.scala index 0d01ed3276..8c1fe45e26 100644 --- a/project/Libs.scala +++ b/project/Libs.scala @@ -3,38 +3,37 @@ import sbt.Def.{setting => dep} import sbt._ object Libs { - val ScalaVersion = "3.3.1" + val ScalaVersion = "3.4.2" - val `dotty-cps-async` = dep("com.github.rssh" %%% "dotty-cps-async" % "0.9.20") + val `dotty-cps-async` = dep("com.github.rssh" %%% "dotty-cps-async" % "0.9.21") val `scopt` = "com.github.scopt" %% "scopt" % "4.1.0" // MIT License val `mockito` = "org.scalatestplus" %% "mockito-3-4" % "3.2.10.0" // Dual license: Either, Eclipse Public License v1.0 or GNU Lesser General Public License version 2.1 - val `logback-classic` = "ch.qos.logback" % "logback-classic" % "1.4.14" + val `logback-classic` = "ch.qos.logback" % "logback-classic" % "1.5.6" - val `sourcecode` = "com.lihaoyi" %% "sourcecode" % "0.3.1" - val `embedded-keycloak` = "com.github.tmtsoftware.embedded-keycloak" %% "embedded-keycloak" % "283ab9a" // Apache 2.0 - val `pekko-management` = "org.apache.pekko" %% "pekko-management" % "1.0.0" - val `svnkit` = "org.tmatesoft.svnkit" % "svnkit" % "1.10.11" // TMate Open Source License - val `commons-codec` = "commons-codec" % "commons-codec" % "1.15" // Apache 2.0š - val `gson` = "com.google.code.gson" % "gson" % "2.10.1" // Apache 2.0 - val `play-json` = "com.typesafe.play" %% "play-json" % "2.10.4" // Apache 2.0 + val `sourcecode` = "com.lihaoyi" %% "sourcecode" % "0.4.2" + val `embedded-keycloak` = "com.github.tmtsoftware.embedded-keycloak" %% "embedded-keycloak" % "3c23339" // Apache 2.0 + val `svnkit` = "org.tmatesoft.svnkit" % "svnkit" % "1.10.11" // TMate Open Source License + val `commons-codec` = "commons-codec" % "commons-codec" % "1.15" // Apache 2.0š + val `gson` = "com.google.code.gson" % "gson" % "2.11.0" // Apache 2.0 + val `play-json` = "com.typesafe.play" %% "play-json" % "2.10.5" // Apache 2.0 val `enumeratum` = dep("com.beachape" %%% "enumeratum" % "1.7.3") // MIT License val `scala-java-time` = dep("io.github.cquiroz" %%% "scala-java-time" % "2.5.0") val `scalajs-java-securerandom` = dep("org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0") - val `scalatest` = dep("org.scalatest" %%% "scalatest" % "3.2.17") // Apache License 2.0 + val `scalatest` = dep("org.scalatest" %%% "scalatest" % "3.2.18") // Apache License 2.0 - val `jwt-core` = "com.github.jwt-scala" %% "jwt-core" % "10.0.0" - val `lettuce` = "io.lettuce" % "lettuce-core" % "6.3.1.RELEASE" - val `reactor-core` = "io.projectreactor" % "reactor-core" % "3.6.2" + val `jwt-core` = "com.github.jwt-scala" %% "jwt-core" % "10.0.1" + val `lettuce` = "io.lettuce" % "lettuce-core" % "6.3.2.RELEASE" + val `reactor-core` = "io.projectreactor" % "reactor-core" % "3.6.6" val `reactive-streams` = "org.reactivestreams" % "reactive-streams" % "1.0.4" val `pekko-connectors-kafka` = "org.apache.pekko" %% "pekko-connectors-kafka" % "1.0.0" - val `embedded-kafka` = "io.github.embeddedkafka" %% "embedded-kafka" % "3.6.1" + val `embedded-kafka` = "io.github.embeddedkafka" %% "embedded-kafka" % "3.7.0" val `embedded-redis` = "com.github.kstyrc" % "embedded-redis" % "0.6" val `scala-compiler` = "org.scala-lang" % "scala-compiler" % ScalaVersion - val `HdrHistogram` = "org.hdrhistogram" % "HdrHistogram" % "2.1.12" + val `HdrHistogram` = "org.hdrhistogram" % "HdrHistogram" % "2.2.1" val `testng` = "org.testng" % "testng" % "7.8.0" val `junit4-interface` = "com.github.sbt" % "junit-interface" % "0.13.3" val `testng-6-7` = "org.scalatestplus" %% "testng-6-7" % "3.2.10.0" @@ -42,23 +41,23 @@ object Libs { val `scala-csv` = "com.github.tototoshi" %% "scala-csv" % "1.3.10" val `json-schema-validator` = "com.github.fge" % "json-schema-validator" % "2.2.14" // LGPL/ASL - val `jna` = "net.java.dev.jna" % "jna" % "5.14.0" - val `postgresql` = "org.postgresql" % "postgresql" % "42.7.1" - val `hikaricp` = "com.zaxxer" % "HikariCP" % "5.1.0" // Apache License 2.0 - val `io.zonky.test` = "io.zonky.test" % "embedded-postgres" % "2.0.6" - val httpclient5 = "org.apache.httpcomponents.client5" % "httpclient5" % "5.3.1" - val `jboss-logging` = "org.jboss.logging" % "jboss-logging" % "3.5.3.Final" - val `config` = "com.typesafe" % "config" % "1.4.3" - val `os-lib` = "com.lihaoyi" %% "os-lib" % "0.9.3" - val `caffeine` = "com.github.ben-manes.caffeine" % "caffeine" % "3.1.8" - val netty = "io.netty" % "netty-all" % "4.1.106.Final" - val `case-app` = "com.github.alexarchambault" %% "case-app" % "2.1.0-M26" - val `tmt-test-reporter` = "com.github.tmtsoftware.rtm" %% "rtm" % "72269ec" + val `jna` = "net.java.dev.jna" % "jna" % "5.14.0" + val `postgresql` = "org.postgresql" % "postgresql" % "42.7.3" + val `hikaricp` = "com.zaxxer" % "HikariCP" % "5.1.0" // Apache License 2.0 + val `io.zonky.test` = "io.zonky.test" % "embedded-postgres" % "2.0.7" + val httpclient5 = "org.apache.httpcomponents.client5" % "httpclient5" % "5.3.1" + val `jboss-logging` = "org.jboss.logging" % "jboss-logging" % "3.6.0.Final" + val `config` = "com.typesafe" % "config" % "1.4.3" + val `os-lib` = "com.lihaoyi" %% "os-lib" % "0.9.3" + val `caffeine` = "com.github.ben-manes.caffeine" % "caffeine" % "3.1.8" + val netty = "io.netty" % "netty-all" % "4.1.110.Final" + val `case-app` = "com.github.alexarchambault" %% "case-app" % "2.1.0-M26" + val `tmt-test-reporter` = "com.github.tmtsoftware.rtm" %% "rtm" % "1981053" } object Borer { val Version = "1.14.0" - val Org = "io.bullet" + val Org = "io.bullet" // val Org = "com.github.tmtsoftware.borer" val `borer-core` = dep(Org %%% "borer-core" % Version) @@ -67,7 +66,7 @@ object Borer { } object Jackson { - val Version = "2.16.1" + val Version = "2.17.1" val `jackson-core` = "com.fasterxml.jackson.core" % "jackson-core" % Version val `jackson-databind` = "com.fasterxml.jackson.core" % "jackson-databind" % Version @@ -91,12 +90,13 @@ object Pekko { val `pekko-cluster` = Org %% "pekko-cluster" % Version val `pekko-cluster-typed` = Org %% "pekko-cluster-typed" % Version val `pekko-slf4j` = Org %% "pekko-slf4j" % Version - val `cluster-sharding` = - Org %% "pekko-cluster-sharding" % Version // required to maintaining the transitive dependency of akka-management-cluster-http + val `pekko-management` = Org %% "pekko-management" % "1.0.0" + // required for maintaining the transitive dependency of akka-management-cluster-http + val `cluster-sharding` = Org %% "pekko-cluster-sharding" % Version } object PekkoHttp { - val Version = "1.0.0" + val Version = "1.0.1" val Org = "org.apache.pekko" val `pekko-http` = Org %% "pekko-http" % Version @@ -108,7 +108,7 @@ object PekkoHttp { } object Keycloak { - val Version = "23.0.6" + val Version = "24.0.4" val `keycloak-adapter-core` = "org.keycloak" % "keycloak-adapter-core" % Version val `keycloak-core` = "org.keycloak" % "keycloak-core" % Version @@ -118,7 +118,7 @@ object Keycloak { } object Jooq { - val Version = "3.19.3" + val Version = "3.19.8" val `jooq` = "org.jooq" % "jooq" % Version val `jooq-meta` = "org.jooq" % "jooq-meta" % Version @@ -126,7 +126,7 @@ object Jooq { } object MSocket { - val Version = "b4b4931" + val Version = "033f412" val `msocket-api` = dep("com.github.tmtsoftware.msocket" %%% "msocket-api" % Version) val `msocket-security` = "com.github.tmtsoftware.msocket" %% "msocket-security" % Version diff --git a/project/build.properties b/project/build.properties index abbbce5da4..081fdbbc76 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.10.0 diff --git a/project/plugins.sbt b/project/plugins.sbt index e5391d6545..c6c8212217 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,16 +2,16 @@ addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") //addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") // not scala 3 ready addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12") addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.4.0") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") addSbtPlugin("com.orrsella" % "sbt-stats" % "1.0.7") addSbtPlugin("de.johoop" % "sbt-testng-plugin" % "3.1.1") addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.3.1") addSbtPlugin("com.timushev.sbt" % "sbt-rewarn" % "0.1.3") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") diff --git a/romaine/src/main/scala/romaine/reactive/RedisSubscriptionImpl.scala b/romaine/src/main/scala/romaine/reactive/RedisSubscriptionImpl.scala index 2b088d00c0..6ee143e1af 100644 --- a/romaine/src/main/scala/romaine/reactive/RedisSubscriptionImpl.scala +++ b/romaine/src/main/scala/romaine/reactive/RedisSubscriptionImpl.scala @@ -16,7 +16,7 @@ private class RedisSubscriptionImpl[K]( connectedF: Future[Done], killSwitch: KillSwitch, terminationSignal: Future[Done], - redisReactiveApi: Future[RedisReactiveApi[K, _]] + redisReactiveApi: Future[RedisReactiveApi[K, ?]] )(implicit executionContext: ExecutionContext) extends RedisSubscription { diff --git a/romaine/src/main/scala/romaine/reactive/subscribe/RedisPSubscribeApi.scala b/romaine/src/main/scala/romaine/reactive/subscribe/RedisPSubscribeApi.scala index 8dbde8d6be..368870f4da 100644 --- a/romaine/src/main/scala/romaine/reactive/subscribe/RedisPSubscribeApi.scala +++ b/romaine/src/main/scala/romaine/reactive/subscribe/RedisPSubscribeApi.scala @@ -16,14 +16,14 @@ import scala.concurrent.{blocking, ExecutionContext, Future} class RedisPSubscribeApi[K, V](redisReactiveCommands: RedisPubSubReactiveCommands[K, V])(implicit ec: ExecutionContext) extends RedisReactiveApi[K, V] { - def subscribe(keys: List[K]): Future[Done] = redisReactiveCommands.psubscribe(keys: _*).toFuture.asScala.map(_ => Done) + def subscribe(keys: List[K]): Future[Done] = redisReactiveCommands.psubscribe(keys*).toFuture.asScala.map(_ => Done) def observe(overflowStrategy: OverflowStrategy): Source[RedisResult[K, V], NotUsed] = Source .fromPublisher(redisReactiveCommands.observePatterns(overflowStrategy)) .map(x => RedisResult(x.getChannel, x.getMessage)) - def unsubscribe(keys: List[K]): Future[Done] = redisReactiveCommands.punsubscribe(keys: _*).toFuture.asScala.map(_ => Done) + def unsubscribe(keys: List[K]): Future[Done] = redisReactiveCommands.punsubscribe(keys*).toFuture.asScala.map(_ => Done) // def close(): Future[Unit] = // Future { // blocking { diff --git a/romaine/src/main/scala/romaine/reactive/subscribe/RedisSubscribeApi.scala b/romaine/src/main/scala/romaine/reactive/subscribe/RedisSubscribeApi.scala index b08fb7f9fe..006e502e84 100644 --- a/romaine/src/main/scala/romaine/reactive/subscribe/RedisSubscribeApi.scala +++ b/romaine/src/main/scala/romaine/reactive/subscribe/RedisSubscribeApi.scala @@ -16,12 +16,12 @@ import scala.concurrent.{blocking, ExecutionContext, Future} class RedisSubscribeApi[K, V](redisReactiveCommands: RedisPubSubReactiveCommands[K, V])(implicit ec: ExecutionContext) extends RedisReactiveApi[K, V] { - def subscribe(keys: List[K]): Future[Done] = redisReactiveCommands.subscribe(keys: _*).toFuture.asScala.map(_ => Done) + def subscribe(keys: List[K]): Future[Done] = redisReactiveCommands.subscribe(keys*).toFuture.asScala.map(_ => Done) def observe(overflowStrategy: OverflowStrategy): Source[RedisResult[K, V], NotUsed] = Source .fromPublisher(redisReactiveCommands.observeChannels(overflowStrategy)) .map(x => RedisResult(x.getChannel, x.getMessage)) - def unsubscribe(keys: List[K]): Future[Done] = redisReactiveCommands.unsubscribe(keys: _*).toFuture.asScala.map(_ => Done) + def unsubscribe(keys: List[K]): Future[Done] = redisReactiveCommands.unsubscribe(keys*).toFuture.asScala.map(_ => Done) // def close(): Future[Unit] = // Future { // blocking {