From f8643c90eb75408e1409da7bfc3a4a73c11b0139 Mon Sep 17 00:00:00 2001 From: Nikolay Lunyak Date: Fri, 13 Jan 2023 12:04:26 +0200 Subject: [PATCH] [FIR] Remove `annotations.find {}` from FirJvmRedundantRepeatableChecker --- .../declaration/FirJvmRedundantRepeatableChecker.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/jvm/checkers/declaration/FirJvmRedundantRepeatableChecker.kt b/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/jvm/checkers/declaration/FirJvmRedundantRepeatableChecker.kt index 189735ba9c4..f2bf7f9b841 100644 --- a/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/jvm/checkers/declaration/FirJvmRedundantRepeatableChecker.kt +++ b/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/jvm/checkers/declaration/FirJvmRedundantRepeatableChecker.kt @@ -19,12 +19,9 @@ import org.jetbrains.kotlin.name.StandardClassIds.Annotations.Java object FirJvmRedundantRepeatableChecker : FirBasicDeclarationChecker() { override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) { - val kotlinRepeatable = declaration.annotations.find { it.fullyExpandedClassId(context.session) == Repeatable } - - val javaRepeatable = declaration.annotations.find { - val expandedClassId = it.fullyExpandedClassId(context.session) - expandedClassId == JvmRepeatable || expandedClassId == Java.Repeatable - } + val kotlinRepeatable = declaration.getAnnotationByClassId(Repeatable, context.session) + val javaRepeatable = declaration.getAnnotationByClassId(JvmRepeatable, context.session) + ?: declaration.getAnnotationByClassId(Java.Repeatable, context.session) if (kotlinRepeatable != null && javaRepeatable != null) { reporter.reportOn(