void (@NotNull HighlightInfo.Builder info, @Nullable PsiType fromType, @Nullable PsiType toType, @NotNull PsiExpression expression) { if (toType instanceof PsiArrayType) { PsiType arrayComponentType = ((PsiArrayType)toType).getComponentType(); if (!(arrayComponentType instanceof PsiPrimitiveType) && !(PsiUtil.resolveClassInType(arrayComponentType) instanceof PsiTypeParameter)) { PsiExpression collection = expression; if (expression instanceof PsiMethodCallExpression call && COLLECTION_TO_ARRAY.test(call)) { collection = call.getMethodExpression().getQualifierExpression(); if (collection == null) return; fromType = collection.getType(); } if (fromType instanceof PsiClassType && (CommonClassNames.JAVA_LANG_OBJECT.equals(arrayComponentType.getCanonicalText()) || !((PsiClassType)fromType).isRaw()) && InheritanceUtil.isInheritor(fromType, CommonClassNames.JAVA_UTIL_COLLECTION)) { PsiType collectionItemType = JavaGenericsUtil.getCollectionItemType(fromType, expression.getResolveScope()); if (collectionItemType != null && arrayComponentType.isConvertibleFrom(collectionItemType)) { IntentionAction action = QuickFixFactory.getInstance().createCollectionToArrayFix(collection, expression, (PsiArrayType)toType); info.registerFix(action, null, null, null, null); } } } } }