Use Assert.state() with Supplier where possible

See gh-10658
This commit is contained in:
dreis2211
2017-10-16 22:06:58 +02:00
committed by Stephane Nicoll
parent 3e18213362
commit 3b71393e0a
21 changed files with 28 additions and 27 deletions

View File

@@ -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);
}

View File

@@ -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);
}
}