< prev index next >

src/jdk.rmic/share/classes/sun/tools/java/ClassPath.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad

@@ -228,11 +228,11 @@
         String basename = "";
         if (!isDirectory) {
             int i = name.lastIndexOf(File.separatorChar);
             subdir = name.substring(0, i + 1);
             basename = name.substring(i + 1);
-        } else if (!subdir.equals("")
+        } else if (!subdir.isEmpty()
                    && !subdir.endsWith(fileSeparatorChar)) {
             // zip files are picky about "foo" vs. "foo/".
             // also, the getFiles caches are keyed with a trailing /
             subdir = subdir + File.separatorChar;
             name = subdir;      // Note: isDirectory==true & basename==""
< prev index next >