[
https://issues.apache.org/jira/browse/CURATOR-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17268238#comment-17268238
]
Cam McKenzie commented on CURATOR-586:
--------------------------------------
I seem to recall some users having issues with a similar fix in the past too. I
can't find the specifics but the NamespaceFacadeCache has an explicit 'null
namespace' set up in it and NamespaceImpl has explicit checks for a null
namespace in the fix/unfix forNamespace methods.
So, really I think this is only an issue for clients that are explicitly
calling getNamespace() on the NamespaceFacade and doing something custom with
that string. Internally, the null namespace seems to be supported correctly.
So, I'm not convinced this should be changed.
> NamespaceFacade return null if namespace is empty
> -------------------------------------------------
>
> Key: CURATOR-586
> URL: https://issues.apache.org/jira/browse/CURATOR-586
> Project: Apache Curator
> Issue Type: Bug
> Components: Framework
> Reporter: Nikita Ryanov
> Priority: Trivial
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> According to java doc framework should return empty string if namespace is
> empty instead of null:
>
> {code:java}
> /**
> * Return the current namespace or "" if none
> *
> * @return namespace
> */
> public String getNamespace();
> {code}
>
> If namespace is claimed from CuratorFramework client directly all is ok, but
> if NamespaceFacade is used then null is returned.
> How to reproduce:
> {code:java}
> RetryPolicy policy = ...;
> CuratorFramework client =
> CuratorFrameworkFactory.newClient("connectionString", policy);
> CuratorFramework clientWithNamespaceFacade = client.usingNamespace(null);
> clientWithNamespaceFacade.getNamespace(); // <- expected "", but got null
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)