boolean (PsiReferenceExpression refExpression) { PsiExpression qualifier = PsiUtil.deparenthesizeExpression(refExpression.getQualifierExpression()); if (qualifier == null) { return true; } if (qualifier instanceof PsiQualifiedExpression) { final PsiJavaCodeReferenceElement thisQualifier = ((PsiQualifiedExpression)qualifier).getQualifier(); if (thisQualifier == null) return true; final PsiClass innerMostClass = PsiTreeUtil.getParentOfType(refExpression, PsiClass.class); return innerMostClass == thisQualifier.resolve(); } return false; }