From 626a2e839efe6c5c912bc6efa1a0cc6c9c8576c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 5 Oct 2017 21:01:43 +0200 Subject: [PATCH] Declare returned Core to always be non-null --- src/main/java/net/pterodactylus/sone/web/WebInterface.java | 1 + src/main/kotlin/net/pterodactylus/sone/web/pages/GetImagePage.kt | 2 +- src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 49f1158..6401b43 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -410,6 +410,7 @@ public class WebInterface implements SessionProvider { * * @return The Sone core */ + @Nonnull public Core getCore() { return sonePlugin.core(); } diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/GetImagePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/GetImagePage.kt index 3e9eed0..932827e 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/GetImagePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/GetImagePage.kt @@ -11,7 +11,7 @@ import java.net.URI */ class GetImagePage(webInterface: WebInterface): FreenetPage { - private val core = webInterface.core!! + private val core = webInterface.core override fun getPath(): String { return "getImage.html" diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt index fc59639..a1fc2de 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt @@ -47,7 +47,7 @@ open class WebPageTest(pageSupplier: (Template, WebInterface) -> SoneTemplatePag val currentSone = mock() val template = mock