From 3d27391d47910f73c1e889b76030a53038a38f25 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Fri, 5 Jun 2020 17:25:00 +0200 Subject: [PATCH] Allow StringSequence.isEmpty() to be compatible with JDK 15 JDK 15 introduces isEmpty() on CharSequence which clashes with the one declared in StringSequence because it is not public. See gh-21713 --- .../org/springframework/boot/loader/jar/StringSequence.java | 6 +++++- src/checkstyle/checkstyle-suppressions.xml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/StringSequence.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/StringSequence.java index 25822d0fcd..b77492e562 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/StringSequence.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/StringSequence.java @@ -72,7 +72,11 @@ final class StringSequence implements CharSequence { return new StringSequence(this.source, subSequenceStart, subSequenceEnd); } - boolean isEmpty() { + /** + * Returns {@code true} if the sequence is empty. Public to be compatible with JDK 15. + * @return {@code true} if {@link #length()} is {@code 0}, otherwise {@code false} + */ + public boolean isEmpty() { return length() == 0; } diff --git a/src/checkstyle/checkstyle-suppressions.xml b/src/checkstyle/checkstyle-suppressions.xml index 7eb5d2d0c2..e2dc2e9cdd 100644 --- a/src/checkstyle/checkstyle-suppressions.xml +++ b/src/checkstyle/checkstyle-suppressions.xml @@ -46,4 +46,5 @@ +