From 00dbd95514641cd430aaba9fb2c9a7f5178a09a2 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Tue, 4 Mar 2014 15:43:05 +0400 Subject: [PATCH] Reuse resolve context with type eval context from the current inspection session for performance reasons --- .../python/inspections/PyProtectedMemberInspection.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/inspections/PyProtectedMemberInspection.java b/python/src/com/jetbrains/python/inspections/PyProtectedMemberInspection.java index fe9ac7f9159e..52775764074e 100644 --- a/python/src/com/jetbrains/python/inspections/PyProtectedMemberInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyProtectedMemberInspection.java @@ -70,7 +70,10 @@ public class PyProtectedMemberInspection extends PyInspection { if (name != null && name.startsWith("_") && !name.startsWith("__") && !name.endsWith("__")) { final PyClass parentClass = getClassOwner(node); if (parentClass != null) { - final PsiReference reference = node.getReference(); + final PsiReference reference = node.getReference(resolveWithoutImplicits()); + if (reference == null) { + return; + } final PsiElement resolvedExpression = reference.resolve(); final PyClass resolvedClass = getClassOwner(resolvedExpression); if (parentClass.isSubclass(resolvedClass))