Skip to content

Commit 553b184

Browse files
committed
Polish "Use Supplier variants of Assert methods"
Closes gh-12630
1 parent 3b0f6e7 commit 553b184

File tree

3 files changed

+7
-5
lines changed
  • spring-boot-project

3 files changed

+7
-5
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public Resource resolveConfigLocation() {
5252
if (this.config == null) {
5353
return null;
5454
}
55-
Assert.isTrue(this.config.exists(), () -> "Hazelcast configuration does not exist '"
56-
+ this.config.getDescription() + "'");
55+
Assert.isTrue(this.config.exists(), () -> "Hazelcast configuration does not "
56+
+ "exist '" + this.config.getDescription() + "'");
5757
return this.config;
5858
}
5959

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ protected void doOptions() {
124124
protected ExitStatus run(OptionSet options) throws Exception {
125125
List<?> nonOptionArguments = new ArrayList<Object>(
126126
options.nonOptionArguments());
127-
Assert.isTrue(nonOptionArguments.size() >= 2, () -> "The name of the resulting "
128-
+ this.type + " and at least one source file must be specified");
127+
Assert.isTrue(nonOptionArguments.size() >= 2, () -> "The name of the "
128+
+ "resulting" + this.type + " and at least one source file must be "
129+
+ "specified");
129130

130131
File output = new File((String) nonOptionArguments.remove(0));
131132
Assert.isTrue(

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public ClassLoaderFile(Kind kind, byte[] contents) {
5656
public ClassLoaderFile(Kind kind, long lastModified, byte[] contents) {
5757
Assert.notNull(kind, "Kind must not be null");
5858
Assert.isTrue(kind == Kind.DELETED ? contents == null : contents != null,
59-
() -> "Contents must " + (kind == Kind.DELETED ? "" : "not ") + "be null");
59+
() -> "Contents must " + (kind == Kind.DELETED ? "" : "not ")
60+
+ "be null");
6061
this.kind = kind;
6162
this.lastModified = lastModified;
6263
this.contents = contents;

0 commit comments

Comments
 (0)