jojochuang commented on a change in pull request #2513:
URL: https://github.com/apache/ozone/pull/2513#discussion_r685652295



##########
File path: 
hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/TimeDurationUtil.java
##########
@@ -55,7 +56,7 @@ public static long getTimeDurationHelper(String name, String 
vStr,
     }
 
     long raw = Long.parseLong(vStr);
-    long converted = unit.convert(raw, vUnit.unit());
+    long converted = unit.convert(raw, Objects.requireNonNull(vUnit).unit());

Review comment:
       if vUnit can be null, it would be better to check its nullity right 
after line 52, and throw an exception there (which can carry a more meaningful 
error message).




-- 
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