Skip to content

Commit

Permalink
style: remove some redunant comments
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Yu <[email protected]>
  • Loading branch information
yuyang733 committed Dec 14, 2023
1 parent 657d7eb commit 8ccbcf5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/main/java/org/apache/hadoop/fs/CosNFileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public FileStatus getFileStatus(Path f) throws IOException {
Path absolutePath = makeAbsolute(f);
String key = pathToKey(absolutePath);

if (key.length() == 0 || key.equals(PATH_DELIMITER)) { // root always exists
if (key.isEmpty() || key.equals(PATH_DELIMITER)) { // root always exists
return newDirectory(absolutePath);
}

Expand Down Expand Up @@ -888,7 +888,7 @@ public boolean rename(Path src, Path dst) throws IOException {
if (null != dstParentPath) {
LOG.debug("It is not allowed to rename a parent directory:{} to " +
"its subdirectory:{}.", src, dst);
throw new IOException(String.format(
throw new PathIOException(String.format(
"It is not allowed to rename a parent directory:%s to its" +
" subdirectory:%s",
src, dst));
Expand All @@ -902,8 +902,6 @@ public boolean rename(Path src, Path dst) throws IOException {
// and the rename operation is not allowed.
//
if (dstFileStatus.isFile()) {
// throw new FileAlreadyExistsException(String.format(
// "File:%s already exists", dstFileStatus.getPath()));
LOG.debug("File: {} already exists.", dstFileStatus.getPath());
return false;
} else {
Expand All @@ -919,13 +917,8 @@ public boolean rename(Path src, Path dst) throws IOException {
statuses = null;
}
if (null != statuses && statuses.length > 0) {
LOG.debug("Cannot rename {} to {}, file already exists.",
LOG.debug("Cannot rename {} to {}, the destination directory is non-empty.",
src, dst);
// throw new FileAlreadyExistsException(
// String.format(
// "File: %s already exists", dst
// )
// );
return false;
}
}
Expand Down

0 comments on commit 8ccbcf5

Please sign in to comment.