Merge pull request #1307 from Shredder121:assert-message

* pr/1307:
  Polish contribution
  Check for null on the argument instead of the message
This commit is contained in:
Stephane Nicoll 2017-01-27 14:17:33 +01:00
commit 33f0995b42
9 changed files with 19 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -37,7 +37,7 @@ public abstract class AbstractCacheInvoker {
}
protected AbstractCacheInvoker(CacheErrorHandler errorHandler) {
Assert.notNull("ErrorHandler must not be null");
Assert.notNull(errorHandler, "ErrorHandler must not be null");
this.errorHandler = errorHandler;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@ -73,7 +73,7 @@ public class JmsMessagingTemplate extends AbstractMessagingTemplate<Destination>
* Create a {@code JmsMessagingTemplate} instance with the {@link JmsTemplate} to use.
*/
public JmsMessagingTemplate(JmsTemplate jmsTemplate) {
Assert.notNull("JmsTemplate must not be null");
Assert.notNull(jmsTemplate, "JmsTemplate must not be null");
this.jmsTemplate = jmsTemplate;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -62,8 +62,8 @@ public class JettyWebSocketHandlerAdapter {
public JettyWebSocketHandlerAdapter(WebSocketHandler handler,
Function<Session, JettyWebSocketSession> sessionFactory) {
Assert.notNull("WebSocketHandler is required");
Assert.notNull("'sessionFactory' is required");
Assert.notNull(handler, "WebSocketHandler is required");
Assert.notNull(sessionFactory, "'sessionFactory' is required");
this.delegateHandler = handler;
this.sessionFactory = sessionFactory;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -53,8 +53,8 @@ public class StandardWebSocketHandlerAdapter extends Endpoint {
public StandardWebSocketHandlerAdapter(WebSocketHandler handler,
Function<Session, StandardWebSocketSession> sessionFactory) {
Assert.notNull("WebSocketHandler is required");
Assert.notNull("'sessionFactory' is required");
Assert.notNull(handler, "WebSocketHandler is required");
Assert.notNull(sessionFactory, "'sessionFactory' is required");
this.delegateHandler = handler;
this.sessionFactory = sessionFactory;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -47,7 +47,7 @@ public class UndertowWebSocketHandlerAdapter extends AbstractReceiveListener {
public UndertowWebSocketHandlerAdapter(UndertowWebSocketSession session) {
Assert.notNull("UndertowWebSocketSession is required");
Assert.notNull(session, "UndertowWebSocketSession is required");
this.session = session;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -55,7 +55,7 @@ public class ReactorServerHttpRequest extends AbstractServerHttpRequest {
}
private static URI initUri(HttpServerRequest channel) {
Assert.notNull("'channel' must not be null");
Assert.notNull(channel, "'channel' must not be null");
InetSocketAddress address = channel.remoteAddress();
return (address == null ? URI.create(channel.uri()) : getBaseUrl(address).resolve(channel.uri()));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -50,7 +50,7 @@ public class ReactorServerHttpResponse extends AbstractServerHttpResponse
public ReactorServerHttpResponse(HttpServerResponse response, DataBufferFactory bufferFactory) {
super(bufferFactory);
Assert.notNull("'response' must not be null.");
Assert.notNull(response, "'response' must not be null.");
this.response = response;
}

View File

@ -62,7 +62,7 @@ public class RxNettyServerHttpRequest extends AbstractServerHttpRequest {
}
private static URI initUri(HttpServerRequest<ByteBuf> request) {
Assert.notNull("'request', request must not be null");
Assert.notNull(request, "'request' must not be null");
return StringUtils.isEmpty(request.getHostHeader()) ?
URI.create(request.getUri()) : getBaseUrl(request).resolve(request.getUri());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@ -56,7 +56,7 @@ public class RxNettyServerHttpResponse extends AbstractServerHttpResponse {
public RxNettyServerHttpResponse(HttpServerResponse<ByteBuf> response,
NettyDataBufferFactory dataBufferFactory) {
super(dataBufferFactory);
Assert.notNull("'response', response must not be null.");
Assert.notNull(response, "'response' must not be null.");
this.response = response;
}