Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9BAF718484 for ; Thu, 16 Jul 2015 21:56:05 +0000 (UTC) Received: (qmail 95006 invoked by uid 500); 16 Jul 2015 21:56:05 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 94960 invoked by uid 500); 16 Jul 2015 21:56:05 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 94947 invoked by uid 99); 16 Jul 2015 21:56:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jul 2015 21:56:05 +0000 Date: Thu, 16 Jul 2015 21:56:05 +0000 (UTC) From: "Scott Blum (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CURATOR-236) TreeCache throws IllegalArgumentException when node is a substring of the requested path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CURATOR-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14630408#comment-14630408 ] Scott Blum edited comment on CURATOR-236 at 7/16/15 9:56 PM: ------------------------------------------------------------- CC: [~randgalt] [~mdrob] [~cammckenzie] if any of you would like to review my fix was (Author: dragonsinth): CC: [~randgalt][~mdrob][~cammckenzie] if any of you would like to review my fix > TreeCache throws IllegalArgumentException when node is a substring of the requested path > ---------------------------------------------------------------------------------------- > > Key: CURATOR-236 > URL: https://issues.apache.org/jira/browse/CURATOR-236 > Project: Apache Curator > Issue Type: Bug > Components: Recipes > Affects Versions: 2.8.0 > Environment: JDK 1.7.0_71; OSX Yosemite; > Reporter: Joe Littlejohn > Assignee: Scott Blum > Priority: Minor > Fix For: 2.9.0 > > > The javadocs for the new TreeCache state that {{getCurrentChildren}} will return {{null}} when the given path is not found in the cache. This seems to be the case for most paths, however if the given path contains an existing node as a substring, an exception is thrown: > {code} > Unhandled java.lang.IllegalArgumentException > Path must start with / character > PathUtils.java: 54 org.apache.curator.utils.PathUtils/validatePath > ZKPaths.java: 149 org.apache.curator.utils.ZKPaths/split > TreeCache.java: 597 org.apache.curator.framework.recipes.cache.TreeCache/find > TreeCache.java: 625 org.apache.curator.framework.recipes.cache.TreeCache/getCurrentChildren > nil: -1 sun.reflect.GeneratedMethodAccessor13/invoke > DelegatingMethodAccessorImpl.java: 43 sun.reflect.DelegatingMethodAccessorImpl/invoke > Method.java: 606 java.lang.reflect.Method/invoke > Reflector.java: 93 clojure.lang.Reflector/invokeMatchingMethod > Reflector.java: 28 clojure.lang.Reflector/invokeInstanceMethod > REPL: 1 healthy.zookeeper/eval20736 > {code} > (please ignore the strangely formatted exception, I'm running a Clojure repl in Emacs) > So, lets imagine that I have the following nodes in zookeeper: > {code} > /foo > /foo/bar > /foo/baz > {code} > If I have a TreeCache {{t}} pointing at {{/foo}} then I will get the following results: > {code} > t.getCurrentChildren("/sss") => nil > t.getCurrentChildren("/foo/sss") => nil > t.getCurrentChildren("/foo/barsss") => IllegalArgumentException: Path must start with / character > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)