< prev index next >

src/java.base/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java

Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb

@@ -115,11 +115,11 @@
                         return null;
                     }
                 }
                 name = strings[value];
                 // If name is empty in standalone, try its `format' style.
-                if (name.length() == 0
+                if (name.isEmpty()
                         && (style == SHORT_STANDALONE || style == LONG_STANDALONE
                             || style == NARROW_STANDALONE)) {
                     name = getDisplayName(calendarType, field, value,
                                           getBaseStyle(style),
                                           locale);

@@ -181,11 +181,11 @@
                         int base = (field == DAY_OF_WEEK) ? 1 : 0;
                         for (int i = 0; i < strings.length; i++) {
                             String name = strings[i];
                             // Ignore any empty string (some standalone month names
                             // are not defined)
-                            if (name.length() == 0) {
+                            if (name.isEmpty()) {
                                 continue;
                             }
                             map.put(name, base + i);
                         }
                     }
< prev index next >