In my precondition checks on a constructor I want to check that a particular parameter is an instance of a particular class so I use code along the lines of
public MessageMapper(final Class clazz, final Object object)
{
if (!clazz.isAssignableFrom(object.getClass()))
throw new IllegalArgumentException("'object' must be instanceof 'clazz'");
This works great but this gives me the compilation warning
warning: [unchecked] unchecked call to isAssignableFrom(java.lang.Class<?>) as a member of the raw type java.lang.Class
and since I hate warnings I would like to get rid of it.
I don't see how though. What am I missing?