From 037a70247c20f07b49133536c3aa91f73a2db7f7 Mon Sep 17 00:00:00 2001 From: GeorgCantor Date: Fri, 27 Sep 2024 18:02:32 +0300 Subject: [PATCH] Update AnnotationsProperty.kt --- .../kotlin/abicmp/checkers/AnnotationsProperty.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libraries/tools/abi-comparator/src/main/kotlin/org/jetbrains/kotlin/abicmp/checkers/AnnotationsProperty.kt b/libraries/tools/abi-comparator/src/main/kotlin/org/jetbrains/kotlin/abicmp/checkers/AnnotationsProperty.kt index c24c444ff9e5b..a3add8e238dad 100644 --- a/libraries/tools/abi-comparator/src/main/kotlin/org/jetbrains/kotlin/abicmp/checkers/AnnotationsProperty.kt +++ b/libraries/tools/abi-comparator/src/main/kotlin/org/jetbrains/kotlin/abicmp/checkers/AnnotationsProperty.kt @@ -28,11 +28,10 @@ fun Any?.toAnnotation(): AnnotationEntry? { return AnnotationEntry(ann.desc, values.sortedBy { it.first }) } -fun Any.toAnnotationArgumentValue(): Any = - when (this) { - is Array<*> -> map { it!!.toAnnotationArgumentValue() } - is List<*> -> map { it!!.toAnnotationArgumentValue() } - is AnnotationNode -> this.toAnnotation()!! - else -> this - } +fun Any.toAnnotationArgumentValue(): Any = when (this) { + is Array<*> -> map { it?.toAnnotationArgumentValue() ?: it } + is List<*> -> map { it?.toAnnotationArgumentValue() ?: it } + is AnnotationNode -> this.toAnnotation() ?: this + else -> this +}