Skip to content

Commit 02ee7fd

Browse files
committed
Suppress Jackson 2 warnings
See gh-45535
1 parent 5bdb0ec commit 02ee7fd

File tree

26 files changed

+34
-2
lines changed

26 files changed

+34
-2
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHub.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ final class StandardGitHub implements GitHub {
4545

4646
@Override
4747
public GitHubRepository getRepository(String organization, String name) {
48-
RestTemplate restTemplate = new RestTemplate(
49-
Collections.singletonList(new MappingJackson2HttpMessageConverter(new ObjectMapper())));
48+
RestTemplate restTemplate = createRestTemplate();
5049
restTemplate.getInterceptors().add((request, body, execution) -> {
5150
request.getHeaders().add("User-Agent", StandardGitHub.this.username);
5251
request.getHeaders()
@@ -61,4 +60,9 @@ public GitHubRepository getRepository(String organization, String name) {
6160
return new StandardGitHubRepository(restTemplate);
6261
}
6362

63+
@SuppressWarnings("removal")
64+
private RestTemplate createRestTemplate() {
65+
return new RestTemplate(Collections.singletonList(new MappingJackson2HttpMessageConverter(new ObjectMapper())));
66+
}
67+
6468
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jackson/JacksonEndpointAutoConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
*/
3939
@Configuration(proxyBeanMethods = false)
4040
@AutoConfigureAfter(JacksonAutoConfiguration.class)
41+
@SuppressWarnings("removal")
4142
public class JacksonEndpointAutoConfiguration {
4243

4344
@Bean

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/reactive/WebFluxEndpointManagementContextConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ private void process(ServerCodecConfigurer configurer) {
180180
}
181181
}
182182

183+
@SuppressWarnings("removal")
183184
private void process(Encoder<?> encoder) {
184185
if (encoder instanceof Jackson2JsonEncoder jackson2JsonEncoder) {
185186
jackson2JsonEncoder.registerObjectMappersForType(OperationResponseBody.class, (associations) -> {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ static EndpointObjectMapperWebMvcConfigurer endpointObjectMapperWebMvcConfigurer
151151
* {@link OperationResponseBody} to {@link MappingJackson2HttpMessageConverter}
152152
* instances.
153153
*/
154+
@SuppressWarnings("removal")
154155
static class EndpointObjectMapperWebMvcConfigurer implements WebMvcConfigurer {
155156

156157
private static final List<MediaType> MEDIA_TYPES = Collections
@@ -171,6 +172,7 @@ public void configureMessageConverters(List<HttpMessageConverter<?>> converters)
171172
}
172173
}
173174

175+
@SuppressWarnings("removal")
174176
private void configure(MappingJackson2HttpMessageConverter converter) {
175177
converter.registerObjectMappersForType(OperationResponseBody.class, (associations) -> {
176178
ObjectMapper objectMapper = this.endpointObjectMapper.get();

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/EndpointObjectMapperConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* @author Phillip Webb
3838
*/
3939
@Configuration
40+
@SuppressWarnings("removal")
4041
class EndpointObjectMapperConfiguration {
4142

4243
@Bean

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void nullType() {
7171
}
7272

7373
@Test
74+
@SuppressWarnings("removal")
7475
void jsonFormat() throws Exception {
7576
AuditEvent event = new AuditEvent("johannes", "UNKNOWN",
7677
Collections.singletonMap("type", (Object) "BadCredentials"));

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public void run() {
164164
/**
165165
* Early initializer for Jackson.
166166
*/
167+
@SuppressWarnings("removal")
167168
private static final class JacksonInitializer implements Runnable {
168169

169170
@Override

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
@ConditionalOnClass(RepositoryRestMvcConfiguration.class)
5454
@EnableConfigurationProperties(RepositoryRestProperties.class)
5555
@Import(RepositoryRestMvcConfiguration.class)
56+
@SuppressWarnings("removal")
5657
public class RepositoryRestMvcAutoConfiguration {
5758

5859
@Bean

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/SpringBootRepositoryRestConfigurer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* @author Stephane Nicoll
3535
*/
3636
@Order(0)
37+
@SuppressWarnings("removal")
3738
class SpringBootRepositoryRestConfigurer implements RepositoryRestConfigurer {
3839

3940
private final Jackson2ObjectMapperBuilder objectMapperBuilder;

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/rsocket/GraphQlRSocketAutoConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class GraphQlRSocketAutoConfiguration {
5454

5555
@Bean
5656
@ConditionalOnMissingBean
57+
@SuppressWarnings("removal")
5758
public GraphQlRSocketHandler graphQlRSocketHandler(ExecutionGraphQlService graphQlService,
5859
ObjectProvider<RSocketGraphQlInterceptor> interceptors, ObjectMapper objectMapper) {
5960
return new GraphQlRSocketHandler(graphQlService, interceptors.orderedStream().toList(),

0 commit comments

Comments
 (0)