From 3339d8e0f050b01f122463c3f751f198c10ba42e Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Mon, 20 Jul 2020 11:13:48 +0200 Subject: Fix style issues introduced with dokka-cli-json --- core/src/main/kotlin/utilities/json.kt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'core/src/main/kotlin/utilities') diff --git a/core/src/main/kotlin/utilities/json.kt b/core/src/main/kotlin/utilities/json.kt index 2096879a..9e4677aa 100644 --- a/core/src/main/kotlin/utilities/json.kt +++ b/core/src/main/kotlin/utilities/json.kt @@ -32,7 +32,6 @@ internal class TypeReference private constructor( internal val jackson: JacksonTypeReference ) { companion object { - @OptIn(ExperimentalStdlibApi::class) internal inline operator fun invoke(): TypeReference = TypeReference(jacksonTypeRef()) } } @@ -41,14 +40,13 @@ internal class TypeReference private constructor( internal fun toJsonString(value: Any): String = objectMapper.writeValueAsString(value) @PublishedApi -internal inline fun parseJson(json: String): T { - return parseJson(json, TypeReference()) -} +internal inline fun parseJson(json: String): T = parseJson(json, TypeReference()) + @PublishedApi -internal fun parseJson(json: String, typeReference: TypeReference): T { - return objectMapper.readValue(json, typeReference.jackson) -} +internal fun parseJson(json: String, typeReference: TypeReference): T = + objectMapper.readValue(json, typeReference.jackson) + private object FileSerializer : StdScalarSerializer(File::class.java) { override fun serialize(value: File, g: JsonGenerator, provider: SerializerProvider) { @@ -63,7 +61,5 @@ private object SourceRootSerializer : StdScalarSerializer(SourceRoot } private object SourceRootImplDeserializer : StdScalarDeserializer(SourceRootImpl::class.java) { - override fun deserialize(p: JsonParser, ctxt: DeserializationContext): SourceRootImpl { - return SourceRootImpl(p.text) - } + override fun deserialize(p: JsonParser, ctxt: DeserializationContext): SourceRootImpl = SourceRootImpl(p.text) } -- cgit