[FIR] Remove annotations.find {} from FirJvmRedundantRepeatableChecker

This commit is contained in:
Nikolay Lunyak
2023-01-13 12:04:26 +02:00
committed by Space Team
parent d105ce8681
commit f8643c90eb
@@ -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(