void (final PsiJavaCodeReferenceElement reference, final PsiType[] typeArguments, PsiCallExpression expression, final InspectionManager inspectionManager, final List<? super ProblemDescriptor> problems, boolean isOnTheFly) { PsiExpressionList argumentList = expression.getArgumentList(); if (argumentList == null) return; PsiReferenceParameterList typeArgumentList = expression.getTypeArgumentList(); for (PsiTypeElement typeElement : typeArgumentList.getTypeParameterElements()) { if (typeElement.getAnnotations().length > 0) { return; } } final JavaResolveResult resolveResult = reference.advancedResolve(false); final PsiElement element = resolveResult.getElement(); if (element instanceof PsiMethod method && resolveResult.isValidResult()) { final PsiTypeParameter[] typeParameters = method.getTypeParameters(); if (typeParameters.length > 0 && JavacQuirksInspectionVisitor.isSuspicious(expression.getArgumentList().getExpressions(), method)) { return; } if (typeParameters.length == typeArguments.length && PsiDiamondTypeUtil.areTypeArgumentsRedundant(typeArguments, expression, false, method, typeParameters) || typeParameters.length == 0) { String key = typeParameters.length == 0 ? "inspection.redundant.type.no.generics.problem.descriptor" : "inspection.redundant.type.problem.descriptor"; final ProblemDescriptor descriptor = inspectionManager.createProblemDescriptor(typeArgumentList, JavaAnalysisBundle.message(key), ourQuickFixAction, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, isOnTheFly); problems.add(descriptor); } } }