void (@NotNull GrMethodCallExpression grMethodCallExpression) { super.visitMethodCallExpression(grMethodCallExpression); final GrExpression methodExpression = grMethodCallExpression.getInvokedExpression(); if (!(methodExpression instanceof GrReferenceExpression reference)) { return; } final String name = reference.getReferenceName(); if (!"notify".equals(name) && !"notifyAll".equals(name)) { return; } final PsiMethod method = grMethodCallExpression.resolveMethod(); if (method == null) { return; } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null || !CommonClassNames.JAVA_LANG_OBJECT.equals(containingClass.getQualifiedName())) { return; } final GrMethod containingMethod = PsiTreeUtil.getParentOfType(grMethodCallExpression, GrMethod.class); if (containingMethod != null && containingMethod.hasModifierProperty(PsiModifier.SYNCHRONIZED)) { return; } final GrStatement parent = PsiTreeUtil.getParentOfType(grMethodCallExpression, GrSynchronizedStatement.class, GrClosableBlock.class); if (parent instanceof GrSynchronizedStatement) { return; } registerMethodCallError(grMethodCallExpression); }