boolean (@Nullable PsiExpression expression, String logMethodName) { expression = PsiUtil.skipParenthesizedExprDown(expression); if (expression instanceof PsiMethodCallExpression methodCallExpression) { final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); final PsiExpression qualifier = methodExpression.getQualifierExpression(); if (!TypeUtils.expressionHasTypeOrSubtype(qualifier, loggerClassName)) { return false; } final String referenceName = methodExpression.getReferenceName(); if (referenceName == null) { return false; } final int index = logMethodNameList.indexOf(logMethodName); final String conditionName = logConditionMethodNameList.get(index); return conditionName.startsWith(referenceName); } else if (expression instanceof PsiPolyadicExpression polyadicExpression) { final PsiExpression[] operands = polyadicExpression.getOperands(); for (PsiExpression operand : operands) { if (isLogGuardCheck(operand, logMethodName)) { return true; } } } return false; }