void (@NotNull PsiMethodCallExpression methodCall, @NotNull ProblemsHolder holder) { PsiExpression[] arguments = methodCall.getArgumentList().getExpressions(); PsiExpression argument = null; ReflectiveType serviceType = null; for (int i = 0; i < arguments.length && serviceType == null; i++) { argument = arguments[i]; serviceType = JavaReflectionReferenceUtil.getReflectiveType(argument); } if (serviceType != null && serviceType.isExact()) { PsiClass psiClass = serviceType.getPsiClass(); if (psiClass != null) { String qualifiedName = psiClass.getQualifiedName(); if (qualifiedName != null) { PsiJavaModule module = JavaModuleGraphUtil.findDescriptorByElement(argument); if (module != null && isUndeclaredUsage(module, psiClass)) { holder.problem(argument, JavaBundle.message("inspection.undeclared.service.usage.message", qualifiedName)) .fix(new AddUsesDirectiveFix(module, qualifiedName)).register(); } } } } }