From d7649dfc7ed40d82aada64673d299a1f49c67861 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Tue, 15 Apr 2014 17:04:40 +0100 Subject: [PATCH] 8040262: (fs) Misc. typos in comments and implementation Reviewed-by: alanb, chegar --- jdk/src/share/classes/java/nio/file/Files.java | 13 ++++++------- .../java/nio/file/spi/FileSystemProvider.java | 2 +- .../classes/sun/nio/fs/LinuxNativeDispatcher.java | 4 ++-- .../classes/sun/nio/fs/MagicFileTypeDetector.java | 4 ++-- .../sun/nio/fs/SolarisAclFileAttributeView.java | 2 +- .../classes/sun/nio/fs/SolarisWatchService.java | 4 ++-- .../classes/sun/nio/fs/UnixDirectoryStream.java | 2 +- .../classes/sun/nio/fs/UnixFileAttributeViews.java | 2 +- .../solaris/classes/sun/nio/fs/UnixFileSystem.java | 2 +- .../sun/nio/fs/WindowsAclFileAttributeView.java | 2 +- .../classes/sun/nio/fs/WindowsConstants.java | 2 +- .../sun/nio/fs/WindowsFileAttributeViews.java | 8 ++++---- .../sun/nio/fs/WindowsFileSystemProvider.java | 4 ++-- .../classes/sun/nio/fs/WindowsNativeDispatcher.java | 2 +- jdk/src/windows/classes/sun/nio/fs/WindowsPath.java | 2 +- .../windows/classes/sun/nio/fs/WindowsSecurity.java | 6 +++--- .../nio/fs/WindowsUserDefinedFileAttributeView.java | 2 +- .../classes/sun/nio/fs/WindowsWatchService.java | 2 +- 18 files changed, 32 insertions(+), 33 deletions(-) diff --git a/jdk/src/share/classes/java/nio/file/Files.java b/jdk/src/share/classes/java/nio/file/Files.java index 012118c60f6..2bad1ac3b8e 100644 --- a/jdk/src/share/classes/java/nio/file/Files.java +++ b/jdk/src/share/classes/java/nio/file/Files.java @@ -38,7 +38,6 @@ import java.io.Reader; 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 @@ public final class Files { // 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 @@ public final class Files { return target; } - // -- Miscellenous -- + // -- Miscellaneous -- /** * Reads the target of a symbolic link (optional operation). @@ -1535,7 +1534,7 @@ public final class Files { private static class FileTypeDetectors{ static final FileTypeDetector defaultFileTypeDetector = createDefaultFileTypeDetector(); - static final List installeDetectors = + static final List installedDetectors = loadInstalledDetectors(); // creates the default file type detector @@ -1614,7 +1613,7 @@ public final class Files { 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 @@ public final class Files { * * * {@code "posix:permissions,owner,size"} - * Reads the POSX file permissions, owner, and file size. + * Reads the POSIX file permissions, owner, and file size. * * * @@ -2448,7 +2447,7 @@ public final class Files { } /** - * 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 { diff --git a/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java b/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java index bed84168cef..def1cca7a57 100644 --- a/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java +++ b/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java @@ -81,7 +81,7 @@ public abstract class FileSystemProvider { // installed providers private static volatile List 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() { diff --git a/jdk/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java b/jdk/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java index 0186870688a..e8d8dc8d6e2 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java +++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java @@ -77,7 +77,7 @@ class LinuxNativeDispatcher extends UnixNativeDispatcher { } 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 @@ class LinuxNativeDispatcher extends UnixNativeDispatcher { } 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); diff --git a/jdk/src/solaris/classes/sun/nio/fs/MagicFileTypeDetector.java b/jdk/src/solaris/classes/sun/nio/fs/MagicFileTypeDetector.java index 11bc3a529d7..801bd626724 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/MagicFileTypeDetector.java +++ b/jdk/src/solaris/classes/sun/nio/fs/MagicFileTypeDetector.java @@ -36,7 +36,7 @@ import java.security.PrivilegedAction; 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 @@ class MagicFileTypeDetector extends AbstractFileTypeDetector { 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(); } diff --git a/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java b/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java index 6d72cd14487..f3ba7b3e6f0 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java +++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java @@ -290,7 +290,7 @@ class SolarisAclFileAttributeView 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); diff --git a/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java b/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java index e68ceab1036..0c1165ff5f4 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java +++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java @@ -627,14 +627,14 @@ class SolarisWatchService /** * 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> 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); diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java b/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java index 60f958203df..44d61b74b7f 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java @@ -48,7 +48,7 @@ class UnixDirectoryStream // filter (may be null) private final DirectoryStream.Filter filter; - // used to coorindate closing of directory stream + // used to coordinate closing of directory stream private final ReentrantReadWriteLock streamLock = new ReentrantReadWriteLock(true); diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java b/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java index 4d719d3aace..89d94aa02a8 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java @@ -133,7 +133,7 @@ class UnixFileAttributeViews { 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 posixAttributeNames = Util.newSet(basicAttributeNames, PERMISSIONS_NAME, OWNER_NAME, GROUP_NAME); diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java b/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java index c902acea980..2dad464cb11 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java @@ -339,7 +339,7 @@ abstract class UnixFileSystem }; } - // 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); diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java b/jdk/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java index ee8eb3698c2..57ab16dab12 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java @@ -61,7 +61,7 @@ class WindowsAclFileAttributeView this.followLinks = followLinks; } - // permision check + // permission check private void checkAccess(WindowsPath file, boolean checkRead, boolean checkWrite) diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsConstants.java b/jdk/src/windows/classes/sun/nio/fs/WindowsConstants.java index f691ad59725..d644a4b1ec3 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsConstants.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsConstants.java @@ -94,7 +94,7 @@ class WindowsConstants { 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; diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java b/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java index 737bbd73e98..6632afc2b00 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java @@ -98,9 +98,9 @@ class WindowsFileAttributeViews { 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 @@ class WindowsFileAttributeViews { 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 dosAttributeNames = Util.newSet(basicAttributeNames, READONLY_NAME, ARCHIVE_NAME, SYSTEM_NAME, HIDDEN_NAME, ATTRIBUTES_NAME); @@ -223,7 +223,7 @@ class WindowsFileAttributeViews { { 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 { diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java b/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java index bd5f890d3ab..e86c385a622 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java @@ -384,7 +384,7 @@ public class WindowsFileSystemProvider 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 @@ public class WindowsFileSystemProvider } /* - * 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). */ diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java b/jdk/src/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java index a380c3d3393..d20d12fb053 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java @@ -917,7 +917,7 @@ class WindowsNativeDispatcher { } } private static native void CreateHardLink0(long newFileBuffer, - long existingFiletBuffer) throws WindowsException; + long existingFileBuffer) throws WindowsException; /** * GetFullPathName( diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java b/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java index 4ccaf5dbb12..e0a6e5be15a 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java @@ -133,7 +133,7 @@ class WindowsPath extends AbstractPath { /** * Special implementation with attached/cached attributes (used to quicken - * file tree traveral) + * file tree traversal) */ private static class WindowsPathWithAttributes extends WindowsPath implements BasicFileAttributesHolder diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsSecurity.java b/jdk/src/windows/classes/sun/nio/fs/WindowsSecurity.java index 1ceb570f1de..7e8af3e426b 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsSecurity.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsSecurity.java @@ -129,11 +129,11 @@ class WindowsSecurity { 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) { diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java b/jdk/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java index 45f5d064459..64ef12a9855 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java @@ -200,7 +200,7 @@ class WindowsUserDefinedFileAttributeView public List 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 { diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java b/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java index 4ad10243f02..6677c874348 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java @@ -556,7 +556,7 @@ class WindowsWatchService // 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.