Suppress Jackson 2 warnings

See gh-45535
This commit is contained in:
Phillip Webb
2025-05-13 11:42:25 -07:00
parent 5bdb0ecbb4
commit 02ee7fdb30
26 changed files with 34 additions and 2 deletions

View File

@@ -45,8 +45,7 @@ final class StandardGitHub implements GitHub {
@Override
public GitHubRepository getRepository(String organization, String name) {
RestTemplate restTemplate = new RestTemplate(
Collections.singletonList(new MappingJackson2HttpMessageConverter(new ObjectMapper())));
RestTemplate restTemplate = createRestTemplate();
restTemplate.getInterceptors().add((request, body, execution) -> {
request.getHeaders().add("User-Agent", StandardGitHub.this.username);
request.getHeaders()
@@ -61,4 +60,9 @@ final class StandardGitHub implements GitHub {
return new StandardGitHubRepository(restTemplate);
}
@SuppressWarnings("removal")
private RestTemplate createRestTemplate() {
return new RestTemplate(Collections.singletonList(new MappingJackson2HttpMessageConverter(new ObjectMapper())));
}
}