AbstractRestClientOAuth2AccessTokenResponseClient has the following methods:
setParametersConverter(Converter<T, MultiValueMap<String, String>> parametersConverter)
addParametersConverter(Converter<T, MultiValueMap<String, String>> parametersConverter)
When I want to configure a RestClientClientCredentialsTokenResponseClient which extends AbstractRestClientOAuth2AccessTokenResponseClient with a NimbusJwtClientAuthenticationParametersConverter, I get jspecify warnings because NimbusJwtClientAuthenticationParametersConverter implements Converter<T, @Nullable MultiValueMap<String, String>>.
So AbstractRestClientOAuth2AccessTokenResponseClient.addParametersConverter() expects a Converter<T, MultiValueMap<String, String>> while NimbusJwtClientAuthenticationParametersConverter is a Converter<T, @Nullable MultiValueMap<String, String>>. The only difference is the @Nullable on the MultiValueMap.
I think AbstractRestClientOAuth2AccessTokenResponseClient should be adapted to use @Nullable as well as those methods check if the returned map is null anyway:
MultiValueMap<String, String> parametersToAdd = parametersConverter.convert(authorizationGrantRequest);
if (parametersToAdd != null) {
parameters.addAll(parametersToAdd);
}
AbstractRestClientOAuth2AccessTokenResponseClienthas the following methods:setParametersConverter(Converter<T, MultiValueMap<String, String>> parametersConverter)addParametersConverter(Converter<T, MultiValueMap<String, String>> parametersConverter)When I want to configure a
RestClientClientCredentialsTokenResponseClientwhich extendsAbstractRestClientOAuth2AccessTokenResponseClientwith aNimbusJwtClientAuthenticationParametersConverter, I get jspecify warnings becauseNimbusJwtClientAuthenticationParametersConverterimplementsConverter<T, @Nullable MultiValueMap<String, String>>.So
AbstractRestClientOAuth2AccessTokenResponseClient.addParametersConverter()expects aConverter<T, MultiValueMap<String, String>>whileNimbusJwtClientAuthenticationParametersConverteris aConverter<T, @Nullable MultiValueMap<String, String>>. The only difference is the@Nullableon theMultiValueMap.I think
AbstractRestClientOAuth2AccessTokenResponseClientshould be adapted to use@Nullableas well as those methods check if the returned map is null anyway: