[#1637] Check for null parameters

This commit is contained in:
Norman Maurer 2013-07-23 06:29:54 +02:00
parent ec370e1d97
commit dbc74fcc97
3 changed files with 12 additions and 0 deletions

View File

@ -66,6 +66,9 @@ public abstract class DefaultHttpMessage extends DefaultHttpObject implements Ht
@Override
public HttpMessage setProtocolVersion(HttpVersion version) {
if (version == null) {
throw new NullPointerException("version");
}
this.version = version;
return this;
}

View File

@ -56,12 +56,18 @@ public class DefaultHttpRequest extends DefaultHttpMessage implements HttpReques
@Override
public HttpRequest setMethod(HttpMethod method) {
if (method == null) {
throw new NullPointerException("method");
}
this.method = method;
return this;
}
@Override
public HttpRequest setUri(String uri) {
if (uri == null) {
throw new NullPointerException("method");
}
this.uri = uri;
return this;
}

View File

@ -45,6 +45,9 @@ public class DefaultHttpResponse extends DefaultHttpMessage implements HttpRespo
@Override
public HttpResponse setStatus(HttpResponseStatus status) {
if (status == null) {
throw new NullPointerException("status");
}
this.status = status;
return this;
}