< prev index next >
src/java.base/share/classes/sun/security/provider/ConfigFile.java
Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD
@@ -624,11 +624,11 @@
// correct one.
try {
return url.openStream();
} catch (Exception e) {
String file = url.getPath();
- if (url.getHost().length() > 0) { // For Windows UNC
+ if (!url.getHost().isEmpty()) { // For Windows UNC
file = "//" + url.getHost() + file;
}
if (debugConfig != null) {
debugConfig.println("cannot read " + url +
", try " + file);
@@ -649,11 +649,11 @@
if (!expandProp) {
return value;
}
String s = PropertyExpander.expand(value);
- if (s == null || s.length() == 0) {
+ if (s == null || s.isEmpty()) {
throw ioException(
"Configuration.Error.Line.line.system.property.value.expanded.to.empty.value",
linenum, value);
}
return s;
< prev index next >