void (PsiExpression array, PsiExpression element) { PsiType arrayType = array.getType(); PsiType elementType = element.getType(); if (elementType == null || !(arrayType instanceof PsiArrayType)) return; PsiType arrayElementType = ((PsiArrayType)arrayType).getComponentType(); // incompatible primitive array will be reported anyways as compilation error if (arrayElementType instanceof PsiPrimitiveType) return; elementType = TypeConversionUtil.erasure(elementType); arrayElementType = TypeConversionUtil.erasure(arrayElementType); if (!TypeConversionUtil.areTypesConvertible(elementType, arrayElementType)) { holder.registerProblem(element, JavaAnalysisBundle.message("inspection.suspicious.array.method.call.problem.element")); } }