[
https://issues.apache.org/jira/browse/HADOOP-18294?focusedWorklogId=784706&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-784706
]
ASF GitHub Bot logged work on HADOOP-18294:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 24/Jun/22 19:59
Start Date: 24/Jun/22 19:59
Worklog Time Spent: 10m
Work Description: ashutoshcipher commented on code in PR #4446:
URL: https://github.com/apache/hadoop/pull/4446#discussion_r906369399
##########
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:
@aajisaka - The other way I can I can think of will be directly doing
```
checksumFile.getParentFile().mkdirs();
```
and not checking the results at all. But then SpotBug will complain about
the result not checked.
Issue Time Tracking
-------------------
Worklog Id: (was: 784706)
Time Spent: 50m (was: 40m)
> Ensure build folder exists before writing checksum
> file.ProtocRunner#writeChecksums
> -----------------------------------------------------------------------------------
>
> Key: HADOOP-18294
> URL: https://issues.apache.org/jira/browse/HADOOP-18294
> Project: Hadoop Common
> Issue Type: Improvement
> Affects Versions: 3.3.3
> Reporter: Ashutosh Gupta
> Assignee: Ashutosh Gupta
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Ensure build folder exists before writing checksum
> file.ProtocRunner#writeChecksums
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]