symious commented on code in PR #3342:
URL: https://github.com/apache/ozone/pull/3342#discussion_r862470317


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/NetUtils.java:
##########
@@ -149,4 +149,28 @@ public static List<Node> getAncestorList(NetworkTopology 
topology,
     }
     return ancestorList;
   }
+
+  /**
+   * Ensure {@link NetConstants#PATH_SEPARATOR_STR} is added to the suffix of
+   * the path.
+   * @param path path to add suffix
+   * @return the normalised path
+   * If <i>path</i>is empty, then {@link NetConstants#ROOT} is returned
+   */
+  public static String addSuffix(String path) {
+    if (path == null) {
+      return null;
+    }

Review Comment:
   I think it's a little different here. This method shouldn't change the fact 
that it's a null. If we return "/" for null strings, `isDescentof(null)` will 
always return true, which is not what we expected.



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