Skip to content

Commit a281d8c

Browse files
committed
Polishing
1 parent 638d91f commit a281d8c

File tree

12 files changed

+27
-28
lines changed

12 files changed

+27
-28
lines changed

spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ public int match(DataBuffer dataBuffer) {
695695

696696
@Override
697697
public byte[] delimiter() {
698-
Assert.state(this.longestDelimiter != NO_DELIMITER, "Illegal state!");
698+
Assert.state(this.longestDelimiter != NO_DELIMITER, "'delimiter' not set");
699699
return this.longestDelimiter;
700700
}
701701

spring-messaging/src/main/java/org/springframework/messaging/support/MessageHeaderAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* strongly typed accessors for specific headers, the ability to leave headers
4444
* in a {@link Message} mutable, and the option to suppress automatic generation
4545
* of {@link MessageHeaders#ID id} and {@link MessageHeaders#TIMESTAMP
46-
* timesteamp} headers. Subclasses such as {@link NativeMessageHeaderAccessor}
46+
* timestamp} headers. Subclasses such as {@link NativeMessageHeaderAccessor}
4747
* and others provide support for managing processing vs external source headers
4848
* as well as protocol specific headers.
4949
*

spring-r2dbc/src/main/java/org/springframework/r2dbc/core/DefaultDatabaseClient.java

Lines changed: 5 additions & 5 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.
@@ -273,7 +273,7 @@ public DefaultGenericExecuteSpec bindNull(int index, Class<?> type) {
273273
public DefaultGenericExecuteSpec bind(String name, Object value) {
274274
assertNotPreparedOperation();
275275

276-
Assert.hasText(name, "Parameter name must not be null or empty!");
276+
Assert.hasText(name, "Parameter name must not be null or empty");
277277
Assert.notNull(value, () -> String.format(
278278
"Value for parameter %s must not be null. Use bindNull(…) instead.", name));
279279

@@ -291,7 +291,7 @@ public DefaultGenericExecuteSpec bind(String name, Object value) {
291291
@Override
292292
public DefaultGenericExecuteSpec bindNull(String name, Class<?> type) {
293293
assertNotPreparedOperation();
294-
Assert.hasText(name, "Parameter name must not be null or empty!");
294+
Assert.hasText(name, "Parameter name must not be null or empty");
295295

296296
Map<String, Parameter> byName = new LinkedHashMap<>(this.byName);
297297
byName.put(name, Parameter.empty(type));
@@ -301,7 +301,7 @@ public DefaultGenericExecuteSpec bindNull(String name, Class<?> type) {
301301

302302
@Override
303303
public DefaultGenericExecuteSpec filter(StatementFilterFunction filter) {
304-
Assert.notNull(filter, "Statement FilterFunction must not be null");
304+
Assert.notNull(filter, "StatementFilterFunction must not be null");
305305
return new DefaultGenericExecuteSpec(
306306
this.byIndex, this.byName, this.sqlSupplier, this.filterFunction.andThen(filter));
307307
}
@@ -449,7 +449,7 @@ private void bindByIndex(Statement statement, Map<Integer, Parameter> byIndex) {
449449

450450
private String getRequiredSql(Supplier<String> sqlSupplier) {
451451
String sql = sqlSupplier.get();
452-
Assert.state(StringUtils.hasText(sql), "SQL returned by SQL supplier must not be empty!");
452+
Assert.state(StringUtils.hasText(sql), "SQL returned by supplier must not be empty");
453453
return sql;
454454
}
455455
}

spring-test/src/main/java/org/springframework/mock/web/PassThroughFilterChain.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 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.
@@ -84,7 +84,7 @@ public void doFilter(ServletRequest request, ServletResponse response) throws Se
8484
this.filter.doFilter(request, response, this.nextFilterChain);
8585
}
8686
else {
87-
Assert.state(this.servlet != null, "Neither a Filter not a Servlet set");
87+
Assert.state(this.servlet != null, "Neither a Filter nor a Servlet has been set");
8888
this.servlet.service(request, response);
8989
}
9090
}

spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.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.
@@ -196,7 +196,7 @@ public DeferredResultProcessingInterceptor getDeferredResultInterceptor(Object k
196196
*/
197197
public void registerCallableInterceptor(Object key, CallableProcessingInterceptor interceptor) {
198198
Assert.notNull(key, "Key is required");
199-
Assert.notNull(interceptor, "CallableProcessingInterceptor is required");
199+
Assert.notNull(interceptor, "CallableProcessingInterceptor is required");
200200
this.callableInterceptors.put(key, interceptor);
201201
}
202202

spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/PassThroughFilterChain.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 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.
@@ -84,7 +84,7 @@ public void doFilter(ServletRequest request, ServletResponse response) throws Se
8484
this.filter.doFilter(request, response, this.nextFilterChain);
8585
}
8686
else {
87-
Assert.state(this.servlet != null, "Neither a Filter not a Servlet set");
87+
Assert.state(this.servlet != null, "Neither a Filter nor a Servlet has been set");
8888
this.servlet.service(request, response);
8989
}
9090
}

spring-webflux/src/main/java/org/springframework/web/reactive/result/view/script/ScriptTemplateView.java

Lines changed: 3 additions & 3 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.
@@ -227,12 +227,12 @@ public void setApplicationContext(@Nullable ApplicationContext context) {
227227
engineCount++;
228228
}
229229
Assert.isTrue(engineCount == 1,
230-
"You should define either 'engine', 'engineSupplier' or 'engineName'.");
230+
"You should define either 'engine', 'engineSupplier', or 'engineName'.");
231231

232232
if (Boolean.FALSE.equals(this.sharedEngine)) {
233233
Assert.isTrue(this.engine == null,
234234
"When 'sharedEngine' is set to false, you should specify the " +
235-
"script engine using 'engineName' or 'engineSupplier' , not 'engine'.");
235+
"script engine using 'engineName' or 'engineSupplier', not 'engine'.");
236236
}
237237
else if (this.engine != null) {
238238
loadScripts(this.engine);

spring-webflux/src/test/java/org/springframework/web/reactive/result/view/script/ScriptTemplateViewTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void engineAndEngineNameBothDefined() {
174174
this.view.setRenderFunction("render");
175175
assertThatIllegalArgumentException().isThrownBy(() ->
176176
this.view.setApplicationContext(this.context))
177-
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
177+
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
178178
}
179179

180180
@Test // gh-23258
@@ -185,7 +185,7 @@ public void engineAndEngineSupplierBothDefined() {
185185
this.view.setRenderFunction("render");
186186
assertThatIllegalArgumentException().isThrownBy(() ->
187187
this.view.setApplicationContext(this.context))
188-
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
188+
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
189189
}
190190

191191
@Test // gh-23258
@@ -195,7 +195,7 @@ public void engineNameAndEngineSupplierBothDefined() {
195195
this.view.setRenderFunction("render");
196196
assertThatIllegalArgumentException().isThrownBy(() ->
197197
this.view.setApplicationContext(this.context))
198-
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
198+
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
199199
}
200200

201201
@Test

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java

Lines changed: 2 additions & 2 deletions
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-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.
@@ -449,7 +449,7 @@ public static MethodArgumentBuilder fromMappingName(String mappingName) {
449449
*/
450450
public static MethodArgumentBuilder fromMappingName(@Nullable UriComponentsBuilder builder, String name) {
451451
WebApplicationContext wac = getWebApplicationContext();
452-
Assert.notNull(wac, "No WebApplicationContext. ");
452+
Assert.notNull(wac, "No WebApplicationContext");
453453
Map<String, RequestMappingInfoHandlerMapping> map = wac.getBeansOfType(RequestMappingInfoHandlerMapping.class);
454454
List<HandlerMethod> handlerMethods = null;
455455
for (RequestMappingInfoHandlerMapping mapping : map.values()) {

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/StreamingResponseBody.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.web.servlet.mvc.method.annotation;
1818

19-
2019
import java.io.IOException;
2120
import java.io.OutputStream;
2221

spring-webmvc/src/main/java/org/springframework/web/servlet/view/script/ScriptTemplateView.java

Lines changed: 3 additions & 3 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.
@@ -258,12 +258,12 @@ protected void initApplicationContext(ApplicationContext context) {
258258
engineCount++;
259259
}
260260
Assert.isTrue(engineCount == 1,
261-
"You should define either 'engine', 'engineSupplier' or 'engineName'.");
261+
"You should define either 'engine', 'engineSupplier', or 'engineName'.");
262262

263263
if (Boolean.FALSE.equals(this.sharedEngine)) {
264264
Assert.isTrue(this.engine == null,
265265
"When 'sharedEngine' is set to false, you should specify the " +
266-
"script engine using 'engineName' or 'engineSupplier' , not 'engine'.");
266+
"script engine using 'engineName' or 'engineSupplier', not 'engine'.");
267267
}
268268
else if (this.engine != null) {
269269
loadScripts(this.engine);

spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/ScriptTemplateViewTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public void engineAndEngineNameBothDefined() {
189189
this.view.setRenderFunction("render");
190190
assertThatIllegalArgumentException().isThrownBy(() ->
191191
this.view.setApplicationContext(this.wac))
192-
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
192+
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
193193
}
194194

195195
@Test // gh-23258
@@ -200,7 +200,7 @@ public void engineAndEngineSupplierBothDefined() {
200200
this.view.setRenderFunction("render");
201201
assertThatIllegalArgumentException().isThrownBy(() ->
202202
this.view.setApplicationContext(this.wac))
203-
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
203+
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
204204
}
205205

206206
@Test // gh-23258
@@ -210,7 +210,7 @@ public void engineNameAndEngineSupplierBothDefined() {
210210
this.view.setRenderFunction("render");
211211
assertThatIllegalArgumentException().isThrownBy(() ->
212212
this.view.setApplicationContext(this.wac))
213-
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
213+
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
214214
}
215215

216216
@Test

0 commit comments

Comments
 (0)