adoroszlai commented on PR #6420:
URL: https://github.com/apache/ozone/pull/6420#issuecomment-2081979840

   > In CI, it is prompted that File-related operations cannot be performed, 
such as mkdirs().
   
   ```
   M B RV: Exceptional return value of java.io.File.mkdirs() ignored in 
org.apache.hadoop.ozone.debug.DBScanner.displayTable(ManagedRocksIterator, 
DBColumnFamilyDefinition, boolean)  At DBScanner.java:[line 232]
   ```
   
   
https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html#rv-method-ignores-exceptional-return-value-rv-return-value-ignored-bad-practice
   
   
https://github.com/apache/ozone/blob/c7012f3bc91e92af08f2d89ee6ac1cbb103475d2/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java#L228-L233
   
   `File.mkdirs()` returns `false` if it could not create the directories.  
This return value needs to be handled (e.g. exit with error message).
   
   ```
   M D NP: Possible null pointer dereference in 
org.apache.hadoop.ozone.debug.TestLDBCli.testScanWithRecordsPerFile() due to 
return value of called method  Dereferenced at TestLDBCli.java:[line 286]
   ```
   
   
https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html#np-possible-null-pointer-dereference-due-to-return-value-of-called-method-np-null-on-some-path-from-return-value
   
   
https://github.com/apache/ozone/blob/c7012f3bc91e92af08f2d89ee6ac1cbb103475d2/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLDBCli.java#L285-L286
   
   `File.listFiles` returns `null` if the path is not a directory.  Try 
checking if `tmpDir1` is a directory.  The same applies to `tmpDir2` below.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to