void (@NotNull PsiTypeElement typeElement) { PsiElement directParent = typeElement.getParent(); if (directParent instanceof PsiVariable && getSuggestedType((PsiVariable)directParent) != null) { reportProblem(typeElement); return; } final PsiType type = typeElement.getType(); if (!(type instanceof PsiClassType)) { return; } super.visitTypeElement(typeElement); if (ignoreUncompilable && directParent instanceof PsiTypeElement) { PsiType parentType = ((PsiTypeElement)directParent).getType(); if (parentType instanceof PsiArrayType) { if (PsiTreeUtil.skipParentsOfType(directParent, PsiTypeElement.class) instanceof PsiMethodReferenceExpression) { return; } } } final PsiElement parent = PsiTreeUtil.skipParentsOfType( typeElement, PsiTypeElement.class, PsiReferenceParameterList.class, PsiJavaCodeReferenceElement.class); if (parent instanceof PsiInstanceOfExpression || parent instanceof PsiClassObjectAccessExpression || parent instanceof PsiDeconstructionPattern) { return; } if (ignoreTypeCasts && parent instanceof PsiTypeCastExpression) { return; } if (PsiTreeUtil.getParentOfType(typeElement, PsiComment.class) != null) { return; } if (ignoreUncompilable && parent instanceof PsiAnnotationMethod) { // type of class type parameter cannot be parameterized if annotation method has default value final PsiAnnotationMemberValue defaultValue = ((PsiAnnotationMethod)parent).getDefaultValue(); if (defaultValue != null && directParent instanceof PsiTypeElement) { return; } } if (parent instanceof PsiParameter parameter) { final PsiElement declarationScope = parameter.getDeclarationScope(); if (declarationScope instanceof PsiMethod method) { if (ignoreParametersOfOverridingMethods) { if (MethodUtils.getSuper(method) != null || MethodCallUtils.isUsedAsSuperConstructorCallArgument(parameter, false)) { return; } } else if (ignoreUncompilable && (LibraryUtil.isOverrideOfLibraryMethod(method) || MethodCallUtils.isUsedAsSuperConstructorCallArgument(parameter, true))) { return; } } } final PsiJavaCodeReferenceElement referenceElement = typeElement.getInnermostComponentReferenceElement(); checkReferenceElement(referenceElement); }