Skip to content

Commit 01491be

Browse files
committed
Merge pull request #17825 from dreis2211
* pr/17825: Polish some Collections API calls Closes gh-17825
2 parents 6921e24 + b605cdd commit 01491be

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/JndiPropertiesHidingClassLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public JndiPropertiesHidingClassLoader(ClassLoader parent) {
3636
@Override
3737
public Enumeration<URL> getResources(String name) throws IOException {
3838
if ("jndi.properties".equals(name)) {
39-
return Collections.enumeration(Collections.emptyList());
39+
return Collections.emptyEnumeration();
4040
}
4141
return super.getResources(name);
4242
}

spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public Entry next() {
173173
private Iterator<File> listFiles(File file) {
174174
File[] files = file.listFiles();
175175
if (files == null) {
176-
return Collections.<File>emptyList().iterator();
176+
return Collections.emptyIterator();
177177
}
178178
Arrays.sort(files, this.entryComparator);
179179
return Arrays.asList(files).iterator();

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void servletContextPropertySourceIsAvailablePriorToRefresh() {
129129
given(servletContext.getInitParameterNames())
130130
.willReturn(Collections.enumeration(Collections.singletonList("spring.profiles.active")));
131131
given(servletContext.getInitParameter("spring.profiles.active")).willReturn("from-servlet-context");
132-
given(servletContext.getAttributeNames()).willReturn(Collections.enumeration(Collections.emptyList()));
132+
given(servletContext.getAttributeNames()).willReturn(Collections.emptyEnumeration());
133133
try (ConfigurableApplicationContext context = (ConfigurableApplicationContext) new PropertySourceVerifyingSpringBootServletInitializer()
134134
.createRootApplicationContext(servletContext)) {
135135
assertThat(context.getEnvironment().getActiveProfiles()).containsExactly("from-servlet-context");

0 commit comments

Comments
 (0)