Skip to content

Commit 9cf7b0e

Browse files
committed
Polishing
1 parent 3431b23 commit 9cf7b0e

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

spring-context/src/main/java/org/springframework/validation/ObjectError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class ObjectError extends DefaultMessageSourceResolvable {
4646
* @param objectName the name of the affected object
4747
* @param defaultMessage the default message to be used to resolve this message
4848
*/
49-
public ObjectError(String objectName, String defaultMessage) {
49+
public ObjectError(String objectName, @Nullable String defaultMessage) {
5050
this(objectName, null, null, defaultMessage);
5151
}
5252

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2023 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.

spring-tx/src/test/java/org/springframework/transaction/reactive/ReactiveTestTransactionManager.java

Lines changed: 1 addition & 1 deletion
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-2023 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.

spring-tx/src/test/java/org/springframework/transaction/reactive/ReactiveTransactionSupportTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2023 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.

spring-web/src/main/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ public Object getTarget() {
335335
return BeanUtils.instantiateClass(ctor, args);
336336
}
337337
catch (BeanInstantiationException ex) {
338-
Throwable cause = ex.getCause();
339-
if (KotlinDetector.isKotlinType(ctor.getDeclaringClass()) && cause instanceof NullPointerException) {
338+
if (KotlinDetector.isKotlinType(ctor.getDeclaringClass()) &&
339+
ex.getCause() instanceof NullPointerException cause) {
340340
BindingResult result = binder.getBindingResult();
341341
ObjectError error = new ObjectError(ctor.getName(), cause.getMessage());
342342
result.addError(error);

spring-webflux/src/main/java/org/springframework/web/reactive/function/server/DefaultServerRequestBuilder.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 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.
@@ -122,7 +122,7 @@ public ServerRequest.Builder contextPath(@Nullable String contextPath) {
122122

123123
@Override
124124
public ServerRequest.Builder header(String headerName, String... headerValues) {
125-
Assert.notNull(headerName, "Header Name must not be null");
125+
Assert.notNull(headerName, "Header name must not be null");
126126
for (String headerValue : headerValues) {
127127
this.headers.add(headerName, headerValue);
128128
}
@@ -131,14 +131,14 @@ public ServerRequest.Builder header(String headerName, String... headerValues) {
131131

132132
@Override
133133
public ServerRequest.Builder headers(Consumer<HttpHeaders> headersConsumer) {
134-
Assert.notNull(headersConsumer, "Header Consumer must not be null");
134+
Assert.notNull(headersConsumer, "Headers consumer must not be null");
135135
headersConsumer.accept(this.headers);
136136
return this;
137137
}
138138

139139
@Override
140140
public ServerRequest.Builder cookie(String name, String... values) {
141-
Assert.notNull(name, "Cookie Name must not be null");
141+
Assert.notNull(name, "Cookie name must not be null");
142142
for (String value : values) {
143143
this.cookies.add(name, new HttpCookie(name, value));
144144
}
@@ -147,7 +147,7 @@ public ServerRequest.Builder cookie(String name, String... values) {
147147

148148
@Override
149149
public ServerRequest.Builder cookies(Consumer<MultiValueMap<String, HttpCookie>> cookiesConsumer) {
150-
Assert.notNull(cookiesConsumer, "Cookie Consumer must not be null");
150+
Assert.notNull(cookiesConsumer, "Cookies consumer must not be null");
151151
cookiesConsumer.accept(this.cookies);
152152
return this;
153153
}
@@ -178,14 +178,14 @@ private void releaseBody() {
178178

179179
@Override
180180
public ServerRequest.Builder attribute(String name, Object value) {
181-
Assert.notNull(name, "name must not be null");
181+
Assert.notNull(name, "Name must not be null");
182182
this.attributes.put(name, value);
183183
return this;
184184
}
185185

186186
@Override
187187
public ServerRequest.Builder attributes(Consumer<Map<String, Object>> attributesConsumer) {
188-
Assert.notNull(attributesConsumer, "AttributesConsumer must not be null");
188+
Assert.notNull(attributesConsumer, "Attributes consumer must not be null");
189189
attributesConsumer.accept(this.attributes);
190190
return this;
191191
}

spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerRequestBuilder.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public ServerRequest.Builder uri(URI uri) {
115115

116116
@Override
117117
public ServerRequest.Builder header(String headerName, String... headerValues) {
118-
Assert.notNull(headerName, "Header Name must not be null");
118+
Assert.notNull(headerName, "Header name must not be null");
119119
for (String headerValue : headerValues) {
120120
this.headers.add(headerName, headerValue);
121121
}
@@ -124,14 +124,14 @@ public ServerRequest.Builder header(String headerName, String... headerValues) {
124124

125125
@Override
126126
public ServerRequest.Builder headers(Consumer<HttpHeaders> headersConsumer) {
127-
Assert.notNull(headersConsumer, "Header Consumer must not be null");
127+
Assert.notNull(headersConsumer, "Headers consumer must not be null");
128128
headersConsumer.accept(this.headers);
129129
return this;
130130
}
131131

132132
@Override
133133
public ServerRequest.Builder cookie(String name, String... values) {
134-
Assert.notNull(name, "Cookie Name must not be null");
134+
Assert.notNull(name, "Cookie name must not be null");
135135
for (String value : values) {
136136
this.cookies.add(name, new Cookie(name, value));
137137
}
@@ -140,41 +140,41 @@ public ServerRequest.Builder cookie(String name, String... values) {
140140

141141
@Override
142142
public ServerRequest.Builder cookies(Consumer<MultiValueMap<String, Cookie>> cookiesConsumer) {
143-
Assert.notNull(cookiesConsumer, "Cookie Consumer must not be null");
143+
Assert.notNull(cookiesConsumer, "Cookies consumer must not be null");
144144
cookiesConsumer.accept(this.cookies);
145145
return this;
146146
}
147147

148148
@Override
149149
public ServerRequest.Builder body(byte[] body) {
150-
Assert.notNull(body, "body must not be null");
150+
Assert.notNull(body, "Body must not be null");
151151
this.body = body;
152152
return this;
153153
}
154154

155155
@Override
156156
public ServerRequest.Builder body(String body) {
157-
Assert.notNull(body, "body must not be null");
157+
Assert.notNull(body, "Body must not be null");
158158
return body(body.getBytes(StandardCharsets.UTF_8));
159159
}
160160

161161
@Override
162162
public ServerRequest.Builder attribute(String name, Object value) {
163-
Assert.notNull(name, "name must not be null");
163+
Assert.notNull(name, "Name must not be null");
164164
this.attributes.put(name, value);
165165
return this;
166166
}
167167

168168
@Override
169169
public ServerRequest.Builder attributes(Consumer<Map<String, Object>> attributesConsumer) {
170-
Assert.notNull(attributesConsumer, "AttributesConsumer must not be null");
170+
Assert.notNull(attributesConsumer, "Attributes consumer must not be null");
171171
attributesConsumer.accept(this.attributes);
172172
return this;
173173
}
174174

175175
@Override
176176
public ServerRequest.Builder param(String name, String... values) {
177-
Assert.notNull(name, "name must not be null");
177+
Assert.notNull(name, "Name must not be null");
178178
for (String value : values) {
179179
this.params.add(name, value);
180180
}
@@ -183,7 +183,7 @@ public ServerRequest.Builder param(String name, String... values) {
183183

184184
@Override
185185
public ServerRequest.Builder params(Consumer<MultiValueMap<String, String>> paramsConsumer) {
186-
Assert.notNull(paramsConsumer, "paramsConsumer must not be null");
186+
Assert.notNull(paramsConsumer, "Parameters consumer must not be null");
187187
paramsConsumer.accept(this.params);
188188
return this;
189189
}

src/checkstyle/checkstyle.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
<property name="id" value="packageLevelNonNullApiAnnotation"/>
2626
<property name="format" value="@NonNullApi"/>
2727
<property name="minimum" value="1"/>
28-
<property name="maximum" value="1"/>
28+
<property name="maximum" value="1"/>
2929
<property name="message" value="package-info.java is missing required null-safety annotation @NonNullApi."/>
3030
<property name="ignoreComments" value="true"/>
3131
</module>
3232
<module name="RegexpSinglelineJavaCheck">
3333
<property name="id" value="packageLevelNonNullFieldsAnnotation"/>
3434
<property name="format" value="@NonNullFields"/>
3535
<property name="minimum" value="1"/>
36-
<property name="maximum" value="1"/>
36+
<property name="maximum" value="1"/>
3737
<property name="message" value="package-info.java is missing required null-safety annotation @NonNullFields."/>
3838
<property name="ignoreComments" value="true"/>
3939
</module>

0 commit comments

Comments
 (0)