boolean (PsiReferenceExpression expression) { if (m_ignoreStaticAccessFromStaticContext) { final PsiMember member = PsiTreeUtil.getParentOfType(expression, PsiMember.class); if (member != null && member.hasModifierProperty(PsiModifier.STATIC)) { return false; } } final PsiExpression qualifierExpression = expression.getQualifierExpression(); if (qualifierExpression != null) { return false; } final JavaResolveResult resolveResult = expression.advancedResolve(false); final PsiElement currentFileResolveScope = resolveResult.getCurrentFileResolveScope(); if (currentFileResolveScope instanceof PsiImportStaticStatement) { return false; } final PsiElement element = resolveResult.getElement(); if (!(element instanceof PsiField) && !(element instanceof PsiMethod)) { return false; } final PsiMember member = (PsiMember)element; if (member instanceof PsiEnumConstant) { PsiElement parent = PsiUtil.skipParenthesizedExprUp(expression.getParent()); if (parent instanceof PsiCaseLabelElementList && parent.getParent() instanceof PsiSwitchLabelStatementBase) { return false; } } return member.hasModifierProperty(PsiModifier.STATIC); }