[ 
https://issues.apache.org/jira/browse/QPID-6593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14596028#comment-14596028
 ] 

Alex Rudyy commented on QPID-6593:
----------------------------------

The implemented changes look Ok to me.
However, I found surprising the while loop in consumeHierarchyPrefix. That 
caused me to spent more time on reading the code then needed.

Why the while loop cannot be replaced with the code below?
{code}
if (_url[_index++] == FORWARD_SLASH_CHAR && _url[_index++] == 
FORWARD_SLASH_CHAR )
{
            return BindingURLParserState.EXCHANGE_NAME;
}
else
{
            _error = "Unexpected character '" + nextChar + "' encountered when 
expecting hierarchy prefix '/'";
            return BindingURLParserState.ERROR;
}
{code}

It seems that validation of URLs like "direct://a/b/c/d/e/f.." is out of scope 
of the JIRA. Is it something which worth raising and fixing?

> [Java Client] Improve BURL validation to detect illegal names such as 
> "/a/b/c/d"
> --------------------------------------------------------------------------------
>
>                 Key: QPID-6593
>                 URL: https://issues.apache.org/jira/browse/QPID-6593
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>            Reporter: Keith Wall
>            Assignee: Keith Wall
>
> With a default address mode of BURL, an address string like "/a/b/c/d" is 
> treated as if it is an attempt to bind an address to the default (no-name) 
> exchange.  
> Attempting to parse such addresses as BURLs should fail.  The client should 
> stop any attempt to create explicit bindings to the default exchange.  
> Attempts to use the default exchange for topics are probably dubious and 
> should maybe generate a warning.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to