void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); final String referenceName = methodExpression.getReferenceName(); if (!logNames.contains(referenceName)) { return; } switch (warnLevel) { case 4: if ("debug".equals(referenceName)) return; case 3: if ("info".equals(referenceName)) return; case 2: if ("warn".equals(referenceName)) return; case 1: if ("error".equals(referenceName) || "fatal".equals(referenceName)) return; } final PsiMethod method = expression.resolveMethod(); if (method == null) { return; } final PsiClass containingClass = method.getContainingClass(); if (!InheritanceUtil.isInheritor(containingClass, "org.slf4j.Logger") && !InheritanceUtil.isInheritor(containingClass, "org.apache.logging.log4j.Logger") && !InheritanceUtil.isInheritor(containingClass, "org.apache.logging.log4j.LogBuilder")) { return; } final PsiExpressionList argumentList = expression.getArgumentList(); final PsiExpression[] arguments = argumentList.getExpressions(); if (arguments.length == 0) { return; } PsiExpression argument = arguments[0]; if (!ExpressionUtils.hasStringType(argument)) { if (arguments.length < 2) { return; } argument = arguments[1]; if (!ExpressionUtils.hasStringType(argument)) { return; } } if (!containsNonConstantConcatenation(argument)) { return; } registerMethodCallError(expression, argument); }