Well, the compiler warning tells you everything you need to know. It doesn't know whether to treat null as a Class[] to pass directly into getMethod, or as a single null entry in a new Class[] array. I suspect you want the former behaviour, so cast the null to Class[]: