boolean (PsiReference reference) { final PsiElement element = reference.getElement(); if (PsiTreeUtil.getParentOfType(element, PsiSynchronizedStatement.class) != null) { return true; } final PsiMethod method = PsiTreeUtil.getParentOfType(element, PsiMethod.class); if (method == null) { return false; } if (method.hasModifierProperty(PsiModifier.SYNCHRONIZED)) { return true; } if (methodsAlwaysSynchronized.contains(method)) { return true; } return !methodsNotAlwaysSynchronized.contains(method); }