void (@NotNull PsiMethodCallExpression call) { String methodName = call.getMethodExpression().getReferenceName(); if (!"get".equals(methodName) && !"getLong".equals(methodName) && !"with".equals(methodName) && !"plus".equals(methodName) && !"minus".equals(methodName)) { return; } if (!myMatcher.test(call)) { return; } PsiMethod method = call.resolveMethod(); if (method == null) return; int fieldArgumentIndex = 1; if ("get".equals(methodName) || "getLong".equals(methodName) || "with".equals(methodName)) { fieldArgumentIndex = 0; } PsiExpression[] expressions = call.getArgumentList().getExpressions(); if (expressions.length < fieldArgumentIndex + 1) { return; } @Nullable PsiExpression fieldExpression = expressions[fieldArgumentIndex]; if (fieldExpression == null) return; CommonDataflow.DataflowResult dataflowResult = CommonDataflow.getDataflowResult(fieldExpression); if (dataflowResult == null) return; Set<Object> values = dataflowResult.getExpressionValues(fieldExpression); Set<PsiEnumConstant> enumConstants = new HashSet<>(); for (Object value : values) { if (value instanceof PsiEnumConstant enumConstant) { enumConstants.add(enumConstant); } else { return; } } List<PsiEnumConstant> unsupportedEnums = getUnsupportedEnums(enumConstants, method); if (unsupportedEnums == null) { return; } if (!unsupportedEnums.isEmpty()) { registerProblems(unsupportedEnums, fieldExpression, holder); } }