Commit b605cddb authored by dreis2211's avatar dreis2211 Committed by Stephane Nicoll

Polish some Collections API calls

See gh-17825
parent 6921e240
......@@ -36,7 +36,7 @@ public class JndiPropertiesHidingClassLoader extends ClassLoader {
@Override
public Enumeration<URL> getResources(String name) throws IOException {
if ("jndi.properties".equals(name)) {
return Collections.enumeration(Collections.emptyList());
return Collections.emptyEnumeration();
}
return super.getResources(name);
}
......
......@@ -173,7 +173,7 @@ public class ExplodedArchive implements Archive {
private Iterator<File> listFiles(File file) {
File[] files = file.listFiles();
if (files == null) {
return Collections.<File>emptyList().iterator();
return Collections.emptyIterator();
}
Arrays.sort(files, this.entryComparator);
return Arrays.asList(files).iterator();
......
......@@ -129,7 +129,7 @@ class SpringBootServletInitializerTests {
given(servletContext.getInitParameterNames())
.willReturn(Collections.enumeration(Collections.singletonList("spring.profiles.active")));
given(servletContext.getInitParameter("spring.profiles.active")).willReturn("from-servlet-context");
given(servletContext.getAttributeNames()).willReturn(Collections.enumeration(Collections.emptyList()));
given(servletContext.getAttributeNames()).willReturn(Collections.emptyEnumeration());
try (ConfigurableApplicationContext context = (ConfigurableApplicationContext) new PropertySourceVerifyingSpringBootServletInitializer()
.createRootApplicationContext(servletContext)) {
assertThat(context.getEnvironment().getActiveProfiles()).containsExactly("from-servlet-context");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment