Skip to content

Commit dac18a3

Browse files
committed
Clean up warnings in Gradle build
1 parent 77f7da0 commit dac18a3

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ class AspectProxyFactoryTests {
4141
@Test
4242
void testWithNonAspect() {
4343
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new TestBean());
44-
assertThatIllegalArgumentException().isThrownBy(() ->
45-
proxyFactory.addAspect(TestBean.class));
44+
assertThatIllegalArgumentException().isThrownBy(() -> proxyFactory.addAspect(TestBean.class));
4645
}
4746

4847
@Test
@@ -78,8 +77,7 @@ void testWithPerThisAspect() {
7877
@Test
7978
void testWithInstanceWithNonAspect() {
8079
AspectJProxyFactory pf = new AspectJProxyFactory();
81-
assertThatIllegalArgumentException().isThrownBy(() ->
82-
pf.addAspect(new TestBean()));
80+
assertThatIllegalArgumentException().isThrownBy(() -> pf.addAspect(new TestBean()));
8381
}
8482

8583
@Test
@@ -119,6 +117,7 @@ void testWithNonSingletonAspectInstance() {
119117
}
120118

121119
@Test // SPR-13328
120+
@SuppressWarnings("unchecked")
122121
public void testProxiedVarargsWithEnumArray() {
123122
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new TestBean());
124123
proxyFactory.addAspect(LoggingAspectOnVarargs.class);
@@ -127,6 +126,7 @@ public void testProxiedVarargsWithEnumArray() {
127126
}
128127

129128
@Test // SPR-13328
129+
@SuppressWarnings("unchecked")
130130
public void testUnproxiedVarargsWithEnumArray() {
131131
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new TestBean());
132132
proxyFactory.addAspect(LoggingAspectOnSetter.class);

spring-web/src/test/java/org/springframework/http/converter/FormHttpMessageConverterTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ void addSupportedMediaTypes() {
119119
}
120120

121121
@Test
122+
@SuppressWarnings("unchecked")
122123
void readFormMultiValue() throws Exception {
123124
String body = "name+1=value+1&name+2=value+2%2B1&name+2=value+2%2B2&name+3";
124125
MockHttpInputMessage inputMessage = new MockHttpInputMessage(body.getBytes(StandardCharsets.ISO_8859_1));
@@ -134,7 +135,7 @@ void readFormMultiValue() throws Exception {
134135
}
135136

136137
@Test
137-
@SuppressWarnings("rawtypes")
138+
@SuppressWarnings({ "rawtypes", "unchecked" })
138139
void readFormSingleValue() throws Exception {
139140
String body = "name+1=value+1&name+2=value+2%2B1&name+2=value+2%2B2&name+3";
140141
MockHttpInputMessage inputMessage = new MockHttpInputMessage(body.getBytes(StandardCharsets.ISO_8859_1));

spring-web/src/test/java/org/springframework/web/context/request/RequestAttributesThreadLocalAccessorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ private static Stream<Arguments> propagation() {
5858
@MethodSource
5959
@SuppressWarnings({ "try", "unused" })
6060
void propagation(RequestAttributes previousRequest, RequestAttributes currentRequest) throws Exception {
61-
6261
ContextSnapshot snapshot = getSnapshotFor(currentRequest);
6362

6463
AtomicReference<RequestAttributes> requestInScope = new AtomicReference<>();
@@ -80,6 +79,7 @@ void propagation(RequestAttributes previousRequest, RequestAttributes currentReq
8079
}
8180

8281
@Test
82+
@SuppressWarnings("try")
8383
void accessAfterRequestMarkedCompleted() {
8484
MockHttpServletRequest servletRequest = new MockHttpServletRequest();
8585
servletRequest.setAttribute("k1", "v1");
@@ -100,8 +100,8 @@ void accessAfterRequestMarkedCompleted() {
100100
}
101101

102102
@Test
103+
@SuppressWarnings("try")
103104
void accessBeforeRequestMarkedCompleted() {
104-
105105
MockHttpServletRequest servletRequest = new MockHttpServletRequest();
106106
ServletRequestAttributes previous = new ServletRequestAttributes(servletRequest, new MockHttpServletResponse());
107107

spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/bootstrap/ReactorHttpsServer.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -19,9 +19,11 @@
1919
import java.net.InetSocketAddress;
2020
import java.util.concurrent.atomic.AtomicReference;
2121

22+
import io.netty.handler.ssl.SslContextBuilder;
2223
import io.netty.handler.ssl.util.SelfSignedCertificate;
2324
import reactor.netty.DisposableServer;
2425
import reactor.netty.http.Http11SslContextSpec;
26+
import reactor.netty.tcp.SslProvider.GenericSslContextSpec;
2527

2628
import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter;
2729

@@ -40,7 +42,8 @@ public class ReactorHttpsServer extends AbstractHttpServer {
4042
@Override
4143
protected void initServer() throws Exception {
4244
SelfSignedCertificate cert = new SelfSignedCertificate();
43-
Http11SslContextSpec http11SslContextSpec = Http11SslContextSpec.forServer(cert.certificate(), cert.privateKey());
45+
GenericSslContextSpec<SslContextBuilder> http11SslContextSpec =
46+
Http11SslContextSpec.forServer(cert.certificate(), cert.privateKey());
4447

4548
this.reactorHandler = createHttpHandlerAdapter();
4649
this.reactorServer = reactor.netty.http.server.HttpServer.create()

0 commit comments

Comments
 (0)