Use consistent exception messages in Assert calls
Update `Assert` calls to consistently use messages of the form "'item' must [not] ...". Closes gh-43780
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -32,7 +32,7 @@ public class TriggerFileFilter implements FileFilter {
|
||||
private final String name;
|
||||
|
||||
public TriggerFileFilter(String name) {
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -46,7 +46,7 @@ public class ClassPathChangedEvent extends ApplicationEvent {
|
||||
*/
|
||||
public ClassPathChangedEvent(Object source, Set<ChangedFiles> changeSet, boolean restartRequired) {
|
||||
super(source);
|
||||
Assert.notNull(changeSet, "ChangeSet must not be null");
|
||||
Assert.notNull(changeSet, "'changeSet' must not be null");
|
||||
this.changeSet = changeSet;
|
||||
this.restartRequired = restartRequired;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -50,8 +50,8 @@ class ClassPathFileChangeListener implements FileChangeListener {
|
||||
*/
|
||||
ClassPathFileChangeListener(ApplicationEventPublisher eventPublisher, ClassPathRestartStrategy restartStrategy,
|
||||
FileSystemWatcher fileSystemWatcherToStop) {
|
||||
Assert.notNull(eventPublisher, "EventPublisher must not be null");
|
||||
Assert.notNull(restartStrategy, "RestartStrategy must not be null");
|
||||
Assert.notNull(eventPublisher, "'eventPublisher' must not be null");
|
||||
Assert.notNull(restartStrategy, "'restartStrategy' must not be null");
|
||||
this.eventPublisher = eventPublisher;
|
||||
this.restartStrategy = restartStrategy;
|
||||
this.fileSystemWatcherToStop = fileSystemWatcherToStop;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -54,8 +54,8 @@ public class ClassPathFileSystemWatcher implements InitializingBean, DisposableB
|
||||
*/
|
||||
public ClassPathFileSystemWatcher(FileSystemWatcherFactory fileSystemWatcherFactory,
|
||||
ClassPathRestartStrategy restartStrategy, URL[] urls) {
|
||||
Assert.notNull(fileSystemWatcherFactory, "FileSystemWatcherFactory must not be null");
|
||||
Assert.notNull(urls, "Urls must not be null");
|
||||
Assert.notNull(fileSystemWatcherFactory, "'fileSystemWatcherFactory' must not be null");
|
||||
Assert.notNull(urls, "'urls' must not be null");
|
||||
this.fileSystemWatcher = fileSystemWatcherFactory.getFileSystemWatcher();
|
||||
this.restartStrategy = restartStrategy;
|
||||
this.fileSystemWatcher.addSourceDirectories(new ClassPathDirectories(urls));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -43,9 +43,9 @@ public final class ChangedFile {
|
||||
* @param type the type of change
|
||||
*/
|
||||
public ChangedFile(File sourceDirectory, File file, Type type) {
|
||||
Assert.notNull(sourceDirectory, "SourceDirectory must not be null");
|
||||
Assert.notNull(file, "File must not be null");
|
||||
Assert.notNull(type, "Type must not be null");
|
||||
Assert.notNull(sourceDirectory, "'sourceDirectory' must not be null");
|
||||
Assert.notNull(file, "'file' must not be null");
|
||||
Assert.notNull(type, "'type' must not be null");
|
||||
this.sourceDirectory = sourceDirectory;
|
||||
this.file = file;
|
||||
this.type = type;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -50,8 +50,8 @@ class DirectorySnapshot {
|
||||
* @param directory the source directory
|
||||
*/
|
||||
DirectorySnapshot(File directory) {
|
||||
Assert.notNull(directory, "Directory must not be null");
|
||||
Assert.isTrue(!directory.isFile(), () -> "Directory '" + directory + "' must not be a file");
|
||||
Assert.notNull(directory, "'directory' must not be null");
|
||||
Assert.isTrue(!directory.isFile(), () -> "'directory' [%s] must not be a file".formatted(directory));
|
||||
this.directory = directory;
|
||||
this.time = new Date();
|
||||
Set<FileSnapshot> files = new LinkedHashSet<>();
|
||||
@@ -74,10 +74,10 @@ class DirectorySnapshot {
|
||||
}
|
||||
|
||||
ChangedFiles getChangedFiles(DirectorySnapshot snapshot, FileFilter triggerFilter) {
|
||||
Assert.notNull(snapshot, "Snapshot must not be null");
|
||||
Assert.notNull(snapshot, "'snapshot' must not be null");
|
||||
File directory = this.directory;
|
||||
Assert.isTrue(snapshot.directory.equals(directory),
|
||||
() -> "Snapshot source directory must be '" + directory + "'");
|
||||
() -> "'snapshot' source directory must be '" + directory + "'");
|
||||
Set<ChangedFile> changes = new LinkedHashSet<>();
|
||||
Map<File, FileSnapshot> previousFiles = getFilesMap();
|
||||
for (FileSnapshot currentFile : snapshot.files) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -36,8 +36,8 @@ class FileSnapshot {
|
||||
private final long lastModified;
|
||||
|
||||
FileSnapshot(File file) {
|
||||
Assert.notNull(file, "File must not be null");
|
||||
Assert.isTrue(file.isFile() || !file.exists(), "File must not be a directory");
|
||||
Assert.notNull(file, "'file' must not be null");
|
||||
Assert.isTrue(file.isFile() || !file.exists(), () -> "'file' [%s] must be a normal file".formatted(file));
|
||||
this.file = file;
|
||||
this.exists = file.exists();
|
||||
this.length = file.length();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -95,12 +95,12 @@ public class FileSystemWatcher {
|
||||
*/
|
||||
public FileSystemWatcher(boolean daemon, Duration pollInterval, Duration quietPeriod,
|
||||
SnapshotStateRepository snapshotStateRepository) {
|
||||
Assert.notNull(pollInterval, "PollInterval must not be null");
|
||||
Assert.notNull(quietPeriod, "QuietPeriod must not be null");
|
||||
Assert.isTrue(pollInterval.toMillis() > 0, "PollInterval must be positive");
|
||||
Assert.isTrue(quietPeriod.toMillis() > 0, "QuietPeriod must be positive");
|
||||
Assert.notNull(pollInterval, "'pollInterval' must not be null");
|
||||
Assert.notNull(quietPeriod, "'quietPeriod' must not be null");
|
||||
Assert.isTrue(pollInterval.toMillis() > 0, "'pollInterval' must be positive");
|
||||
Assert.isTrue(quietPeriod.toMillis() > 0, "'quietPeriod' must be positive");
|
||||
Assert.isTrue(pollInterval.toMillis() > quietPeriod.toMillis(),
|
||||
"PollInterval must be greater than QuietPeriod");
|
||||
"'pollInterval' must be greater than QuietPeriod");
|
||||
this.daemon = daemon;
|
||||
this.pollInterval = pollInterval.toMillis();
|
||||
this.quietPeriod = quietPeriod.toMillis();
|
||||
@@ -114,7 +114,7 @@ public class FileSystemWatcher {
|
||||
* @param fileChangeListener the listener to add
|
||||
*/
|
||||
public void addListener(FileChangeListener fileChangeListener) {
|
||||
Assert.notNull(fileChangeListener, "FileChangeListener must not be null");
|
||||
Assert.notNull(fileChangeListener, "'fileChangeListener' must not be null");
|
||||
synchronized (this.monitor) {
|
||||
checkNotStarted();
|
||||
this.listeners.add(fileChangeListener);
|
||||
@@ -127,7 +127,7 @@ public class FileSystemWatcher {
|
||||
* @param directories the directories to monitor
|
||||
*/
|
||||
public void addSourceDirectories(Iterable<File> directories) {
|
||||
Assert.notNull(directories, "Directories must not be null");
|
||||
Assert.notNull(directories, "'directories' must not be null");
|
||||
synchronized (this.monitor) {
|
||||
directories.forEach(this::addSourceDirectory);
|
||||
}
|
||||
@@ -139,8 +139,8 @@ public class FileSystemWatcher {
|
||||
* @param directory the directory to monitor
|
||||
*/
|
||||
public void addSourceDirectory(File directory) {
|
||||
Assert.notNull(directory, "Directory must not be null");
|
||||
Assert.isTrue(!directory.isFile(), () -> "Directory '" + directory + "' must not be a file");
|
||||
Assert.notNull(directory, "'directory' must not be null");
|
||||
Assert.isTrue(!directory.isFile(), () -> "'directory' [%s] must not be a file".formatted(directory));
|
||||
synchronized (this.monitor) {
|
||||
checkNotStarted();
|
||||
this.directories.put(directory, null);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -40,13 +40,13 @@ class Frame {
|
||||
* @param payload the text payload
|
||||
*/
|
||||
Frame(String payload) {
|
||||
Assert.notNull(payload, "Payload must not be null");
|
||||
Assert.notNull(payload, "'payload' must not be null");
|
||||
this.type = Type.TEXT;
|
||||
this.payload = payload.getBytes();
|
||||
}
|
||||
|
||||
Frame(Type type) {
|
||||
Assert.notNull(type, "Type must not be null");
|
||||
Assert.notNull(type, "'type' must not be null");
|
||||
this.type = type;
|
||||
this.payload = NO_BYTES;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -76,8 +76,8 @@ public class ClassPathChangeUploader implements ApplicationListener<ClassPathCha
|
||||
private final ClientHttpRequestFactory requestFactory;
|
||||
|
||||
public ClassPathChangeUploader(String url, ClientHttpRequestFactory requestFactory) {
|
||||
Assert.hasLength(url, "URL must not be empty");
|
||||
Assert.notNull(requestFactory, "RequestFactory must not be null");
|
||||
Assert.hasLength(url, "'url' must not be empty");
|
||||
Assert.notNull(requestFactory, "'requestFactory' must not be null");
|
||||
try {
|
||||
this.uri = new URL(url).toURI();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -61,9 +61,9 @@ class DelayedLiveReloadTrigger implements Runnable {
|
||||
|
||||
DelayedLiveReloadTrigger(OptionalLiveReloadServer liveReloadServer, ClientHttpRequestFactory requestFactory,
|
||||
String url) {
|
||||
Assert.notNull(liveReloadServer, "LiveReloadServer must not be null");
|
||||
Assert.notNull(requestFactory, "RequestFactory must not be null");
|
||||
Assert.hasLength(url, "URL must not be empty");
|
||||
Assert.notNull(liveReloadServer, "'liveReloadServer' must not be null");
|
||||
Assert.notNull(requestFactory, "'requestFactory' must not be null");
|
||||
Assert.hasLength(url, "'url' must not be empty");
|
||||
this.liveReloadServer = liveReloadServer;
|
||||
this.requestFactory = requestFactory;
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -44,8 +44,8 @@ public class HttpHeaderInterceptor implements ClientHttpRequestInterceptor {
|
||||
* @param value the header value to populate. Cannot be null or empty.
|
||||
*/
|
||||
public HttpHeaderInterceptor(String name, String value) {
|
||||
Assert.hasLength(name, "Name must not be empty");
|
||||
Assert.hasLength(value, "Value must not be empty");
|
||||
Assert.hasLength(name, "'name' must not be empty");
|
||||
Assert.hasLength(value, "'value' must not be empty");
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -43,8 +43,8 @@ public class Dispatcher {
|
||||
private final List<HandlerMapper> mappers;
|
||||
|
||||
public Dispatcher(AccessManager accessManager, Collection<HandlerMapper> mappers) {
|
||||
Assert.notNull(accessManager, "AccessManager must not be null");
|
||||
Assert.notNull(mappers, "Mappers must not be null");
|
||||
Assert.notNull(accessManager, "'accessManager' must not be null");
|
||||
Assert.notNull(mappers, "'mappers' must not be null");
|
||||
this.accessManager = accessManager;
|
||||
this.mappers = new ArrayList<>(mappers);
|
||||
AnnotationAwareOrderComparator.sort(this.mappers);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -45,7 +45,7 @@ public class DispatcherFilter implements Filter {
|
||||
private final Dispatcher dispatcher;
|
||||
|
||||
public DispatcherFilter(Dispatcher dispatcher) {
|
||||
Assert.notNull(dispatcher, "Dispatcher must not be null");
|
||||
Assert.notNull(dispatcher, "'dispatcher' must not be null");
|
||||
this.dispatcher = dispatcher;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -33,8 +33,8 @@ public class HttpHeaderAccessManager implements AccessManager {
|
||||
private final String expectedSecret;
|
||||
|
||||
public HttpHeaderAccessManager(String headerName, String expectedSecret) {
|
||||
Assert.hasLength(headerName, "HeaderName must not be empty");
|
||||
Assert.hasLength(expectedSecret, "ExpectedSecret must not be empty");
|
||||
Assert.hasLength(headerName, "'headerName' must not be empty");
|
||||
Assert.hasLength(expectedSecret, "'expectedSecret' must not be empty");
|
||||
this.headerName = headerName;
|
||||
this.expectedSecret = expectedSecret;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -38,8 +38,8 @@ public class UrlHandlerMapper implements HandlerMapper {
|
||||
* @param handler the handler to use
|
||||
*/
|
||||
public UrlHandlerMapper(String url, Handler handler) {
|
||||
Assert.hasLength(url, "URL must not be empty");
|
||||
Assert.isTrue(url.startsWith("/"), "URL must start with '/'");
|
||||
Assert.hasLength(url, "'url' must not be empty");
|
||||
Assert.isTrue(url.startsWith("/"), "'url' must start with '/'");
|
||||
this.requestUri = url;
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -35,7 +35,7 @@ class MainMethod {
|
||||
}
|
||||
|
||||
MainMethod(Thread thread) {
|
||||
Assert.notNull(thread, "Thread must not be null");
|
||||
Assert.notNull(thread, "'thread' must not be null");
|
||||
this.method = getMainMethod(thread);
|
||||
}
|
||||
|
||||
|
||||
@@ -129,9 +129,9 @@ public class Restarter {
|
||||
* @see #initialize(String[])
|
||||
*/
|
||||
protected Restarter(Thread thread, String[] args, boolean forceReferenceCleanup, RestartInitializer initializer) {
|
||||
Assert.notNull(thread, "Thread must not be null");
|
||||
Assert.notNull(args, "Args must not be null");
|
||||
Assert.notNull(initializer, "Initializer must not be null");
|
||||
Assert.notNull(thread, "'thread' must not be null");
|
||||
Assert.notNull(args, "'args' must not be null");
|
||||
Assert.notNull(initializer, "'initializer' must not be null");
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Creating new Restarter for thread " + thread);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ public class Restarter {
|
||||
* @param urls the urls to add
|
||||
*/
|
||||
public void addUrls(Collection<URL> urls) {
|
||||
Assert.notNull(urls, "Urls must not be null");
|
||||
Assert.notNull(urls, "'urls' must not be null");
|
||||
this.urls.addAll(urls);
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ public class Restarter {
|
||||
* @param classLoaderFiles the files to add
|
||||
*/
|
||||
public void addClassLoaderFiles(ClassLoaderFiles classLoaderFiles) {
|
||||
Assert.notNull(classLoaderFiles, "ClassLoaderFiles must not be null");
|
||||
Assert.notNull(classLoaderFiles, "'classLoaderFiles' must not be null");
|
||||
this.classLoaderFiles.addAll(classLoaderFiles);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -54,12 +54,12 @@ public class ClassLoaderFile implements Serializable {
|
||||
* @param contents the file contents
|
||||
*/
|
||||
public ClassLoaderFile(Kind kind, long lastModified, byte[] contents) {
|
||||
Assert.notNull(kind, "Kind must not be null");
|
||||
Assert.notNull(kind, "'kind' must not be null");
|
||||
if (kind == Kind.DELETED) {
|
||||
Assert.isTrue(contents == null, "Contents must be null");
|
||||
Assert.isTrue(contents == null, "'contents' must be null");
|
||||
}
|
||||
else {
|
||||
Assert.isTrue(contents != null, "Contents must not be null");
|
||||
Assert.isTrue(contents != null, "'contents' must not be null");
|
||||
}
|
||||
this.kind = kind;
|
||||
this.lastModified = lastModified;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -55,7 +55,7 @@ public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable
|
||||
* @param classLoaderFiles the source classloader files.
|
||||
*/
|
||||
public ClassLoaderFiles(ClassLoaderFiles classLoaderFiles) {
|
||||
Assert.notNull(classLoaderFiles, "ClassLoaderFiles must not be null");
|
||||
Assert.notNull(classLoaderFiles, "'classLoaderFiles' must not be null");
|
||||
this.sourceDirectories = new LinkedHashMap<>(classLoaderFiles.sourceDirectories);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable
|
||||
* @param files the files to add
|
||||
*/
|
||||
public void addAll(ClassLoaderFiles files) {
|
||||
Assert.notNull(files, "Files must not be null");
|
||||
Assert.notNull(files, "'files' must not be null");
|
||||
for (SourceDirectory directory : files.getSourceDirectories()) {
|
||||
for (Map.Entry<String, ClassLoaderFile> entry : directory.getFilesEntrySet()) {
|
||||
addFile(directory.getName(), entry.getKey(), entry.getValue());
|
||||
@@ -89,9 +89,9 @@ public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable
|
||||
* @param file the file to add
|
||||
*/
|
||||
public void addFile(String sourceDirectory, String name, ClassLoaderFile file) {
|
||||
Assert.notNull(sourceDirectory, "SourceDirectory must not be null");
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
Assert.notNull(file, "File must not be null");
|
||||
Assert.notNull(sourceDirectory, "'sourceDirectory' must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
Assert.notNull(file, "'file' must not be null");
|
||||
removeAll(name);
|
||||
getOrCreateSourceDirectory(sourceDirectory).add(name, file);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -57,8 +57,8 @@ public class RestartClassLoader extends URLClassLoader implements SmartClassLoad
|
||||
*/
|
||||
public RestartClassLoader(ClassLoader parent, URL[] urls, ClassLoaderFileRepository updatedFiles) {
|
||||
super(urls, parent);
|
||||
Assert.notNull(parent, "Parent must not be null");
|
||||
Assert.notNull(updatedFiles, "UpdatedFiles must not be null");
|
||||
Assert.notNull(parent, "'parent' must not be null");
|
||||
Assert.notNull(updatedFiles, "'updatedFiles' must not be null");
|
||||
this.updatedFiles = updatedFiles;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -48,7 +48,7 @@ public class HttpRestartServer {
|
||||
* the local classpath
|
||||
*/
|
||||
public HttpRestartServer(SourceDirectoryUrlFilter sourceDirectoryUrlFilter) {
|
||||
Assert.notNull(sourceDirectoryUrlFilter, "SourceDirectoryUrlFilter must not be null");
|
||||
Assert.notNull(sourceDirectoryUrlFilter, "'sourceDirectoryUrlFilter' must not be null");
|
||||
this.server = new RestartServer(sourceDirectoryUrlFilter);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class HttpRestartServer {
|
||||
* @param restartServer the underlying restart server
|
||||
*/
|
||||
public HttpRestartServer(RestartServer restartServer) {
|
||||
Assert.notNull(restartServer, "RestartServer must not be null");
|
||||
Assert.notNull(restartServer, "'restartServer' must not be null");
|
||||
this.server = restartServer;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -38,7 +38,7 @@ public class HttpRestartServerHandler implements Handler {
|
||||
* @param server the server to adapt
|
||||
*/
|
||||
public HttpRestartServerHandler(HttpRestartServer server) {
|
||||
Assert.notNull(server, "Server must not be null");
|
||||
Assert.notNull(server, "'server' must not be null");
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -68,8 +68,8 @@ public class RestartServer {
|
||||
* @param classLoader the application classloader
|
||||
*/
|
||||
public RestartServer(SourceDirectoryUrlFilter sourceDirectoryUrlFilter, ClassLoader classLoader) {
|
||||
Assert.notNull(sourceDirectoryUrlFilter, "SourceDirectoryUrlFilter must not be null");
|
||||
Assert.notNull(classLoader, "ClassLoader must not be null");
|
||||
Assert.notNull(sourceDirectoryUrlFilter, "'sourceDirectoryUrlFilter' must not be null");
|
||||
Assert.notNull(classLoader, "'classLoader' must not be null");
|
||||
this.sourceDirectoryUrlFilter = sourceDirectoryUrlFilter;
|
||||
this.classLoader = classLoader;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user