From 4bff0fb3381fd0d14ed0053e1680402d16dbda67 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 19 Dec 2017 15:45:11 +0300 Subject: [PATCH] Unused symbol: revert entry point check optimization to fix regression E.g. JUnit 3 tests was highlighted as unused after it --- .../kotlin/idea/inspections/UnusedSymbolInspection.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt index 6c133fefea5..d420d7113a4 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt @@ -85,11 +85,8 @@ import javax.swing.JPanel class UnusedSymbolInspection : AbstractKotlinInspection() { companion object { private val javaInspection = UnusedDeclarationInspection() - private val MAIN_NAMES = setOf("main", "premain", "agentmain") fun isEntryPoint(declaration: KtNamedDeclaration): Boolean { - if (declaration.annotationEntries.isEmpty() && declaration.name !in MAIN_NAMES) return false - val lightElement: PsiElement? = when (declaration) { is KtClassOrObject -> declaration.toLightClass() is KtNamedFunction, is KtSecondaryConstructor -> LightClassUtil.getLightClassMethod(declaration as KtFunction)