tasanuma commented on code in PR #6323:
URL: https://github.com/apache/hadoop/pull/6323#discussion_r1438473858
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java:
##########
@@ -1423,9 +1420,7 @@ private static boolean format(Configuration conf, boolean
force,
LOG.warn("Encountered exception during format", ioe);
throw ioe;
} finally {
- if (fsImage != null) {
- fsImage.close();
- }
+ fsImage.close();
Review Comment:
@slfan1989 Since the `fsImage` variable is initialized with `new FSImage`,
it can't be null, and IntelliJ has issued a warning that `fsImage != null is
always true`. Generally, even in such situations, performing a null check is
considered good practice as future code changes could potentially cause the
variable to become null. However, I thought this is unlikely in this case.
--
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]