Deprecate StreamUtils.emptyInput()

Closes gh-29125
This commit is contained in:
Brian Clozel
2022-09-09 22:43:40 +02:00
parent d4a74c8f9d
commit 0770d86936
14 changed files with 29 additions and 34 deletions

View File

@@ -69,7 +69,6 @@ import org.springframework.util.LinkedCaseInsensitiveMap;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StreamUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.util.UrlPathHelper;
@@ -102,7 +101,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
private static final ServletInputStream EMPTY_SERVLET_INPUT_STREAM =
new DelegatingServletInputStream(StreamUtils.emptyInput());
new DelegatingServletInputStream(InputStream.nullInputStream());
private static final BufferedReader EMPTY_BUFFERED_READER =
new BufferedReader(new StringReader(""));

View File

@@ -51,7 +51,6 @@ import org.springframework.util.Assert;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StreamUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
@@ -804,7 +803,7 @@ public class MockHttpServletRequestBuilder
HttpInputMessage message = new HttpInputMessage() {
@Override
public InputStream getBody() {
return (content != null ? new ByteArrayInputStream(content) : StreamUtils.emptyInput());
return (content != null ? new ByteArrayInputStream(content) : InputStream.nullInputStream());
}
@Override
public HttpHeaders getHeaders() {