You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/06/20 06:27:56 UTC

[GitHub] [hadoop] aajisaka commented on a diff in pull request #4446: HADOOP-18294.Ensure build folder exists before writing checksum file.…

aajisaka commented on code in PR #4446:
URL: https://github.com/apache/hadoop/pull/4446#discussion_r901295661


##########
hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocRunner.java:
##########
@@ -172,6 +172,10 @@ private long computeChecksum(File file) throws IOException {
 
     public void writeChecksums() throws IOException {
       ObjectMapper mapper = new ObjectMapper();
+      boolean folderCreated = checksumFile.getParentFile().mkdirs();
+      if (!folderCreated) {
+        throw new IOException("Unable to create path");
+      }

Review Comment:
   If the parent already exists and it is directory, `folderCreated` will be false and throw IOException. We need to first check if the parent is directory.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org