Browse Source

Merge pull request #1307 from Shredder121:assert-message

* pr/1307:
  Polish contribution
  Check for null on the argument instead of the message
pull/1308/head
Stephane Nicoll 9 years ago
parent
commit
33f0995b42
  1. 4
      spring-context/src/main/java/org/springframework/cache/interceptor/AbstractCacheInvoker.java
  2. 4
      spring-jms/src/main/java/org/springframework/jms/core/JmsMessagingTemplate.java
  3. 6
      spring-web-reactive/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java
  4. 6
      spring-web-reactive/src/main/java/org/springframework/web/reactive/socket/adapter/StandardWebSocketHandlerAdapter.java
  5. 4
      spring-web-reactive/src/main/java/org/springframework/web/reactive/socket/adapter/UndertowWebSocketHandlerAdapter.java
  6. 4
      spring-web/src/main/java/org/springframework/http/server/reactive/ReactorServerHttpRequest.java
  7. 4
      spring-web/src/main/java/org/springframework/http/server/reactive/ReactorServerHttpResponse.java
  8. 2
      spring-web/src/main/java/org/springframework/http/server/reactive/RxNettyServerHttpRequest.java
  9. 4
      spring-web/src/main/java/org/springframework/http/server/reactive/RxNettyServerHttpResponse.java

4
spring-context/src/main/java/org/springframework/cache/interceptor/AbstractCacheInvoker.java vendored

@ -1,5 +1,5 @@ @@ -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 { @@ -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;
}

4
spring-jms/src/main/java/org/springframework/jms/core/JmsMessagingTemplate.java

@ -1,5 +1,5 @@ @@ -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> @@ -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;
}

6
spring-web-reactive/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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;
}

6
spring-web-reactive/src/main/java/org/springframework/web/reactive/socket/adapter/StandardWebSocketHandlerAdapter.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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;
}

4
spring-web-reactive/src/main/java/org/springframework/web/reactive/socket/adapter/UndertowWebSocketHandlerAdapter.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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;
}

4
spring-web/src/main/java/org/springframework/http/server/reactive/ReactorServerHttpRequest.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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()));
}

4
spring-web/src/main/java/org/springframework/http/server/reactive/ReactorServerHttpResponse.java

@ -1,5 +1,5 @@ @@ -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 @@ -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;
}

2
spring-web/src/main/java/org/springframework/http/server/reactive/RxNettyServerHttpRequest.java

@ -62,7 +62,7 @@ public class RxNettyServerHttpRequest extends AbstractServerHttpRequest { @@ -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());
}

4
spring-web/src/main/java/org/springframework/http/server/reactive/RxNettyServerHttpResponse.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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;
}

Loading…
Cancel
Save