Polishing

This commit is contained in:
Sam Brannen 2022-11-04 16:03:47 +01:00
parent 638d91f5f4
commit a281d8c3fd
12 changed files with 27 additions and 28 deletions

View File

@ -695,7 +695,7 @@ public abstract class DataBufferUtils {
@Override
public byte[] delimiter() {
Assert.state(this.longestDelimiter != NO_DELIMITER, "Illegal state!");
Assert.state(this.longestDelimiter != NO_DELIMITER, "'delimiter' not set");
return this.longestDelimiter;
}

View File

@ -43,7 +43,7 @@ import org.springframework.util.StringUtils;
* strongly typed accessors for specific headers, the ability to leave headers
* in a {@link Message} mutable, and the option to suppress automatic generation
* of {@link MessageHeaders#ID id} and {@link MessageHeaders#TIMESTAMP
* timesteamp} headers. Subclasses such as {@link NativeMessageHeaderAccessor}
* timestamp} headers. Subclasses such as {@link NativeMessageHeaderAccessor}
* and others provide support for managing processing vs external source headers
* as well as protocol specific headers.
*

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 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.
@ -273,7 +273,7 @@ class DefaultDatabaseClient implements DatabaseClient {
public DefaultGenericExecuteSpec bind(String name, Object value) {
assertNotPreparedOperation();
Assert.hasText(name, "Parameter name must not be null or empty!");
Assert.hasText(name, "Parameter name must not be null or empty");
Assert.notNull(value, () -> String.format(
"Value for parameter %s must not be null. Use bindNull(…) instead.", name));
@ -291,7 +291,7 @@ class DefaultDatabaseClient implements DatabaseClient {
@Override
public DefaultGenericExecuteSpec bindNull(String name, Class<?> type) {
assertNotPreparedOperation();
Assert.hasText(name, "Parameter name must not be null or empty!");
Assert.hasText(name, "Parameter name must not be null or empty");
Map<String, Parameter> byName = new LinkedHashMap<>(this.byName);
byName.put(name, Parameter.empty(type));
@ -301,7 +301,7 @@ class DefaultDatabaseClient implements DatabaseClient {
@Override
public DefaultGenericExecuteSpec filter(StatementFilterFunction filter) {
Assert.notNull(filter, "Statement FilterFunction must not be null");
Assert.notNull(filter, "StatementFilterFunction must not be null");
return new DefaultGenericExecuteSpec(
this.byIndex, this.byName, this.sqlSupplier, this.filterFunction.andThen(filter));
}
@ -449,7 +449,7 @@ class DefaultDatabaseClient implements DatabaseClient {
private String getRequiredSql(Supplier<String> sqlSupplier) {
String sql = sqlSupplier.get();
Assert.state(StringUtils.hasText(sql), "SQL returned by SQL supplier must not be empty!");
Assert.state(StringUtils.hasText(sql), "SQL returned by supplier must not be empty");
return sql;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2022 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.
@ -84,7 +84,7 @@ public class PassThroughFilterChain implements FilterChain {
this.filter.doFilter(request, response, this.nextFilterChain);
}
else {
Assert.state(this.servlet != null, "Neither a Filter not a Servlet set");
Assert.state(this.servlet != null, "Neither a Filter nor a Servlet has been set");
this.servlet.service(request, response);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 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.
@ -196,7 +196,7 @@ public final class WebAsyncManager {
*/
public void registerCallableInterceptor(Object key, CallableProcessingInterceptor interceptor) {
Assert.notNull(key, "Key is required");
Assert.notNull(interceptor, "CallableProcessingInterceptor is required");
Assert.notNull(interceptor, "CallableProcessingInterceptor is required");
this.callableInterceptors.put(key, interceptor);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2022 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.
@ -84,7 +84,7 @@ public class PassThroughFilterChain implements FilterChain {
this.filter.doFilter(request, response, this.nextFilterChain);
}
else {
Assert.state(this.servlet != null, "Neither a Filter not a Servlet set");
Assert.state(this.servlet != null, "Neither a Filter nor a Servlet has been set");
this.servlet.service(request, response);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2022 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.
@ -227,12 +227,12 @@ public class ScriptTemplateView extends AbstractUrlBasedView {
engineCount++;
}
Assert.isTrue(engineCount == 1,
"You should define either 'engine', 'engineSupplier' or 'engineName'.");
"You should define either 'engine', 'engineSupplier', or 'engineName'.");
if (Boolean.FALSE.equals(this.sharedEngine)) {
Assert.isTrue(this.engine == null,
"When 'sharedEngine' is set to false, you should specify the " +
"script engine using 'engineName' or 'engineSupplier' , not 'engine'.");
"script engine using 'engineName' or 'engineSupplier', not 'engine'.");
}
else if (this.engine != null) {
loadScripts(this.engine);

View File

@ -174,7 +174,7 @@ public class ScriptTemplateViewTests {
this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.context))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
}
@Test // gh-23258
@ -185,7 +185,7 @@ public class ScriptTemplateViewTests {
this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.context))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
}
@Test // gh-23258
@ -195,7 +195,7 @@ public class ScriptTemplateViewTests {
this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.context))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
}
@Test

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 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.
@ -449,7 +449,7 @@ public class MvcUriComponentsBuilder {
*/
public static MethodArgumentBuilder fromMappingName(@Nullable UriComponentsBuilder builder, String name) {
WebApplicationContext wac = getWebApplicationContext();
Assert.notNull(wac, "No WebApplicationContext. ");
Assert.notNull(wac, "No WebApplicationContext");
Map<String, RequestMappingInfoHandlerMapping> map = wac.getBeansOfType(RequestMappingInfoHandlerMapping.class);
List<HandlerMethod> handlerMethods = null;
for (RequestMappingInfoHandlerMapping mapping : map.values()) {

View File

@ -16,7 +16,6 @@
package org.springframework.web.servlet.mvc.method.annotation;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2022 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.
@ -258,12 +258,12 @@ public class ScriptTemplateView extends AbstractUrlBasedView {
engineCount++;
}
Assert.isTrue(engineCount == 1,
"You should define either 'engine', 'engineSupplier' or 'engineName'.");
"You should define either 'engine', 'engineSupplier', or 'engineName'.");
if (Boolean.FALSE.equals(this.sharedEngine)) {
Assert.isTrue(this.engine == null,
"When 'sharedEngine' is set to false, you should specify the " +
"script engine using 'engineName' or 'engineSupplier' , not 'engine'.");
"script engine using 'engineName' or 'engineSupplier', not 'engine'.");
}
else if (this.engine != null) {
loadScripts(this.engine);

View File

@ -189,7 +189,7 @@ public class ScriptTemplateViewTests {
this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.wac))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
}
@Test // gh-23258
@ -200,7 +200,7 @@ public class ScriptTemplateViewTests {
this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.wac))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
}
@Test // gh-23258
@ -210,7 +210,7 @@ public class ScriptTemplateViewTests {
this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.wac))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
}
@Test