void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); if (expression.getTypeArguments().length == 0) { PsiExpression[] args = expression.getArgumentList().getExpressions(); JavaResolveResult resolveResult = expression.resolveMethodGenerics(); if (resolveResult instanceof MethodCandidateInfo) { PsiMethod method = ((MethodCandidateInfo)resolveResult).getElement(); PsiSubstitutor substitutor = resolveResult.getSubstitutor(); if (PsiUtil.isLanguageLevel8OrHigher(expression) && method.isVarArgs() && method.hasTypeParameters() && args.length > method.getParameterList().getParametersCount() + 50) { for (PsiTypeParameter typeParameter : method.getTypeParameters()) { if (!PsiTypesUtil.isDenotableType(substitutor.substitute(typeParameter), expression)) { return; } } if (isSuspicious(args, method)) { myHolder.registerProblem(expression.getMethodExpression(), JavaAnalysisBundle.message("vararg.method.call.with.50.poly.arguments"), new MyAddExplicitTypeArgumentsFix()); } } if (resolveResult.isValidResult()) { for (PsiType value : substitutor.getSubstitutionMap().values()) { if (value instanceof PsiIntersectionType) { PsiClass aClass = Arrays.stream(((PsiIntersectionType)value).getConjuncts()) .map(PsiUtil::resolveClassInClassTypeOnly) .filter(_aClass -> _aClass != null && _aClass.hasModifierProperty(PsiModifier.FINAL)) .findFirst().orElse(null); if (aClass != null && aClass.hasModifierProperty(PsiModifier.FINAL)) { for (PsiType conjunct : ((PsiIntersectionType)value).getConjuncts()) { PsiClass currentClass = PsiUtil.resolveClassInClassTypeOnly(conjunct); if (currentClass != null && !aClass.equals(currentClass) && !aClass.isInheritor(currentClass, true)) { final String descriptionTemplate = JavaAnalysisBundle.message("inspection.message.javac.quick.intersection.type.problem", value.getPresentableText(), ObjectUtils.notNull(aClass.getQualifiedName(), Objects.requireNonNull(aClass.getName()))); myHolder.registerProblem(expression.getMethodExpression(), descriptionTemplate); } } break; } } } } } } }