Issue #1328 - Making Response.setBufferSize(int) ISE more clear
This commit is contained in:
parent
852d9d5c01
commit
8fe94cd110
|
@ -1145,8 +1145,10 @@ public class Response implements HttpServletResponse
|
|||
@Override
|
||||
public void setBufferSize(int size)
|
||||
{
|
||||
if (isCommitted() || getContentCount() > 0)
|
||||
throw new IllegalStateException("cannot set buffer size when response is committed or written to");
|
||||
if (isCommitted())
|
||||
throw new IllegalStateException("cannot set buffer size after response is in committed state");
|
||||
if (getContentCount() > 0)
|
||||
throw new IllegalStateException("cannot set buffer size after response has " + getContentCount() + " bytes already written");
|
||||
if (size < __MIN_BUFFER_SIZE)
|
||||
size = __MIN_BUFFER_SIZE;
|
||||
_out.setBufferSize(size);
|
||||
|
|
Loading…
Reference in New Issue