[FIR] Remove annotations.find {} from FirJvmRedundantRepeatableChecker
This commit is contained in:
committed by
Space Team
parent
d105ce8681
commit
f8643c90eb
+3
-6
@@ -19,12 +19,9 @@ import org.jetbrains.kotlin.name.StandardClassIds.Annotations.Java
|
|||||||
|
|
||||||
object FirJvmRedundantRepeatableChecker : FirBasicDeclarationChecker() {
|
object FirJvmRedundantRepeatableChecker : FirBasicDeclarationChecker() {
|
||||||
override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) {
|
override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||||
val kotlinRepeatable = declaration.annotations.find { it.fullyExpandedClassId(context.session) == Repeatable }
|
val kotlinRepeatable = declaration.getAnnotationByClassId(Repeatable, context.session)
|
||||||
|
val javaRepeatable = declaration.getAnnotationByClassId(JvmRepeatable, context.session)
|
||||||
val javaRepeatable = declaration.annotations.find {
|
?: declaration.getAnnotationByClassId(Java.Repeatable, context.session)
|
||||||
val expandedClassId = it.fullyExpandedClassId(context.session)
|
|
||||||
expandedClassId == JvmRepeatable || expandedClassId == Java.Repeatable
|
|
||||||
}
|
|
||||||
|
|
||||||
if (kotlinRepeatable != null && javaRepeatable != null) {
|
if (kotlinRepeatable != null && javaRepeatable != null) {
|
||||||
reporter.reportOn(
|
reporter.reportOn(
|
||||||
|
|||||||
Reference in New Issue
Block a user