diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java index 69923438ecc20..86d427c4aacdb 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java @@ -43,7 +43,8 @@ * InodeTree implements a mount-table as a tree of inodes. * It is used to implement ViewFs and ViewFileSystem. * In order to use it the caller must subclass it and implement - * the abstract methods {@link #getTargetFileSystem(INodeDir)}, etc. + * the abstract methods {@link #getTargetFileSystem( + )}, etc. * * The mountable is initialized from the config variables as * specified in {@link ViewFs} @@ -63,7 +64,7 @@ enum ResultKind { EXTERNAL_DIR } - static final Path SlashPath = new Path("/"); + static final Path SLASH_PATH = new Path("/"); // the root of the mount table private final INode root; // the fallback filesystem @@ -479,7 +480,7 @@ protected InodeTree(final Configuration config, final String viewName) String settings = null; if (src.startsWith(linkPrefix)) { src = src.substring(linkPrefix.length()); - if (src.equals(SlashPath.toString())) { + if (src.equals(SLASH_PATH.toString())) { throw new UnsupportedFileSystemException("Unexpected mount table " + "link entry '" + key + "'. Use " + Constants.CONFIG_VIEWFS_LINK_MERGE_SLASH + " instead!"); @@ -634,7 +635,7 @@ ResolveResult resolve(final String p, final boolean resolveLastComponent) T targetFs = root.isInternalDir() ? getRootDir().getInternalDirFs() : getRootLink().getTargetFileSystem(); ResolveResult res = new ResolveResult(ResultKind.INTERNAL_DIR, - targetFs, root.fullPath, SlashPath); + targetFs, root.fullPath, SLASH_PATH); return res; } @@ -681,7 +682,7 @@ ResolveResult resolve(final String p, final boolean resolveLastComponent) final INodeLink link = (INodeLink) nextInode; final Path remainingPath; if (i >= path.length - 1) { - remainingPath = SlashPath; + remainingPath = SLASH_PATH; } else { StringBuilder remainingPathStr = new StringBuilder("/" + path[i + 1]); for (int j = i + 2; j < path.length; ++j) { @@ -701,7 +702,7 @@ ResolveResult resolve(final String p, final boolean resolveLastComponent) // We have resolved to an internal dir in mount table. Path remainingPath; if (resolveLastComponent) { - remainingPath = SlashPath; + remainingPath = SLASH_PATH; } else { // note we have taken care of when path is "/" above // for internal dirs rem-path does not start with / since the lookup