Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class MongoHealthIndicator extends AbstractHealthIndicator {

public MongoHealthIndicator(MongoTemplate mongoTemplate) {
super("MongoDB health check failed");
Assert.notNull(mongoTemplate, "MongoTemplate must not be null");
Assert.notNull(mongoTemplate, "'mongoTemplate' must not be null");
this.mongoTemplate = mongoTemplate;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private boolean hasOperations(ExposableJmxEndpoint endpoint) {
}

private ObjectName register(ExposableJmxEndpoint endpoint) {
Assert.notNull(endpoint, "Endpoint must not be null");
Assert.notNull(endpoint, "'endpoint' must not be null");
try {
ObjectName name = this.objectNameFactory.getObjectName(endpoint);
EndpointMBean mbean = new EndpointMBean(this.responseMapper, this.classLoader, endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public class DefaultErrorViewResolver implements ErrorViewResolver, Ordered {
* @since 2.4.0
*/
public DefaultErrorViewResolver(ApplicationContext applicationContext, Resources resources) {
Assert.notNull(applicationContext, "ApplicationContext must not be null");
Assert.notNull(resources, "Resources must not be null");
Assert.notNull(applicationContext, "'applicationContext' must not be null");
Assert.notNull(resources, "'resources' must not be null");
this.applicationContext = applicationContext;
this.resources = resources;
this.templateAvailabilityProviders = new TemplateAvailabilityProviders(applicationContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ DataSourceScriptDatabaseInitializer customInitializer(DataSource dataSource) {
static class ComponentThatUsesScheduler {

ComponentThatUsesScheduler(Scheduler scheduler) {
Assert.notNull(scheduler, "Scheduler must not be null");
Assert.notNull(scheduler, "'scheduler' must not be null");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static class TestConfiguration {

@Bean
MapSessionRepository mapSessionRepository(ConfigurableApplicationContext context) {
Assert.isTrue(context.getBeanFactory().isConfigurationFrozen(), "Context should be frozen");
Assert.isTrue(context.getBeanFactory().isConfigurationFrozen(), "'context' should be frozen");
return new MapSessionRepository(new LinkedHashMap<>());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ void setup() {
@Test
void createWhenApplicationContextIsNullShouldThrowException() {
assertThatIllegalArgumentException().isThrownBy(() -> new DefaultErrorViewResolver(null, new Resources()))
.withMessageContaining("ApplicationContext must not be null");
.withMessageContaining("'applicationContext' must not be null");
}

@Test
void createWhenResourcePropertiesIsNullShouldThrowException() {
assertThatIllegalArgumentException()
.isThrownBy(() -> new DefaultErrorViewResolver(mock(ApplicationContext.class), (Resources) null))
.withMessageContaining("Resources must not be null");
.withMessageContaining("'resources' must not be null");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public HttpStatusHandler() {
* @param status the status
*/
public HttpStatusHandler(HttpStatus status) {
Assert.notNull(status, "Status must not be null");
Assert.notNull(status, "'status' must not be null");
this.status = status;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void setup() {
@Test
void statusMustNotBeNull() {
assertThatIllegalArgumentException().isThrownBy(() -> new HttpStatusHandler(null))
.withMessageContaining("Status must not be null");
.withMessageContaining("'status' must not be null");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Object resolve(Object instance) {

@SuppressWarnings("unchecked")
private static <T> T getUltimateTargetObject(Object candidate) {
Assert.notNull(candidate, "Candidate must not be null");
Assert.notNull(candidate, "'candidate' must not be null");
try {
if (AopUtils.isAopProxy(candidate) && candidate instanceof Advised advised) {
TargetSource targetSource = advised.getTargetSource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class BuildpackCoordinates {
private final String version;

private BuildpackCoordinates(String id, String version) {
Assert.hasText(id, "ID must not be empty");
Assert.hasText(id, "'id' must not be empty");
this.id = id;
this.version = version;
}
Expand Down Expand Up @@ -123,7 +123,7 @@ private static BuildpackCoordinates fromToml(TomlParseResult toml, Path path) {
* @return a new {@link BuildpackCoordinates} instance
*/
static BuildpackCoordinates fromBuildpackMetadata(BuildpackMetadata buildpackMetadata) {
Assert.notNull(buildpackMetadata, "BuildpackMetadata must not be null");
Assert.notNull(buildpackMetadata, "'buildpackMetadata' must not be null");
return new BuildpackCoordinates(buildpackMetadata.getId(), buildpackMetadata.getVersion());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public DockerConfiguration withBindHostToBuilder(boolean bindHostToBuilder) {
}

public DockerConfiguration withBuilderRegistryTokenAuthentication(String token) {
Assert.notNull(token, "Token must not be null");
Assert.notNull(token, "'token' must not be null");
return new DockerConfiguration(this.host, new DockerRegistryTokenAuthentication(token),
this.publishAuthentication, this.bindHostToBuilder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void fromTomlWhenContainsBothStacksAndOrderThrowsException() throws IOException
@Test
void fromBuildpackMetadataWhenMetadataIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> BuildpackCoordinates.fromBuildpackMetadata(null))
.withMessage("BuildpackMetadata must not be null");
.withMessage("'buildpackMetadata' must not be null");
}

@Test
Expand All @@ -113,7 +113,7 @@ void fromBuildpackMetadataReturnsCoordinates() throws Exception {
@Test
void ofWhenIdIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> BuildpackCoordinates.of(null, null))
.withMessage("ID must not be empty");
.withMessage("'id' must not be empty");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Layer {
* @param name the name of the layer.
*/
public Layer(String name) {
Assert.hasText(name, "Name must not be empty");
Assert.hasText(name, "'name' must not be empty");
Assert.isTrue(PATTERN.matcher(name).matches(), () -> "Malformed layer name '" + name + "'");
Assert.isTrue(!name.equalsIgnoreCase("ext") && !name.toLowerCase(Locale.ROOT).startsWith("springboot"),
() -> "Layer name '" + name + "' is reserved");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ public abstract class Packager {
* @param source the source archive file to package
*/
protected Packager(File source) {
Assert.notNull(source, "Source file must not be null");
Assert.notNull(source, "'source' file must not be null");
Assert.isTrue(source.exists() && source.isFile(),
() -> "Source must refer to an existing file, got " + source.getAbsolutePath());
() -> "'source' must refer to an existing file, got " + source.getAbsolutePath());
this.source = source.getAbsoluteFile();
}

Expand Down Expand Up @@ -163,7 +163,7 @@ public void setLayoutFactory(LayoutFactory layoutFactory) {
* @param layers the jar layers
*/
public void setLayers(Layers layers) {
Assert.notNull(layers, "Layers must not be null");
Assert.notNull(layers, "'layers' must not be null");
this.layers = layers;
this.layersIndex = new LayersIndex(layers);
}
Expand Down Expand Up @@ -204,7 +204,7 @@ protected final void write(JarFile sourceJar, Libraries libraries, AbstractJarWr

protected final void write(JarFile sourceJar, Libraries libraries, AbstractJarWriter writer,
boolean ensureReproducibleBuild) throws IOException {
Assert.notNull(libraries, "Libraries must not be null");
Assert.notNull(libraries, "'libraries' must not be null");
write(sourceJar, writer, new PackagedLibraries(libraries, ensureReproducibleBuild));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ApplicationContentFilter implements ContentFilter<String> {
private final String pattern;

public ApplicationContentFilter(String pattern) {
Assert.hasText(pattern, "Pattern must not be empty");
Assert.hasText(pattern, "'pattern' must not be empty");
this.pattern = pattern;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public class CustomLayers implements Layers {

public CustomLayers(List<Layer> layers, List<ContentSelector<String>> applicationSelectors,
List<ContentSelector<Library>> librarySelectors) {
Assert.notNull(layers, "Layers must not be null");
Assert.notNull(applicationSelectors, "ApplicationSelectors must not be null");
Assert.notNull(layers, "'layers' must not be null");
Assert.notNull(applicationSelectors, "'applicationSelectors' must not be null");
validateSelectorLayers(applicationSelectors, layers);
Assert.notNull(librarySelectors, "LibrarySelectors must not be null");
Assert.notNull(librarySelectors, "'librarySelectors' must not be null");
validateSelectorLayers(librarySelectors, layers);
this.layers = new ArrayList<>(layers);
this.applicationSelectors = new ArrayList<>(applicationSelectors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public IncludeExcludeContentSelector(Layer layer, List<ContentFilter<T>> include

public <S> IncludeExcludeContentSelector(Layer layer, List<S> includes, List<S> excludes,
Function<S, ContentFilter<T>> filterFactory) {
Assert.notNull(layer, "Layer must not be null");
Assert.notNull(filterFactory, "FilterFactory must not be null");
Assert.notNull(layer, "'layer' must not be null");
Assert.notNull(filterFactory, "'filterFactory' must not be null");
this.layer = layer;
this.includes = (includes != null) ? adapt(includes, filterFactory) : Collections.emptyList();
this.excludes = (excludes != null) ? adapt(excludes, filterFactory) : Collections.emptyList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class LibraryContentFilter implements ContentFilter<Library> {
private final Pattern pattern;

public LibraryContentFilter(String coordinatesPattern) {
Assert.hasText(coordinatesPattern, "CoordinatesPattern must not be empty");
Assert.hasText(coordinatesPattern, "'coordinatesPattern' must not be empty");
StringBuilder regex = new StringBuilder();
for (int i = 0; i < coordinatesPattern.length(); i++) {
char c = coordinatesPattern.charAt(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void nullLibraries() throws Exception {
this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class);
P packager = createPackager();
assertThatIllegalArgumentException().isThrownBy(() -> execute(packager, null))
.withMessageContaining("Libraries must not be null");
.withMessageContaining("'libraries' must not be null");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class LayerTests {

@Test
void createWhenNameIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new Layer(null)).withMessage("Name must not be empty");
assertThatIllegalArgumentException().isThrownBy(() -> new Layer(null)).withMessage("'name' must not be empty");
}

@Test
void createWhenNameIsEmptyThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new Layer("")).withMessage("Name must not be empty");
assertThatIllegalArgumentException().isThrownBy(() -> new Layer("")).withMessage("'name' must not be empty");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ class ApplicationContentFilterTests {
@Test
void createWhenPatternIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new ApplicationContentFilter(null))
.withMessage("Pattern must not be empty");
.withMessage("'pattern' must not be empty");
}

@Test
void createWhenPatternIsEmptyThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new ApplicationContentFilter(""))
.withMessage("Pattern must not be empty");
.withMessage("'pattern' must not be empty");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ void createWhenLayerIsNullThrowsException() {
assertThatIllegalArgumentException()
.isThrownBy(
() -> new IncludeExcludeContentSelector<>(null, Collections.emptyList(), Collections.emptyList()))
.withMessage("Layer must not be null");
.withMessage("'layer' must not be null");
}

@Test
void createWhenFactoryIsNullThrowsException() {
assertThatIllegalArgumentException()
.isThrownBy(() -> new IncludeExcludeContentSelector<>(LAYER, null, null, null))
.withMessage("FilterFactory must not be null");
.withMessage("'filterFactory' must not be null");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ class LibraryContentFilterTests {
@Test
void createWhenCoordinatesPatternIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new LibraryContentFilter(null))
.withMessage("CoordinatesPattern must not be empty");
.withMessage("'coordinatesPattern' must not be empty");
}

@Test
void createWhenCoordinatesPatternIsEmptyThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new LibraryContentFilter(""))
.withMessage("CoordinatesPattern must not be empty");
.withMessage("'coordinatesPattern' must not be empty");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ default Scope getScope() {
* @since 2.4.2
*/
default InstanceSupplier<T> withScope(Scope scope) {
Assert.notNull(scope, "Scope must not be null");
Assert.notNull(scope, "'scope' must not be null");
InstanceSupplier<T> parent = this;
return new InstanceSupplier<>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public ConfigurationPropertyName subName(int offset) {
* @return {@code true} if this name is an ancestor
*/
public boolean isParentOf(ConfigurationPropertyName name) {
Assert.notNull(name, "Name must not be null");
Assert.notNull(name, "'name' must not be null");
if (getNumberOfElements() != name.getNumberOfElements() - 1) {
return false;
}
Expand All @@ -287,7 +287,7 @@ public boolean isParentOf(ConfigurationPropertyName name) {
* @return {@code true} if this name is an ancestor
*/
public boolean isAncestorOf(ConfigurationPropertyName name) {
Assert.notNull(name, "Name must not be null");
Assert.notNull(name, "'name' must not be null");
if (getNumberOfElements() >= name.getNumberOfElements()) {
return false;
}
Expand Down Expand Up @@ -612,7 +612,7 @@ private static Elements elementsOf(CharSequence name, boolean returnNullIfInvali

private static Elements elementsOf(CharSequence name, boolean returnNullIfInvalid, int parserCapacity) {
if (name == null) {
Assert.isTrue(returnNullIfInvalid, "Name must not be null");
Assert.isTrue(returnNullIfInvalid, "'name' must not be null");
return null;
}
if (name.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private static void createAdditionalFields(ReadOnlyStringMap contextData, BiCons
}

private static void createAdditionalField(String name, Object value, BiConsumer<Object, Object> pairs) {
Assert.notNull(name, "fieldName must not be null");
Assert.notNull(name, "'name' must not be null");
if (!FIELD_NAME_VALID_PATTERN.matcher(name).matches()) {
logger.warn(LogMessage.format("'%s' is not a valid field name according to GELF standard", name));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private static void createAdditionalField(List<KeyValuePair> keyValuePairs, BiCo
}

private static void createAdditionalField(String name, Object value, BiConsumer<Object, Object> pairs) {
Assert.notNull(name, "fieldName must not be null");
Assert.notNull(name, "'name' must not be null");
if (!FIELD_NAME_VALID_PATTERN.matcher(name).matches()) {
logger.warn(LogMessage.format("'%s' is not a valid field name according to GELF standard", name));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static SslManagerBundle from(SslStoreBundle storeBundle, SslBundleKey key) {
* @since 3.5.0
*/
static SslManagerBundle from(TrustManagerFactory trustManagerFactory) {
Assert.notNull(trustManagerFactory, "TrustManagerFactory must not be null");
Assert.notNull(trustManagerFactory, "'trustManagerFactory' must not be null");
KeyManagerFactory defaultKeyManagerFactory = createDefaultKeyManagerFactory();
return of(defaultKeyManagerFactory, trustManagerFactory);
}
Expand All @@ -145,7 +145,7 @@ static SslManagerBundle from(TrustManagerFactory trustManagerFactory) {
* @since 3.5.0
*/
static SslManagerBundle from(TrustManager... trustManagers) {
Assert.notNull(trustManagers, "TrustManagers must not be null");
Assert.notNull(trustManagers, "'trustManagers' must not be null");
KeyManagerFactory defaultKeyManagerFactory = createDefaultKeyManagerFactory();
TrustManagerFactory defaultTrustManagerFactory = createDefaultTrustManagerFactory();
return of(defaultKeyManagerFactory, FixedTrustManagerFactory.of(defaultTrustManagerFactory, trustManagers));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public SimpleAsyncTaskSchedulerBuilder taskDecorator(TaskDecorator taskDecorator
* @see #additionalCustomizers(SimpleAsyncTaskSchedulerCustomizer...)
*/
public SimpleAsyncTaskSchedulerBuilder customizers(SimpleAsyncTaskSchedulerCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
Assert.notNull(customizers, "'customizers' must not be null");
return customizers(Arrays.asList(customizers));
}

Expand All @@ -146,7 +146,7 @@ public SimpleAsyncTaskSchedulerBuilder customizers(SimpleAsyncTaskSchedulerCusto
*/
public SimpleAsyncTaskSchedulerBuilder customizers(
Iterable<? extends SimpleAsyncTaskSchedulerCustomizer> customizers) {
Assert.notNull(customizers, "Customizers must not be null");
Assert.notNull(customizers, "'customizers' must not be null");
return new SimpleAsyncTaskSchedulerBuilder(this.threadNamePrefix, this.concurrencyLimit, this.virtualThreads,
this.taskTerminationTimeout, this.taskDecorator, append(null, customizers));
}
Expand All @@ -160,7 +160,7 @@ public SimpleAsyncTaskSchedulerBuilder customizers(
* @see #customizers(SimpleAsyncTaskSchedulerCustomizer...)
*/
public SimpleAsyncTaskSchedulerBuilder additionalCustomizers(SimpleAsyncTaskSchedulerCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
Assert.notNull(customizers, "'customizers' must not be null");
return additionalCustomizers(Arrays.asList(customizers));
}

Expand All @@ -174,7 +174,7 @@ public SimpleAsyncTaskSchedulerBuilder additionalCustomizers(SimpleAsyncTaskSche
*/
public SimpleAsyncTaskSchedulerBuilder additionalCustomizers(
Iterable<? extends SimpleAsyncTaskSchedulerCustomizer> customizers) {
Assert.notNull(customizers, "Customizers must not be null");
Assert.notNull(customizers, "'customizers' must not be null");
return new SimpleAsyncTaskSchedulerBuilder(this.threadNamePrefix, this.concurrencyLimit, this.virtualThreads,
this.taskTerminationTimeout, this.taskDecorator, append(this.customizers, customizers));
}
Expand Down
Loading