Use Assert.state() with Supplier where possible
See gh-10658
This commit is contained in:
committed by
Stephane Nicoll
parent
3e18213362
commit
3b71393e0a
@@ -76,7 +76,7 @@ public final class ChangedFile {
|
||||
File file = this.file.getAbsoluteFile();
|
||||
String folderName = StringUtils.cleanPath(folder.getPath());
|
||||
String fileName = StringUtils.cleanPath(file.getPath());
|
||||
Assert.state(fileName.startsWith(folderName), "The file " + fileName
|
||||
Assert.state(fileName.startsWith(folderName), () -> "The file " + fileName
|
||||
+ " is not contained in the source folder " + folderName);
|
||||
return fileName.substring(folderName.length() + 1);
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ public class HttpTunnelServer {
|
||||
long timeout = HttpTunnelServer.this.disconnectTimeout;
|
||||
long duration = System.currentTimeMillis() - this.lastHttpRequestTime;
|
||||
Assert.state(duration < timeout,
|
||||
"Disconnect timeout: " + timeout + " " + duration);
|
||||
() -> "Disconnect timeout: " + timeout + " " + duration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user