void (@NotNull GrSynchronizedStatement synchronizedStatement) { super.visitSynchronizedStatement(synchronizedStatement); final GrExpression lock = synchronizedStatement.getMonitor(); if (!(lock instanceof GrReferenceExpression)) { return; } final PsiElement referent = ((PsiReference) lock).resolve(); if (referent instanceof GrVariable) { final GrVariable variable = (GrVariable) referent; final GrExpression initializer = variable.getInitializerGroovy(); if (initializer == null) { return; } if (!(initializer instanceof GrLiteral)) { return; } registerError(lock); } else if (referent instanceof PsiVariable) { final PsiVariable variable = (PsiVariable) referent; final PsiExpression initializer = variable.getInitializer(); if (initializer == null) { return; } if (!(initializer instanceof PsiLiteralExpression)) { return; } registerError(lock); } }