From: David ‘Bombe’ Roden Date: Sun, 9 Feb 2020 00:13:51 +0000 (+0100) Subject: 🚨 Suppress some warnings about unused parameters X-Git-Tag: v81^2~5^2 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=4af887c75667793c197b564f16b7e95b1f63cbc7 🚨 Suppress some warnings about unused parameters --- diff --git a/src/main/kotlin/net/pterodactylus/sone/main/TickerShutdown.kt b/src/main/kotlin/net/pterodactylus/sone/main/TickerShutdown.kt index 5f96050..c95da09 100644 --- a/src/main/kotlin/net/pterodactylus/sone/main/TickerShutdown.kt +++ b/src/main/kotlin/net/pterodactylus/sone/main/TickerShutdown.kt @@ -29,7 +29,7 @@ import javax.inject.* class TickerShutdown @Inject constructor(@Named("notification") private val notificationTicker: ScheduledExecutorService) { @Subscribe - fun shutdown(shutdown: Shutdown) { + fun shutdown(@Suppress("UNUSED_PARAMETER") shutdown: Shutdown) { notificationTicker.shutdown() } diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/ConfigNotReadHandler.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/ConfigNotReadHandler.kt index 46961c0..4ad525b 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/ConfigNotReadHandler.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/ConfigNotReadHandler.kt @@ -28,7 +28,7 @@ import javax.inject.* class ConfigNotReadHandler @Inject constructor(private val notificationManager: NotificationManager, @Named("configNotRead") private val notification: TemplateNotification) { @Subscribe - fun configNotRead(configNotRead: ConfigNotRead) { + fun configNotRead(@Suppress("UNUSED_PARAMETER") configNotRead: ConfigNotRead) { notificationManager.addNotification(notification) } diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/FirstStartHandler.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/FirstStartHandler.kt index aceda7e..dc9c507 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/FirstStartHandler.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/FirstStartHandler.kt @@ -28,7 +28,7 @@ import javax.inject.* class FirstStartHandler @Inject constructor(private val notificationManager: NotificationManager, @Named("firstStart") private val notification: TemplateNotification) { @Subscribe - fun firstStart(firstStart: FirstStart) { + fun firstStart(@Suppress("UNUSED_PARAMETER") firstStart: FirstStart) { notificationManager.addNotification(notification) } diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/StartupHandler.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/StartupHandler.kt index 06acf94..4d81576 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/StartupHandler.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/StartupHandler.kt @@ -33,7 +33,7 @@ class StartupHandler @Inject constructor( @Named("notification") private val ticker: ScheduledExecutorService) { @Subscribe - fun startup(startup: Startup) { + fun startup(@Suppress("UNUSED_PARAMETER") startup: Startup) { notificationManager.addNotification(notification) ticker.schedule({ notificationManager.removeNotification(notification) }, 2, MINUTES) } diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/WebOfTrustHandler.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/WebOfTrustHandler.kt index 924d395..f331643 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/WebOfTrustHandler.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/WebOfTrustHandler.kt @@ -29,12 +29,12 @@ import javax.inject.* class WebOfTrustHandler @Inject constructor(private val notificationManager: NotificationManager, @Named("webOfTrust") private val notification: TemplateNotification) { @Subscribe - fun webOfTrustAppeared(webOfTrustAppeared: WebOfTrustAppeared) { + fun webOfTrustAppeared(@Suppress("UNUSED_PARAMETER") webOfTrustAppeared: WebOfTrustAppeared) { notificationManager.removeNotification(notification) } @Subscribe - fun webOfTrustDisappeared(webOfTrustDisappeared: WebOfTrustDisappeared) { + fun webOfTrustDisappeared(@Suppress("UNUSED_PARAMETER") webOfTrustDisappeared: WebOfTrustDisappeared) { notificationManager.addNotification(notification) } diff --git a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustPingerTest.kt b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustPingerTest.kt index cbd9172..6d302c5 100644 --- a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustPingerTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustPingerTest.kt @@ -105,14 +105,14 @@ class WebOfTrustPingerTest { private class WebOfTrustAppearedCatcher(private val received: () -> Unit) { @Subscribe - fun webOfTrustAppeared(webOfTrustAppeared: WebOfTrustAppeared) { + fun webOfTrustAppeared(@Suppress("UNUSED_PARAMETER") webOfTrustAppeared: WebOfTrustAppeared) { received() } } private class WebOfTrustDisappearedCatcher(private val received: () -> Unit) { @Subscribe - fun webOfTrustDisappeared(webOfTrustDisappeared: WebOfTrustDisappeared) { + fun webOfTrustDisappeared(@Suppress("UNUSED_PARAMETER") webOfTrustDisappeared: WebOfTrustDisappeared) { received() } } diff --git a/src/test/kotlin/net/pterodactylus/sone/main/SonePluginTest.kt b/src/test/kotlin/net/pterodactylus/sone/main/SonePluginTest.kt index 0bb03af..d1e2cec 100644 --- a/src/test/kotlin/net/pterodactylus/sone/main/SonePluginTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/main/SonePluginTest.kt @@ -110,7 +110,7 @@ class SonePluginTest { private class FirstStartListener(private val firstStartReceived: AtomicBoolean) { @Subscribe - fun firstStart(firstStart: FirstStart) { + fun firstStart(@Suppress("UNUSED_PARAMETER") firstStart: FirstStart) { firstStartReceived.set(true) } } @@ -141,7 +141,7 @@ class SonePluginTest { private class ConfigNotReadListener(private val configNotReadReceiver: AtomicBoolean) { @Subscribe - fun configNotRead(configNotRead: ConfigNotRead) { + fun configNotRead(@Suppress("UNUSED_PARAMETER") configNotRead: ConfigNotRead) { configNotReadReceiver.set(true) } } @@ -185,7 +185,7 @@ class SonePluginTest { private class StartupListener(private val startupReceived: () -> Unit) { @Subscribe - fun startup(startup: Startup) { + fun startup(@Suppress("UNUSED_PARAMETER") startup: Startup) { startupReceived() } } @@ -202,7 +202,7 @@ class SonePluginTest { private class ShutdownListener(private val shutdownReceived: () -> Unit) { @Subscribe - fun shutdown(shutdown: Shutdown) { + fun shutdown(@Suppress("UNUSED_PARAMETER") shutdown: Shutdown) { shutdownReceived() } }