Late binding: supportsParameter is not newInstance

newInstance should not call supportsParameter since they're not the same
thing. It is type-specific how the parameter is used, so it's not
necessarily the parameter used for the constructor.

The constructor type supplied to newInstance is only used for CertStore,
but CertStore does not support the supportsParameter call. This was
causing CertStore-related tests to fail since newInstance called into
supportsParameter.

Additionally, to make sure we throw the correct exceptions, we need to
keep a list of valid parameters for all the types we know about. Right
now this just means moving the special case that existed before into a
HashMap and adding null entries for the other types we know about.
Adding the null types allows the disambiguation from types we don't know
about so we can throw an exception when a constructor parameter is
supplied to a type that should not take one.

Change-Id: Ia1755481df1bfa9f76dc4cf7eee5c966a8019396
2 files changed