466628 Improve IllegalStateException on ServletInputStream.setReadListener()

This commit is contained in:
Jan Bartel 2015-05-07 14:03:34 +10:00
parent e91d3dd18e
commit e2c7499bae
1 changed files with 4 additions and 1 deletions

View File

@ -502,8 +502,11 @@ public class HttpInput extends ServletInputStream implements Runnable
{
synchronized (_inputQ)
{
if (_listener != null)
throw new IllegalStateException("ReadListener already set");
if (_state != STREAM)
throw new IllegalStateException("state=" + _state);
throw new IllegalStateException("State "+STREAM+" != " + _state);
_state = ASYNC;
_listener = readListener;
boolean content=nextContent()!=null;