Skip to content

Commit 911d1f2

Browse files
committed
Suppress warnings
1 parent e9997d4 commit 911d1f2

File tree

16 files changed

+32
-9
lines changed

16 files changed

+32
-9
lines changed

spring-context/src/test/java/org/springframework/context/annotation/Gh29105Tests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ void beanProviderWithParentContextReuseOrder() {
4747
List<Class<?>> orderedTypes = child.getBeanProvider(MyService.class)
4848
.orderedStream().map(Object::getClass).collect(Collectors.toList());
4949
assertThat(orderedTypes).containsExactly(CustomService.class, DefaultService.class);
50+
parent.close();
51+
child.close();
5052
}
5153

5254

@@ -78,4 +80,5 @@ DefaultService defaultService() {
7880
}
7981

8082
}
83+
8184
}

spring-core/src/main/java/org/springframework/aot/hint/ReflectionHints.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public ReflectionHints registerConstructor(Constructor<?> constructor, Executabl
210210
* @deprecated in favor of {@link #registerConstructor(Constructor, ExecutableMode)}
211211
*/
212212
@Deprecated
213+
@SuppressWarnings("deprecation")
213214
public ReflectionHints registerConstructor(Constructor<?> constructor, Consumer<ExecutableHint.Builder> constructorHint) {
214215
return registerType(TypeReference.of(constructor.getDeclaringClass()),
215216
typeHint -> typeHint.withConstructor(mapParameters(constructor), constructorHint));
@@ -247,7 +248,7 @@ public ReflectionHints registerMethod(Method method, ExecutableMode mode) {
247248
* @deprecated in favor of {@link #registerMethod(Method, ExecutableMode)}
248249
*/
249250
@Deprecated
250-
251+
@SuppressWarnings("deprecation")
251252
public ReflectionHints registerMethod(Method method, Consumer<ExecutableHint.Builder> methodHint) {
252253
return registerType(TypeReference.of(method.getDeclaringClass()),
253254
typeHint -> typeHint.withMethod(method.getName(), mapParameters(method), methodHint));

spring-web/src/test/java/org/springframework/http/client/support/InterceptingHttpAccessorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,7 +30,6 @@
3030

3131
import static org.assertj.core.api.Assertions.assertThat;
3232

33-
3433
/**
3534
* Tests for {@link InterceptingHttpAccessor}.
3635
*
@@ -40,6 +39,7 @@ public class InterceptingHttpAccessorTests {
4039

4140
@Test
4241
public void getInterceptors() {
42+
@SuppressWarnings("resource")
4343
TestInterceptingHttpAccessor accessor = new TestInterceptingHttpAccessor();
4444
List<ClientHttpRequestInterceptor> interceptors = Arrays.asList(
4545
new SecondClientHttpRequestInterceptor(),

spring-web/src/test/java/org/springframework/http/server/reactive/AsyncIntegrationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ void basicTest(HttpServer httpServer) throws Exception {
5252
startServer(httpServer);
5353

5454
URI url = new URI("http://localhost:" + port);
55+
@SuppressWarnings("resource")
5556
ResponseEntity<String> response = new RestTemplate().exchange(RequestEntity.get(url).build(), String.class);
5657

5758
assertThat(response.getBody()).isEqualTo("hello");

spring-web/src/test/java/org/springframework/http/server/reactive/CookieIntegrationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public void basicTest(HttpServer httpServer) throws Exception {
5353

5454
URI url = new URI("http://localhost:" + port);
5555
String header = "SID=31d4d96e407aad42; lang=en-US";
56+
@SuppressWarnings("resource")
5657
ResponseEntity<Void> response = new RestTemplate().exchange(
5758
RequestEntity.get(url).header("Cookie", header).build(), Void.class);
5859

spring-web/src/test/java/org/springframework/http/server/reactive/EchoHandlerIntegrationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,6 +49,7 @@ protected EchoHandler createHttpHandler() {
4949
public void echo(HttpServer httpServer) throws Exception {
5050
startServer(httpServer);
5151

52+
@SuppressWarnings("resource")
5253
RestTemplate restTemplate = new RestTemplate();
5354

5455
byte[] body = randomBytes();

spring-web/src/test/java/org/springframework/http/server/reactive/ErrorHandlerIntegrationTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ protected HttpHandler createHttpHandler() {
4949
void responseBodyError(HttpServer httpServer) throws Exception {
5050
startServer(httpServer);
5151

52+
@SuppressWarnings("resource")
5253
RestTemplate restTemplate = new RestTemplate();
5354
restTemplate.setErrorHandler(NO_OP_ERROR_HANDLER);
5455

@@ -62,6 +63,7 @@ void responseBodyError(HttpServer httpServer) throws Exception {
6263
void handlingError(HttpServer httpServer) throws Exception {
6364
startServer(httpServer);
6465

66+
@SuppressWarnings("resource")
6567
RestTemplate restTemplate = new RestTemplate();
6668
restTemplate.setErrorHandler(NO_OP_ERROR_HANDLER);
6769

@@ -75,6 +77,7 @@ void handlingError(HttpServer httpServer) throws Exception {
7577
void emptyPathSegments(HttpServer httpServer) throws Exception {
7678
startServer(httpServer);
7779

80+
@SuppressWarnings("resource")
7881
RestTemplate restTemplate = new RestTemplate();
7982
restTemplate.setErrorHandler(NO_OP_ERROR_HANDLER);
8083

spring-web/src/test/java/org/springframework/http/server/reactive/MultipartIntegrationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,6 +57,7 @@ protected HttpHandler createHttpHandler() {
5757
void getFormParts(HttpServer httpServer) throws Exception {
5858
startServer(httpServer);
5959

60+
@SuppressWarnings("resource")
6061
RestTemplate restTemplate = new RestTemplate();
6162
RequestEntity<MultiValueMap<String, Object>> request = RequestEntity
6263
.post(new URI("http://localhost:" + port + "/form-parts"))

spring-web/src/test/java/org/springframework/http/server/reactive/RandomHandlerIntegrationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -59,6 +59,7 @@ void random(HttpServer httpServer) throws Exception {
5959

6060
// TODO: fix Reactor support
6161

62+
@SuppressWarnings("resource")
6263
RestTemplate restTemplate = new RestTemplate();
6364

6465
byte[] body = randomBytes();

spring-web/src/test/java/org/springframework/http/server/reactive/ServerHttpRequestIntegrationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void checkUri(HttpServer httpServer) throws Exception {
4646

4747
URI url = new URI("http://localhost:" + port + "/foo?param=bar");
4848
RequestEntity<Void> request = RequestEntity.post(url).build();
49+
@SuppressWarnings("resource")
4950
ResponseEntity<Void> response = new RestTemplate().exchange(request, Void.class);
5051
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
5152
}

0 commit comments

Comments
 (0)