< prev index next >
src/java.base/share/classes/jdk/internal/module/Resources.java
Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb
*** 76,86 ****
*/
public static String toResourceName(Path dir, Path file) {
String s = dir.relativize(file)
.toString()
.replace(File.separatorChar, '/');
! if (s.length() > 0 && Files.isDirectory(file))
s += "/";
return s;
}
/**
--- 76,86 ----
*/
public static String toResourceName(Path dir, Path file) {
String s = dir.relativize(file)
.toString()
.replace(File.separatorChar, '/');
! if (!s.isEmpty() && Files.isDirectory(file))
s += "/";
return s;
}
/**
< prev index next >