Use Supplier variants of Assert methods
See gh-12630
This commit is contained in:
committed by
Stephane Nicoll
parent
d771485efb
commit
3b0f6e7168
@@ -124,14 +124,14 @@ abstract class ArchiveCommand extends OptionParsingCommand {
|
||||
protected ExitStatus run(OptionSet options) throws Exception {
|
||||
List<?> nonOptionArguments = new ArrayList<Object>(
|
||||
options.nonOptionArguments());
|
||||
Assert.isTrue(nonOptionArguments.size() >= 2, "The name of the resulting "
|
||||
Assert.isTrue(nonOptionArguments.size() >= 2, () -> "The name of the resulting "
|
||||
+ this.type + " and at least one source file must be specified");
|
||||
|
||||
File output = new File((String) nonOptionArguments.remove(0));
|
||||
Assert.isTrue(
|
||||
output.getName().toLowerCase(Locale.ENGLISH)
|
||||
.endsWith("." + this.type),
|
||||
"The output '" + output + "' is not a "
|
||||
() -> "The output '" + output + "' is not a "
|
||||
+ this.type.toUpperCase(Locale.ENGLISH) + " file.");
|
||||
deleteIfExists(output);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user