Describe the bug
When use java.util.List.of(), ProviderManager#checkState() throws NullPointerException.
checkState() uses List#contains(null) since https://github.com/spring-projects/spring-security/issues/7713#issuecomment-569741294, but it may throws NullPointerException:
NullPointerException - if the specified element is null and this list does not permit null elements (optional)
To Reproduce
new ProviderManager(List.of(myProvider));
Expected behavior
NPE is not thrown.
Comment From: jzheaux
@yukihane thank you for the suggestion that the exception be refined. It's a nice improvement to be able to replace an NPE with a more helpful error message.
Would you be interested in submitting a PR to change this check into a for loop?