Use Supplier variants of Assert

See gh-19864
This commit is contained in:
dreis2211
2020-01-23 07:44:54 +01:00
committed by Stephane Nicoll
parent 9fbaf7611b
commit d8e2349e47
18 changed files with 28 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.
@@ -124,7 +124,7 @@ public class FileSystemWatcher {
*/
public void addSourceFolder(File folder) {
Assert.notNull(folder, "Folder must not be null");
Assert.isTrue(!folder.isFile(), "Folder '" + folder + "' must not be a file");
Assert.isTrue(!folder.isFile(), () -> "Folder '" + folder + "' must not be a file");
synchronized (this.monitor) {
checkNotStarted();
this.folders.put(folder, null);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.
@@ -51,7 +51,7 @@ class FolderSnapshot {
*/
FolderSnapshot(File folder) {
Assert.notNull(folder, "Folder must not be null");
Assert.isTrue(!folder.isFile(), "Folder '" + folder + "' must not be a file");
Assert.isTrue(!folder.isFile(), () -> "Folder '" + folder + "' must not be a file");
this.folder = folder;
this.time = new Date();
Set<FileSnapshot> files = new LinkedHashSet<>();