commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konrad Windszus (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (COLLECTIONS-695) PatriciaTrie.subMap() does not return the expected outcome
Date Thu, 13 Sep 2018 17:32:00 GMT

     [ https://issues.apache.org/jira/browse/COLLECTIONS-695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Konrad Windszus updated COLLECTIONS-695:
----------------------------------------
    Description: 
I use a {{PatriciaTrie}} to basically retrieve the entry whose key is the longest prefix of
a requested key. 

Now I do have a simple trie with only two entries:
# {{"/":<somevalue>}}
# {{"/libs/cq/flow/widgets":<someothervalue>"}}

If I call {{subMap("/", "/libs/cq/gui/components/authoring/dialog/"}} I would expect to only
get back a map containing only entry 1. Instead I get back both entries. This happens primarily
with those two specific keys. 

According to the javadoc of {{PatriciaTrie}} 
{quote}
The Trie can return operations in lexicographical order using the 'prefixMap', 'submap', or
'iterator' methods. 
{quote}
(https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/trie/PatriciaTrie.html)

therefore I assumed that according to the lexicographical order only the "/" entry should
be contained in here.

Is this a bug or am I misinterpreting the Javadoc?

  was:
I use a {{PatriciaTrie}} to basically retrieve the entry whose key is the longest prefix of
a requested key. 

Now I do have a simple trie with only two entries:
# {{"/":<somevalue>}}
# {{"/libs/cq/flow/widgets":<someothervalue>"}}
If I call {{subMap("/", "/libs/cq/gui/components/authoring/dialog/"}} I would expect to only
get back a map containing only entry 1. Instead I get back both entries. This happens primarily
with those two specific keys. 

According to the javadoc of {{PatriciaTrie}} 
{quote}
The Trie can return operations in lexicographical order using the 'prefixMap', 'submap', or
'iterator' methods. 
{quote}
(https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/trie/PatriciaTrie.html)

therefore I assumed that according to the lexicographical order only the "/" entry should
be contained in here.

Is this a bug or am I misinterpreting the Javadoc?


> PatriciaTrie.subMap() does not return the expected outcome
> ----------------------------------------------------------
>
>                 Key: COLLECTIONS-695
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-695
>             Project: Commons Collections
>          Issue Type: Bug
>    Affects Versions: 4.2
>            Reporter: Konrad Windszus
>            Priority: Major
>
> I use a {{PatriciaTrie}} to basically retrieve the entry whose key is the longest prefix
of a requested key. 
> Now I do have a simple trie with only two entries:
> # {{"/":<somevalue>}}
> # {{"/libs/cq/flow/widgets":<someothervalue>"}}
> If I call {{subMap("/", "/libs/cq/gui/components/authoring/dialog/"}} I would expect
to only get back a map containing only entry 1. Instead I get back both entries. This happens
primarily with those two specific keys. 
> According to the javadoc of {{PatriciaTrie}} 
> {quote}
> The Trie can return operations in lexicographical order using the 'prefixMap', 'submap',
or 'iterator' methods. 
> {quote}
> (https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/trie/PatriciaTrie.html)

> therefore I assumed that according to the lexicographical order only the "/" entry should
be contained in here.
> Is this a bug or am I misinterpreting the Javadoc?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message