diff options
| author | Claes Redestad <redestad@openjdk.org> | 2020-06-08 22:47:16 +0200 |
|---|---|---|
| committer | Claes Redestad <redestad@openjdk.org> | 2020-06-08 22:47:16 +0200 |
| commit | 9cd41b65551de0ff86df473c723d97ecf4836b04 (patch) | |
| tree | d255a3d31a5f47c7194f0594534538352e19128c /src/java.base/share/classes/java/io/File.java | |
| parent | 1786701011784ba4e713d7569a3a53b10e5ce1b1 (diff) | |
| download | openjdk-9cd41b65551de0ff86df473c723d97ecf4836b04.tar.gz openjdk-9cd41b65551de0ff86df473c723d97ecf4836b04.zip | |
8246592: Simplify checking of boolean file attributes
Reviewed-by: rriggs, alanb
Diffstat (limited to 'src/java.base/share/classes/java/io/File.java')
| -rw-r--r-- | src/java.base/share/classes/java/io/File.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/java.base/share/classes/java/io/File.java b/src/java.base/share/classes/java/io/File.java index f9606fc7246..28a1bae9d07 100644 --- a/src/java.base/share/classes/java/io/File.java +++ b/src/java.base/share/classes/java/io/File.java @@ -820,7 +820,7 @@ public class File if (isInvalid()) { return false; } - return ((fs.getBooleanAttributes(this) & FileSystem.BA_EXISTS) != 0); + return fs.hasBooleanAttributes(this, FileSystem.BA_EXISTS); } /** @@ -850,8 +850,7 @@ public class File if (isInvalid()) { return false; } - return ((fs.getBooleanAttributes(this) & FileSystem.BA_DIRECTORY) - != 0); + return fs.hasBooleanAttributes(this, FileSystem.BA_DIRECTORY); } /** @@ -883,7 +882,7 @@ public class File if (isInvalid()) { return false; } - return ((fs.getBooleanAttributes(this) & FileSystem.BA_REGULAR) != 0); + return fs.hasBooleanAttributes(this, FileSystem.BA_REGULAR); } /** @@ -912,7 +911,7 @@ public class File if (isInvalid()) { return false; } - return ((fs.getBooleanAttributes(this) & FileSystem.BA_HIDDEN) != 0); + return fs.hasBooleanAttributes(this, FileSystem.BA_HIDDEN); } /** @@ -2103,7 +2102,7 @@ public class File throw se; } } - } while ((fs.getBooleanAttributes(f) & FileSystem.BA_EXISTS) != 0); + } while (fs.hasBooleanAttributes(f, FileSystem.BA_EXISTS)); if (!fs.createFileExclusively(f.getPath())) throw new IOException("Unable to create temporary file"); |
