From b39b990a72f045524894e7e4665c6ac4efdd73da Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Wed, 13 Mar 2019 19:48:51 +0100 Subject: [PATCH] Use isEmpty() where possible Closes gh-16225 --- .../boot/configurationdocs/SingleKeyEntry.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleKeyEntry.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleKeyEntry.java index 8a6a28db1df..6f8bdf05d9d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleKeyEntry.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleKeyEntry.java @@ -57,7 +57,7 @@ class SingleKeyEntry extends AbstractConfigurationEntry { public void writeAsciidoc(StringBuilder builder) { builder.append("|`+").append(this.key).append("+`").append(NEWLINE); String defaultValue = processDefaultValue(); - if (defaultValue.length() > 0) { + if (!defaultValue.isEmpty()) { builder.append("|`+").append(defaultValue).append("+`").append(NEWLINE); } else { @@ -73,7 +73,7 @@ class SingleKeyEntry extends AbstractConfigurationEntry { } private String processDefaultValue() { - if (this.defaultValue != null && this.defaultValue.length() > 0) { + if (this.defaultValue != null && !this.defaultValue.isEmpty()) { return this.defaultValue.replace("\\", "\\\\").replace("|", "{vbar}" + NEWLINE); }