mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb
This commit is contained in:
parent
c998ead188
commit
a3df1d618e
155 changed files with 340 additions and 382 deletions
|
@ -58,8 +58,7 @@ abstract class UnixFileSystem
|
|||
// default directory.
|
||||
String propValue = GetPropertyAction
|
||||
.privilegedGetProperty("sun.nio.fs.chdirAllowed", "false");
|
||||
boolean chdirAllowed = (propValue.length() == 0) ?
|
||||
true : Boolean.valueOf(propValue);
|
||||
boolean chdirAllowed = propValue.isEmpty() ? true : Boolean.parseBoolean(propValue);
|
||||
if (chdirAllowed) {
|
||||
this.needToResolveAgainstDefaultDirectory = true;
|
||||
} else {
|
||||
|
@ -269,7 +268,7 @@ abstract class UnixFileSystem
|
|||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(first);
|
||||
for (String segment: more) {
|
||||
if (segment.length() > 0) {
|
||||
if (!segment.isEmpty()) {
|
||||
if (sb.length() > 0)
|
||||
sb.append('/');
|
||||
sb.append(segment);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue