--- a/src/java.base/share/classes/java/text/AttributedString.java Thu Dec 13 16:14:07 2018 +0100
+++ b/src/java.base/share/classes/java/text/AttributedString.java Thu Dec 13 15:31:05 2018 +0100
@@ -85,7 +85,7 @@
text = buffer.toString();
- if (text.length() > 0) {
+ if (!text.isEmpty()) {
// Determine the runs, creating a new run when the attributes
// differ.
int offset = 0;
@@ -144,7 +144,7 @@
}
this.text = text;
- if (text.length() == 0) {
+ if (text.isEmpty()) {
if (attributes.isEmpty())
return;
throw new IllegalArgumentException("Can't add attribute to 0-length text");