Skip to content

Commit 5b3edcd

Browse files
committed
Spring Cleaning in December
- Delete unused imports - Delete unused code - Clean up warnings
1 parent 0e68d2e commit 5b3edcd

File tree

36 files changed

+61
-128
lines changed

36 files changed

+61
-128
lines changed

spring-aspects/src/main/java/org/springframework/scheduling/aspectj/AbstractAsyncExecutionAspect.aj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ import org.aspectj.lang.annotation.SuppressAjWarnings;
2424
import org.aspectj.lang.reflect.MethodSignature;
2525

2626
import org.springframework.aop.interceptor.AsyncExecutionAspectSupport;
27-
import org.springframework.core.task.AsyncListenableTaskExecutor;
2827
import org.springframework.core.task.AsyncTaskExecutor;
29-
import org.springframework.util.concurrent.ListenableFuture;
3028

3129
/**
3230
* Abstract aspect that routes selected methods asynchronously.

spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.beans.factory.support;
1818

1919
import java.lang.reflect.Method;
20-
import java.util.HashSet;
2120
import java.util.LinkedHashSet;
2221
import java.util.Set;
2322

spring-context/src/main/java/org/springframework/format/datetime/standard/PeriodFormatter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.format.datetime.standard;
1818

1919
import java.text.ParseException;
20-
import java.time.Instant;
2120
import java.time.Period;
2221
import java.util.Locale;
2322

spring-context/src/test/java/org/springframework/cache/config/ExpressionCachingIntegrationTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ private User(String id) {
9292
this.id = id;
9393
}
9494

95+
@SuppressWarnings("unused")
9596
public String getId() {
9697
return id;
9798
}
@@ -104,6 +105,7 @@ private Order(String id) {
104105
this.id = id;
105106
}
106107

108+
@SuppressWarnings("unused")
107109
public String getId() {
108110
return id;
109111
}

spring-context/src/test/java/org/springframework/context/event/AbstractApplicationEventListenerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ public void onApplicationEvent(GenericTestEvent<String> event) {
117117
}
118118
}
119119

120+
@SuppressWarnings("rawtypes")
120121
static class RawApplicationListener implements ApplicationListener {
121122
@Override
122123
public void onApplicationEvent(ApplicationEvent event) {
123124
}
124125
}
125126

126-
@SuppressWarnings("unused")
127127
static class TestEvents {
128128

129129
public ApplicationEvent applicationEvent;

spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor t
101101
}
102102
}
103103
else if (member instanceof Constructor) {
104-
Constructor<?> ctor = (Constructor) member;
104+
Constructor<?> ctor = (Constructor<?>) member;
105105
return ctor.newInstance(source);
106106
}
107107
}
@@ -155,7 +155,7 @@ private static boolean isApplicable(Member member, Class<?> sourceClass) {
155155
method.getParameterTypes()[0] == sourceClass);
156156
}
157157
else if (member instanceof Constructor) {
158-
Constructor<?> ctor = (Constructor) member;
158+
Constructor<?> ctor = (Constructor<?>) member;
159159
return (ctor.getParameterTypes()[0] == sourceClass);
160160
}
161161
else {

spring-core/src/test/java/org/springframework/core/convert/support/DefaultConversionServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,9 @@ public ListWrapper convert(List source) {
561561
}
562562

563563
@Test
564-
@SuppressWarnings("unchecked")
564+
@SuppressWarnings("rawtypes")
565565
public void convertObjectToCollection() {
566-
List<String> result = (List<String>) conversionService.convert(3L, List.class);
566+
List result = conversionService.convert(3L, List.class);
567567
assertEquals(1, result.size());
568568
assertEquals(3L, result.get(0));
569569
}

spring-core/src/test/java/org/springframework/util/xml/AbstractStaxHandlerTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void noNamespacePrefixes() throws Exception {
8282

8383
private static boolean wwwSpringframeworkOrgIsAccessible() {
8484
try {
85-
new Socket("www.springframework.org", 80);
85+
new Socket("www.springframework.org", 80).close();
8686
}
8787
catch (Exception e) {
8888
return false;

spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/DefaultLobHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ public Reader getClobAsCharacterStream(ResultSet rs, int columnIndex) throws SQL
207207
}
208208

209209
@Override
210-
@SuppressWarnings("resource")
211210
public LobCreator getLobCreator() {
212211
return (this.createTemporaryLob ? new TemporaryLobCreator() : new DefaultLobCreator());
213212
}

spring-jms/src/test/java/org/springframework/jms/config/JmsListenerContainerFactoryIntegrationTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.jms.config;
1818

1919
import java.lang.reflect.Method;
20-
import java.util.Arrays;
2120
import java.util.HashMap;
2221
import java.util.Map;
2322
import javax.jms.JMSException;

0 commit comments

Comments
 (0)