void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); final String referenceName = methodExpression.getReferenceName(); if (!logMethodNameList.contains(referenceName)) { return; } final PsiExpression qualifier = methodExpression.getQualifierExpression(); if (!TypeUtils.expressionHasTypeOrSubtype(qualifier, loggerClassName)) { return; } if (isSurroundedByLogGuard(expression, referenceName)) { return; } final PsiExpressionList argumentList = expression.getArgumentList(); final PsiExpression[] arguments = argumentList.getExpressions(); if (arguments.length == 0) { return; } if (!flagAllUnguarded) { boolean constant = true; for (PsiExpression argument : arguments) { argument = PsiUtil.skipParenthesizedExprDown(argument); if (argument instanceof PsiLambdaExpression || argument instanceof PsiMethodReferenceExpression) { continue; } if (!PsiUtil.isConstantExpression(argument)) { constant = false; break; } } if (constant) { return; } } registerMethodCallError(expression); }