mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8246592: Simplify checking of boolean file attributes
Reviewed-by: rriggs, alanb
This commit is contained in:
parent
1786701011
commit
9cd41b6555
4 changed files with 47 additions and 9 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue