hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Purtell <apurt...@apache.org>
Subject Re: avoiding a NPE in ZKUtil.java on 0.90 branch
Date Thu, 23 Jun 2011 18:38:59 GMT
I committed this.

--- On Wed, 6/22/11, Andrew Purtell <apurtell@apache.org> wrote:

> Something was committed to trunk but not 0.90, not sure if there
> is a jira associated with the change.
> 
> Index: src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
> ===================================================================
> --- src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java (revision 1138696)
> +++ src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java (working copy)
> @@ -1015,10 +1015,9 @@
>    public static void
> deleteChildrenRecursively(ZooKeeperWatcher zkw, String node)
>    throws KeeperException {
>      List<String> children = ZKUtil.listChildrenNoWatch(zkw, node);
> -    if(children != null || !children.isEmpty()) {
> -      for(String child : children) {
> -        deleteNodeRecursively(zkw, joinZNode(node, child));
> -      }
> +    if (children == null || children.isEmpty()) return;
> +    for(String child : children) {
> +      deleteNodeRecursively(zkw, joinZNode(node, child));
>      }
>    }


Mime
View raw message