8040262: (fs) Misc. typos in comments and implementation
Reviewed-by: alanb, chegar
Contributed-by: pavel.rappo@oracle.com
--- a/jdk/src/share/classes/java/nio/file/Files.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/share/classes/java/nio/file/Files.java Tue Apr 15 17:04:40 2014 +0100
@@ -38,7 +38,6 @@
import java.io.UncheckedIOException;
import java.io.Writer;
import java.nio.channels.Channels;
-import java.nio.channels.FileChannel;
import java.nio.channels.SeekableByteChannel;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
@@ -739,7 +738,7 @@
// don't have permission to get absolute path
se = x;
}
- // find a decendent that exists
+ // find a descendant that exists
Path parent = dir.getParent();
while (parent != null) {
try {
@@ -1400,7 +1399,7 @@
return target;
}
- // -- Miscellenous --
+ // -- Miscellaneous --
/**
* Reads the target of a symbolic link <i>(optional operation)</i>.
@@ -1535,7 +1534,7 @@
private static class FileTypeDetectors{
static final FileTypeDetector defaultFileTypeDetector =
createDefaultFileTypeDetector();
- static final List<FileTypeDetector> installeDetectors =
+ static final List<FileTypeDetector> installedDetectors =
loadInstalledDetectors();
// creates the default file type detector
@@ -1614,7 +1613,7 @@
throws IOException
{
// try installed file type detectors
- for (FileTypeDetector detector: FileTypeDetectors.installeDetectors) {
+ for (FileTypeDetector detector: FileTypeDetectors.installedDetectors) {
String result = detector.probeContentType(path);
if (result != null)
return result;
@@ -1922,7 +1921,7 @@
* </tr>
* <tr>
* <td> {@code "posix:permissions,owner,size"} </td>
- * <td> Reads the POSX file permissions, owner, and file size. </td>
+ * <td> Reads the POSIX file permissions, owner, and file size. </td>
* </tr>
* </table>
* </blockquote>
@@ -2448,7 +2447,7 @@
}
/**
- * Used by isReadbale, isWritable, isExecutable to test access to a file.
+ * Used by isReadable, isWritable, isExecutable to test access to a file.
*/
private static boolean isAccessible(Path path, AccessMode... modes) {
try {
--- a/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java Tue Apr 15 17:04:40 2014 +0100
@@ -81,7 +81,7 @@
// installed providers
private static volatile List<FileSystemProvider> installedProviders;
- // used to avoid recursive loading of instaled providers
+ // used to avoid recursive loading of installed providers
private static boolean loadingProviders = false;
private static Void checkPermission() {
--- a/jdk/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java Tue Apr 15 17:04:40 2014 +0100
@@ -77,7 +77,7 @@
}
private static native int fgetxattr0(int filedes, long nameAddress,
- long valueAdddress, int valueLen) throws UnixException;
+ long valueAddress, int valueLen) throws UnixException;
/**
* fsetxattr(int filedes, const char *name, const void *value, size_t size, int flags);
@@ -94,7 +94,7 @@
}
private static native void fsetxattr0(int filedes, long nameAddress,
- long valueAdddress, int valueLen) throws UnixException;
+ long valueAddress, int valueLen) throws UnixException;
/**
* fremovexattr(int filedes, const char *name);
--- a/jdk/src/solaris/classes/sun/nio/fs/MagicFileTypeDetector.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/solaris/classes/sun/nio/fs/MagicFileTypeDetector.java Tue Apr 15 17:04:40 2014 +0100
@@ -36,7 +36,7 @@
class MagicFileTypeDetector extends AbstractFileTypeDetector {
- private static final String UNKNOW_MIME_TYPE = "application/octet-stream";
+ private static final String UNKNOWN_MIME_TYPE = "application/octet-stream";
// true if libmagic is available and successfully loaded
private final boolean libmagicAvailable;
@@ -57,7 +57,7 @@
try {
byte[] type = probe0(buffer.address());
String mimeType = (type == null) ? null : new String(type);
- return UNKNOW_MIME_TYPE.equals(mimeType) ? null : mimeType;
+ return UNKNOWN_MIME_TYPE.equals(mimeType) ? null : mimeType;
} finally {
buffer.release();
}
--- a/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java Tue Apr 15 17:04:40 2014 +0100
@@ -290,7 +290,7 @@
return acl;
}
- // Retrns true if NFSv4 ACLs not enabled on file system
+ // Returns true if NFSv4 ACLs not enabled on file system
private static boolean isAclsEnabled(int fd) {
try {
long enabled = fpathconf(fd, _PC_ACL_ENABLED);
--- a/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java Tue Apr 15 17:04:40 2014 +0100
@@ -627,14 +627,14 @@
/**
* Update watch key's events. If ENTRY_MODIFY changes to be enabled
- * then register each file in the direcory; If ENTRY_MODIFY changed to
+ * then register each file in the directory; If ENTRY_MODIFY changed to
* be disabled then unregister each file.
*/
void updateEvents(SolarisWatchKey key, Set<? extends WatchEvent.Kind<?>> events)
throws UnixException
{
- // update events, rembering if ENTRY_MODIFY was previously
+ // update events, remembering if ENTRY_MODIFY was previously
// enabled or disabled.
boolean oldModifyEnabled = key.events()
.contains(StandardWatchEventKinds.ENTRY_MODIFY);
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java Tue Apr 15 17:04:40 2014 +0100
@@ -48,7 +48,7 @@
// filter (may be null)
private final DirectoryStream.Filter<? super Path> filter;
- // used to coorindate closing of directory stream
+ // used to coordinate closing of directory stream
private final ReentrantReadWriteLock streamLock =
new ReentrantReadWriteLock(true);
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java Tue Apr 15 17:04:40 2014 +0100
@@ -133,7 +133,7 @@
private static final String OWNER_NAME = "owner";
private static final String GROUP_NAME = "group";
- // the names of the posix attributes (incudes basic)
+ // the names of the posix attributes (includes basic)
static final Set<String> posixAttributeNames =
Util.newSet(basicAttributeNames, PERMISSIONS_NAME, OWNER_NAME, GROUP_NAME);
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java Tue Apr 15 17:04:40 2014 +0100
@@ -339,7 +339,7 @@
};
}
- // Override if the platform has different path match requrement, such as
+ // Override if the platform has different path match requirement, such as
// case insensitive or Unicode canonical equal on MacOSX
Pattern compilePathMatchPattern(String expr) {
return Pattern.compile(expr);
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java Tue Apr 15 17:04:40 2014 +0100
@@ -61,7 +61,7 @@
this.followLinks = followLinks;
}
- // permision check
+ // permission check
private void checkAccess(WindowsPath file,
boolean checkRead,
boolean checkWrite)
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsConstants.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsConstants.java Tue Apr 15 17:04:40 2014 +0100
@@ -94,7 +94,7 @@
public static final int ERROR_NOT_READY = 21;
public static final int ERROR_SHARING_VIOLATION = 32;
public static final int ERROR_FILE_EXISTS = 80;
- public static final int ERROR_INVALID_PARAMATER = 87;
+ public static final int ERROR_INVALID_PARAMETER = 87;
public static final int ERROR_DISK_FULL = 112;
public static final int ERROR_INSUFFICIENT_BUFFER = 122;
public static final int ERROR_INVALID_LEVEL = 124;
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java Tue Apr 15 17:04:40 2014 +0100
@@ -98,9 +98,9 @@
lastAccessTime,
lastWriteTime);
} catch (WindowsException x) {
- // If ERROR_INVALID_PARAMATER is returned and the volume is
+ // If ERROR_INVALID_PARAMETER is returned and the volume is
// FAT then adjust to the FAT epoch and retry.
- if (followLinks && x.lastError() == ERROR_INVALID_PARAMATER) {
+ if (followLinks && x.lastError() == ERROR_INVALID_PARAMETER) {
try {
if (WindowsFileStore.create(file).type().equals("FAT")) {
SetFileTime(handle,
@@ -157,7 +157,7 @@
private static final String HIDDEN_NAME = "hidden";
private static final String ATTRIBUTES_NAME = "attributes";
- // the names of the DOS attribtues (includes basic)
+ // the names of the DOS attributes (includes basic)
static final Set<String> dosAttributeNames =
Util.newSet(basicAttributeNames,
READONLY_NAME, ARCHIVE_NAME, SYSTEM_NAME, HIDDEN_NAME, ATTRIBUTES_NAME);
@@ -223,7 +223,7 @@
{
file.checkWrite();
- // GetFileAttribtues & SetFileAttributes do not follow links so when
+ // GetFileAttributes & SetFileAttributes do not follow links so when
// following links we need the final target
String path = WindowsLinkSupport.getFinalPath(file, followLinks);
try {
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java Tue Apr 15 17:04:40 2014 +0100
@@ -384,7 +384,7 @@
file.getPathForExceptionMessage(), null,
"Permissions does not allow requested access");
- // for write access we neeed to check if the DOS readonly attribute
+ // for write access we need to check if the DOS readonly attribute
// and if the volume is read-only
if (w) {
try {
@@ -553,7 +553,7 @@
}
/*
- * Windows treates symbolic links to directories differently than it
+ * Windows treats symbolic links to directories differently than it
* does to other file types. For that reason we need to check if the
* target is a directory (or a directory junction).
*/
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java Tue Apr 15 17:04:40 2014 +0100
@@ -917,7 +917,7 @@
}
}
private static native void CreateHardLink0(long newFileBuffer,
- long existingFiletBuffer) throws WindowsException;
+ long existingFileBuffer) throws WindowsException;
/**
* GetFullPathName(
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java Tue Apr 15 17:04:40 2014 +0100
@@ -133,7 +133,7 @@
/**
* Special implementation with attached/cached attributes (used to quicken
- * file tree traveral)
+ * file tree traversal)
*/
private static class WindowsPathWithAttributes
extends WindowsPath implements BasicFileAttributesHolder
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsSecurity.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsSecurity.java Tue Apr 15 17:04:40 2014 +0100
@@ -129,11 +129,11 @@
int genericRead, int genericWrite, int genericExecute, int genericAll)
throws WindowsException
{
- int privilegies = TOKEN_QUERY;
- long hToken = OpenThreadToken(GetCurrentThread(), privilegies, false);
+ int privileges = TOKEN_QUERY;
+ long hToken = OpenThreadToken(GetCurrentThread(), privileges, false);
if (hToken == 0L && processTokenWithDuplicateAccess != 0L)
hToken = DuplicateTokenEx(processTokenWithDuplicateAccess,
- privilegies);
+ privileges);
boolean hasRight = false;
if (hToken != 0L) {
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java Tue Apr 15 17:04:40 2014 +0100
@@ -200,7 +200,7 @@
public List<String> list() throws IOException {
if (System.getSecurityManager() != null)
checkAccess(file.getPathForPermissionCheck(), true, false);
- // use stream APIs on Windwos Server 2003 and newer
+ // use stream APIs on Windows Server 2003 and newer
if (file.getFileSystem().supportsStreamEnumeration()) {
return listUsingStreamEnumeration();
} else {
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java Tue Apr 15 11:24:42 2014 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java Tue Apr 15 17:04:40 2014 +0100
@@ -556,7 +556,7 @@
// ReadDirectoryChangesW failed
criticalError = true;
} else {
- // ERROR_MORE_DATA is a warning about incomplite
+ // ERROR_MORE_DATA is a warning about incomplete
// data transfer over TCP/UDP stack. For the case
// [messageSize] is zero in the most of cases.