< prev index next >

src/java.base/share/classes/sun/net/www/MimeEntry.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

@@ -199,13 +199,11 @@
 
         fileExtensions = extensionStrings;
     }
 
     private boolean isStarred(String typeName) {
-        return (typeName != null)
-            && (typeName.length() > 0)
-            && (typeName.endsWith("/*"));
+        return typeName != null && typeName.endsWith("/*");
     }
 
     /**
      * Invoke the MIME type specific behavior for this MIME type.
      * Returned value can be one of several types:

@@ -298,11 +296,11 @@
         if (image != null) {
             sj.add("icon=" + image);
         }
 
         String extensions = getExtensionsAsList();
-        if (extensions.length() > 0) {
+        if (!extensions.isEmpty()) {
             sj.add("file_extensions=" + extensions);
         }
 
         String description = getDescription();
         if (description != null && !description.equals(getType())) {
< prev index next >