From 2d6ac07adfc2b8f25e91681dbb2b58a1c6cdf9a7 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Wed, 2 Aug 2017 10:58:00 +0200 Subject: [PATCH] Add JSR-305 JAR needed until KT-19419 is fixed --- build.gradle.kts | 2 ++ src/main/kotlin/functional/web/view/MustacheView.kt | 2 +- src/main/kotlin/functional/web/view/MustacheViewResolver.kt | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 09c5d5e..18c6d8a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,6 +53,8 @@ tasks { compile("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.0") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.0") + + compile("com.google.code.findbugs:jsr305:3.0.2") // Needed for now, could be removed when KT-19419 will be fixed testCompile("io.projectreactor:reactor-test:3.1.0.M3") diff --git a/src/main/kotlin/functional/web/view/MustacheView.kt b/src/main/kotlin/functional/web/view/MustacheView.kt index e5d922d..ba32bcd 100644 --- a/src/main/kotlin/functional/web/view/MustacheView.kt +++ b/src/main/kotlin/functional/web/view/MustacheView.kt @@ -90,7 +90,7 @@ class MustacheView : AbstractUrlBasedView() { private fun resolveResource(): Resource? { val resource = applicationContext!!.getResource(url!!) - if (resource == null || !resource.exists()) { + if (!resource.exists()) { return null } return resource diff --git a/src/main/kotlin/functional/web/view/MustacheViewResolver.kt b/src/main/kotlin/functional/web/view/MustacheViewResolver.kt index 602493a..b1a8978 100644 --- a/src/main/kotlin/functional/web/view/MustacheViewResolver.kt +++ b/src/main/kotlin/functional/web/view/MustacheViewResolver.kt @@ -48,7 +48,7 @@ class MustacheViewResolver(private val compiler: Compiler = Mustache.compiler()) return MustacheView::class.java } - override fun createView(viewName: String?): AbstractUrlBasedView { + override fun createView(viewName: String): AbstractUrlBasedView { val view = super.createView(viewName) as MustacheView view.setCompiler(this.compiler) this.charset?.let { view.setCharset(it) }