PsiModifierListOwner (@NotNull PsiElement place, @Nullable PsiClass aClass) { LOG.assertTrue(aClass == null || !place.isPhysical() || PsiTreeUtil.isContextAncestor(aClass, place, false)); PsiElement parent = place; while (parent != aClass) { if (parent == null) return null; if (parent instanceof PsiModifierListOwner && ((PsiModifierListOwner)parent).hasModifierProperty(PsiModifier.STATIC)) { return (PsiModifierListOwner)parent; } parent = parent.getContext(); } return null; }