diff --git a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java index 9c269278af0..74e1982bb3d 100644 --- a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java +++ b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -101,9 +101,6 @@ public class MockHttpServletRequest implements HttpServletRequest { private static final TimeZone GMT = TimeZone.getTimeZone("GMT"); - private static final ServletInputStream EMPTY_SERVLET_INPUT_STREAM = - new DelegatingServletInputStream(InputStream.nullInputStream()); - private static final BufferedReader EMPTY_BUFFERED_READER = new BufferedReader(new StringReader("")); @@ -513,12 +510,12 @@ public class MockHttpServletRequest implements HttpServletRequest { } else if (this.reader != null) { throw new IllegalStateException( - "Cannot call getInputStream() after getReader() has already been called for the current request") ; + "Cannot call getInputStream() after getReader() has already been called for the current request"); } this.inputStream = (this.content != null ? new DelegatingServletInputStream(new ByteArrayInputStream(this.content)) : - EMPTY_SERVLET_INPUT_STREAM); + new DelegatingServletInputStream(InputStream.nullInputStream())); return this.inputStream; }