Browse Source

Merge branch '6.0.x'

pull/30825/head
Sam Brannen 1 year ago
parent
commit
299b86bae3
  1. 3
      spring-context/src/testFixtures/java/org/springframework/context/testfixture/index/CandidateComponentsTestClassLoader.java
  2. 3
      spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java
  3. 3
      spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java
  4. 2
      spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java

3
spring-context/src/testFixtures/java/org/springframework/context/testfixture/index/CandidateComponentsTestClassLoader.java

@ -42,8 +42,7 @@ public class CandidateComponentsTestClassLoader extends ClassLoader { @@ -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());
}
/**

3
spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java

@ -1159,7 +1159,8 @@ public class MockHttpServletRequest implements HttpServletRequest { @@ -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

3
spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java

@ -1159,7 +1159,8 @@ public class MockHttpServletRequest implements HttpServletRequest { @@ -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

2
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java

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

Loading…
Cancel
Save