void (@NotNull PsiMethodCallExpression invokeCall, @Nullable ReflectiveType expectedType, ProblemsHolder holder) { final PsiExpressionList argumentList = invokeCall.getArgumentList(); final PsiExpression[] arguments = argumentList.getExpressions(); if (arguments.length == 0) return; final PsiExpression receiverArgument = arguments[0]; LOG.assertTrue(receiverArgument != null); final PsiExpression receiverDefinition = findDefinition(receiverArgument); if (ExpressionUtils.isNullLiteral(receiverDefinition)) { holder.registerProblem(receiverArgument, JavaBundle.message("inspection.reflect.handle.invocation.receiver.null")); return; } if (expectedType != null) { if (!isCompatible(expectedType.getType(), receiverArgument.getType())) { holder.registerProblem(receiverArgument, JavaBundle.message("inspection.reflect.handle.invocation.receiver.incompatible", expectedType.getQualifiedName())); } else if (receiverArgument != receiverDefinition && receiverDefinition != null) { if (!isCompatible(expectedType.getType(), receiverDefinition.getType())) { holder.registerProblem(receiverArgument, JavaBundle.message("inspection.reflect.handle.invocation.receiver.incompatible", expectedType.getQualifiedName())); } } } }