diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/JavaSimplePropertyIndex.kt b/java/java-indexing-impl/src/com/intellij/psi/impl/JavaSimplePropertyIndex.kt index 6c846ad403d4..fd805d1137db 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/JavaSimplePropertyIndex.kt +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/JavaSimplePropertyIndex.kt @@ -33,7 +33,6 @@ import java.io.DataOutput private val indexId = ID.create("java.simple.property") private val log = Logger.getInstance(JavaSimplePropertyIndex::class.java) -private val allowedExpressions = TokenSet.create(ElementType.REFERENCE_EXPRESSION, ElementType.THIS_EXPRESSION, ElementType.SUPER_EXPRESSION) fun getFieldOfGetter(method: PsiMethodImpl): PsiField? = resolveFieldFromIndexValue(method, true) @@ -64,6 +63,10 @@ private fun resolveFieldFromIndexValue(method: PsiMethodImpl, isGetter: Boolean) data class PropertyIndexValue(val propertyRefText: String, val getter: Boolean) class JavaSimplePropertyIndex : FileBasedIndexExtension(), PsiDependentIndex { + private val allowedExpressions by lazy { + TokenSet.create(ElementType.REFERENCE_EXPRESSION, ElementType.THIS_EXPRESSION, ElementType.SUPER_EXPRESSION) + } + override fun getIndexer(): DataIndexer = DataIndexer { inputData -> val result = ContainerUtil.newHashMap() val tree = (inputData as FileContentImpl).lighterASTForPsiDependentIndex