Skip to content

Commit 4945806

Browse files
committed
Make StringSequence.isEmpty() public
Make `StringSequence.isEmpty()` public for compatibility with JDK 15. Closes gh-23440
1 parent be00bbc commit 4945806

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/StringSequence.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ public StringSequence subSequence(int start, int end) {
7272
return new StringSequence(this.source, subSequenceStart, subSequenceEnd);
7373
}
7474

75-
boolean isEmpty() {
75+
/**
76+
* Returns {@code true} if the sequence is empty. Public to be compatible with JDK 15.
77+
* @return {@code true} if {@link #length()} is {@code 0}, otherwise {@code false}
78+
*/
79+
public boolean isEmpty() {
7680
return length() == 0;
7781
}
7882

src/checkstyle/checkstyle-suppressions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@
4242
<suppress files="SampleJUnitVintageApplicationTests" checks="SpringJUnit5" />
4343
<suppress files="[\\/]spring-boot-docs[\\/]" checks="SpringJavadoc" message="\@since" />
4444
<suppress files="[\\/]spring-boot-smoke-tests[\\/]" checks="SpringJavadoc" message="\@since" />
45+
<suppress files="StringSequence" checks="SpringMethodVisibility"/>
4546
</suppressions>

0 commit comments

Comments
 (0)