belugabehr commented on a change in pull request #912: HBASE-23380: General 
Cleanup of FSUtil
URL: https://github.com/apache/hbase/pull/912#discussion_r357293320
 
 

 ##########
 File path: hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
 ##########
 @@ -138,20 +137,26 @@ public static boolean isDistributedFileSystem(final 
FileSystem fs) throws IOExce
    * @return True if <code>pathTail</code> is tail on the path of 
<code>pathToSearch</code>
    */
   public static boolean isMatchingTail(final Path pathToSearch, final Path 
pathTail) {
-    if (pathToSearch.depth() != pathTail.depth()) return false;
     Path tailPath = pathTail;
     String tailName;
     Path toSearch = pathToSearch;
     String toSearchName;
     boolean result = false;
+
+    if (pathToSearch.depth() != pathTail.depth()) {
+      return false;
+    }
+
     do {
       tailName = tailPath.getName();
-      if (tailName == null || tailName.length() <= 0) {
 
 Review comment:
   `toSearchName` currently (just a few lines down) does not check for 'null' I 
will add there too.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to