Sync MockHttpServletRequest implementations

This commit is contained in:
Sam Brannen 2023-02-01 16:28:38 +01:00
parent 58fbf60d2d
commit 23a60aeb27
1 changed files with 3 additions and 6 deletions

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 TimeZone GMT = TimeZone.getTimeZone("GMT");
private static final ServletInputStream EMPTY_SERVLET_INPUT_STREAM =
new DelegatingServletInputStream(InputStream.nullInputStream());
private static final BufferedReader EMPTY_BUFFERED_READER = private static final BufferedReader EMPTY_BUFFERED_READER =
new BufferedReader(new StringReader("")); new BufferedReader(new StringReader(""));
@ -518,7 +515,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
this.inputStream = (this.content != null ? this.inputStream = (this.content != null ?
new DelegatingServletInputStream(new ByteArrayInputStream(this.content)) : new DelegatingServletInputStream(new ByteArrayInputStream(this.content)) :
EMPTY_SERVLET_INPUT_STREAM); new DelegatingServletInputStream(InputStream.nullInputStream()));
return this.inputStream; return this.inputStream;
} }