Use Supplier variants of Assert
See gh-19864
This commit is contained in:
committed by
Stephane Nicoll
parent
9fbaf7611b
commit
d8e2349e47
@@ -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);
|
||||
|
||||
@@ -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<>();
|
||||
|
||||
Reference in New Issue
Block a user