Skip to content

Commit e5878ab

Browse files
committed
Fix precondition assertions
1 parent dedbbf0 commit e5878ab

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionalOperatorImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ final class TransactionalOperatorImpl implements TransactionalOperator {
5757
*/
5858
TransactionalOperatorImpl(ReactiveTransactionManager transactionManager, TransactionDefinition transactionDefinition) {
5959
Assert.notNull(transactionManager, "ReactiveTransactionManager must not be null");
60-
Assert.notNull(transactionManager, "TransactionDefinition must not be null");
60+
Assert.notNull(transactionDefinition, "TransactionDefinition must not be null");
6161
this.transactionManager = transactionManager;
6262
this.transactionDefinition = transactionDefinition;
6363
}

spring-web/src/main/java/org/springframework/http/ContentDisposition.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,9 @@ else if (!escaped && ch == '"') {
465465
* @see <a href="https://tools.ietf.org/html/rfc5987">RFC 5987</a>
466466
*/
467467
private static String decodeFilename(String filename, Charset charset) {
468-
Assert.notNull(filename, "'input' String should not be null");
469-
Assert.notNull(charset, "'charset' should not be null");
468+
Assert.notNull(filename, "'filename' must not be null");
469+
Assert.notNull(charset, "'charset' must not be null");
470+
470471
byte[] value = filename.getBytes(charset);
471472
ByteArrayOutputStream baos = new ByteArrayOutputStream();
472473
int index = 0;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ class UndertowServerHttpResponse extends AbstractListenerServerHttpResponse impl
6363
HttpServerExchange exchange, DataBufferFactory bufferFactory, UndertowServerHttpRequest request) {
6464

6565
super(bufferFactory, createHeaders(exchange));
66-
Assert.notNull(exchange, "HttpServerExchange must not be null");
6766
this.exchange = exchange;
6867
this.request = request;
6968
}
7069

7170
private static HttpHeaders createHeaders(HttpServerExchange exchange) {
71+
Assert.notNull(exchange, "HttpServerExchange must not be null");
7272
UndertowHeadersAdapter headersMap = new UndertowHeadersAdapter(exchange.getResponseHeaders());
7373
return new HttpHeaders(headersMap);
7474
}

spring-webmvc/src/main/java/org/springframework/web/servlet/handler/RequestMatchResult.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -59,7 +59,7 @@ public class RequestMatchResult {
5959
*/
6060
public RequestMatchResult(PathPattern pathPattern, PathContainer lookupPath) {
6161
Assert.notNull(pathPattern, "PathPattern is required");
62-
Assert.notNull(pathPattern, "PathContainer is required");
62+
Assert.notNull(lookupPath, "PathContainer is required");
6363

6464
this.pattern = null;
6565
this.lookupPath = null;

0 commit comments

Comments
 (0)