private static boolean checkFieldLocation(PsiMethod method, PsiField field) {
    return PsiResolveHelper.getInstance(method.getProject()).isAccessible(field, method, null) &&
           (!method.hasModifier(JvmModifier.STATIC) || field.hasModifier(JvmModifier.STATIC)) &&
           InheritanceUtil.isInheritorOrSelf(method.getContainingClass(), field.getContainingClass(), true);
  }
private static boolean checkFieldLocation(PsiMethod method, PsiField field)