Skip to content

Commit af30715

Browse files
author
Xing Lin
committed
Fixed the path comparison
1 parent f77abb0 commit af30715

File tree

1 file changed

+4
-3
lines changed
  • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs

1 file changed

+4
-3
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,9 +1190,10 @@ public Path getTrashRoot(Path path) {
11901190
// targetFSTrashRootPath is the default trash root based on user home
11911191
// dir.
11921192
Path defaultUserHome = res.targetFileSystem.getHomeDirectory();
1193-
if ((mountTargetPath == null || ROOT_PATH.equals(mountTargetPath))
1194-
&& defaultUserHome != null && targetFSTrashRootPath.equals(
1195-
new Path(defaultUserHome, TRASH_PREFIX))) {
1193+
if ((mountTargetPath == null || mountTargetPath.isEmpty()
1194+
|| ROOT_PATH.equals(mountTargetPath)) && defaultUserHome != null
1195+
&& targetFSTrashRootPath.equals(
1196+
defaultUserHome.toUri().getPath() + "/" + TRASH_PREFIX)) {
11961197
return makeQualified(new Path(res.resolvedPath,
11971198
TRASH_PREFIX + "/" + ugi.getShortUserName()));
11981199
} else {

0 commit comments

Comments
 (0)