Merge branch '6.0.x'

This commit is contained in:
Sam Brannen 2023-07-05 14:02:49 +02:00
commit 299b86bae3
4 changed files with 6 additions and 5 deletions

View File

@ -42,8 +42,7 @@ public class CandidateComponentsTestClassLoader extends ClassLoader {
* @see org.springframework.context.index.CandidateComponentsIndexLoader#COMPONENTS_RESOURCE_LOCATION
*/
public static ClassLoader disableIndex(ClassLoader classLoader) {
return new CandidateComponentsTestClassLoader(classLoader,
Collections.enumeration(Collections.emptyList()));
return new CandidateComponentsTestClassLoader(classLoader, Collections.emptyEnumeration());
}
/**

View File

@ -1159,7 +1159,8 @@ public class MockHttpServletRequest implements HttpServletRequest {
@Override
public Enumeration<String> getHeaders(String name) {
HeaderValueHolder header = this.headers.get(name);
return Collections.enumeration(header != null ? header.getStringValues() : new LinkedList<>());
return (header != null ? Collections.enumeration(header.getStringValues()) :
Collections.emptyEnumeration());
}
@Override

View File

@ -1159,7 +1159,8 @@ public class MockHttpServletRequest implements HttpServletRequest {
@Override
public Enumeration<String> getHeaders(String name) {
HeaderValueHolder header = this.headers.get(name);
return Collections.enumeration(header != null ? header.getStringValues() : new LinkedList<>());
return (header != null ? Collections.enumeration(header.getStringValues()) :
Collections.emptyEnumeration());
}
@Override

View File

@ -170,7 +170,7 @@ public class SimpleServletPostProcessor implements
@Override
public Enumeration<String> getInitParameterNames() {
return Collections.enumeration(Collections.emptySet());
return Collections.emptyEnumeration();
}
}