Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F415A200CC8 for ; Fri, 14 Jul 2017 14:39:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F2BB916DA62; Fri, 14 Jul 2017 12:39:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6B4D816DA5E for ; Fri, 14 Jul 2017 14:39:06 +0200 (CEST) Received: (qmail 23429 invoked by uid 500); 14 Jul 2017 12:39:05 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 23417 invoked by uid 99); 14 Jul 2017 12:39:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2017 12:39:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 31065E7EA5; Fri, 14 Jul 2017 12:39:05 +0000 (UTC) From: jainbhupendra24 To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org References: In-Reply-To: Subject: [GitHub] zookeeper pull request #279: ZOOKEEPER-2804:Node creation fails with NPE if ... Content-Type: text/plain Message-Id: <20170714123905.31065E7EA5@git1-us-west.apache.org> Date: Fri, 14 Jul 2017 12:39:05 +0000 (UTC) archived-at: Fri, 14 Jul 2017 12:39:07 -0000 Github user jainbhupendra24 commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/279#discussion_r127447190 --- Diff: src/java/main/org/apache/zookeeper/ZooKeeper.java --- @@ -1436,7 +1436,7 @@ public String create(final String path, byte data[], List acl, request.setData(data); request.setFlags(createMode.toFlag()); request.setPath(serverPath); - if (acl != null && acl.size() == 0) { + if (acl == null || acl.isEmpty() || acl.contains(null)) { --- End diff -- Throwing IllegalArgumentException is the correct way but it may break the existing behavior. Consider the case where application code is like zk.create(callBackHandler)` // call to create api and callback handler is passed doSomething(); - - - - // some more stuff At present, if client pass null ACL parameter, the error will be handled by callBackHandler and in application code doSomething() method will execute. But if we throw IllegalArgumentException , then doSomething() method will not execute. So it will change the existing behavior of application code. Please suggest if we really need to handle this case. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---