Skip to content

Commit a3c11fc

Browse files
committed
Clean up warnings in tests in Gradle build
1 parent 321de9a commit a3c11fc

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

spring-context/src/test/java/org/springframework/aop/framework/CglibProxyTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 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.
@@ -33,7 +33,6 @@
3333
import org.springframework.aop.testfixture.mixin.LockMixinAdvisor;
3434
import org.springframework.beans.testfixture.beans.ITestBean;
3535
import org.springframework.beans.testfixture.beans.TestBean;
36-
import org.springframework.context.ApplicationContext;
3736
import org.springframework.context.ApplicationContextException;
3837
import org.springframework.context.support.ClassPathXmlApplicationContext;
3938
import org.springframework.lang.NonNull;
@@ -52,7 +51,7 @@
5251
* @author Ramnivas Laddad
5352
* @author Chris Beams
5453
*/
55-
class CglibProxyTests extends AbstractAopProxyTests implements Serializable {
54+
class CglibProxyTests extends AbstractAopProxyTests {
5655

5756
private static final String DEPENDENCY_CHECK_CONTEXT =
5857
CglibProxyTests.class.getSimpleName() + "-with-dependency-checking.xml";
@@ -376,8 +375,9 @@ void testExceptionHandling() {
376375

377376
@Test
378377
void testWithDependencyChecking() {
379-
ApplicationContext ctx = new ClassPathXmlApplicationContext(DEPENDENCY_CHECK_CONTEXT, getClass());
380-
ctx.getBean("testBean");
378+
try (ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(DEPENDENCY_CHECK_CONTEXT, getClass())) {
379+
ctx.getBean("testBean");
380+
}
381381
}
382382

383383
@Test

spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 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.
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.aop.framework;
1818

19-
import java.io.Serializable;
20-
2119
import org.aopalliance.intercept.MethodInterceptor;
2220
import org.aopalliance.intercept.MethodInvocation;
2321
import org.junit.jupiter.api.Test;
@@ -38,7 +36,7 @@
3836
* @author Chris Beams
3937
* @since 13.03.2003
4038
*/
41-
class JdkDynamicProxyTests extends AbstractAopProxyTests implements Serializable {
39+
class JdkDynamicProxyTests extends AbstractAopProxyTests {
4240

4341
@Override
4442
protected Object createProxy(ProxyCreatorSupport as) {

spring-web/src/test/java/org/springframework/web/bind/support/DefaultDataBinderFactoryTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 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.
@@ -92,6 +92,7 @@ public void validate(Object target, Errors errors, Object... validationHints) {
9292
public void validate(Object target, Errors errors) {
9393
}
9494

95+
@SuppressWarnings("unchecked")
9596
@Override
9697
public <T> T unwrap(Class<T> type) {
9798
return (T) this.validator;

spring-webflux/src/test/java/org/springframework/web/reactive/BindingContextTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 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.
@@ -92,6 +92,7 @@ public void validate(Object target, Errors errors, Object... validationHints) {
9292
public void validate(Object target, Errors errors) {
9393
}
9494

95+
@SuppressWarnings("unchecked")
9596
@Override
9697
public <T> T unwrap(Class<T> type) {
9798
return (T) this.validator;

0 commit comments

Comments
 (0)