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
pull/21936/head
dreis2211 5 years ago committed by Stephane Nicoll
parent cf3cd0be48
commit 3d27391d47

@ -72,7 +72,11 @@ final class StringSequence implements CharSequence {
return new StringSequence(this.source, subSequenceStart, subSequenceEnd); 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; return length() == 0;
} }

@ -46,4 +46,5 @@
<suppress files="[\\/]src[\\/]intTest[\\/]java[\\/]" checks="SpringJavadoc" message="\@since" /> <suppress files="[\\/]src[\\/]intTest[\\/]java[\\/]" checks="SpringJavadoc" message="\@since" />
<suppress files="LinuxDomainSocket" checks="FinalClass" message="SockaddrUn" /> <suppress files="LinuxDomainSocket" checks="FinalClass" message="SockaddrUn" />
<suppress files="BsdDomainSocket" checks="FinalClass" message="SockaddrUn" /> <suppress files="BsdDomainSocket" checks="FinalClass" message="SockaddrUn" />
<suppress files="StringSequence" checks="SpringMethodVisibility" />
</suppressions> </suppressions>

Loading…
Cancel
Save