void (PsiElement context, PsiExpression array1, PsiExpression array2) { PsiType array1Type = array1.getType(); PsiType array2Type = array2.getType(); if (!(array1Type instanceof PsiArrayType) || !(array2Type instanceof PsiArrayType)) return; PsiType array1ElementType = ((PsiArrayType)array1Type).getComponentType(); PsiType array2ElementType = ((PsiArrayType)array2Type).getComponentType(); // incompatible primitive array will be reported anyways as compilation error if (array1ElementType instanceof PsiPrimitiveType || array2ElementType instanceof PsiPrimitiveType) return; array1ElementType = TypeConversionUtil.erasure(array1ElementType); array2ElementType = TypeConversionUtil.erasure(array2ElementType); if (!TypeConversionUtil.areTypesConvertible(array1ElementType, array2ElementType) || !TypeConversionUtil.areTypesConvertible(array2ElementType, array1ElementType)) { holder.registerProblem(context, JavaAnalysisBundle.message("inspection.suspicious.array.method.call.problem.arrays")); } }