Merge pull request #17825 from dreis2211
* pr/17825: Polish some Collections API calls Closes gh-17825
This commit is contained in:
commit
01491befc3
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue