You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2018/10/09 10:06:00 UTC

[jira] [Resolved] (COLLECTIONS-695) PatriciaTrie.subMap() does not return the expected outcome

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

Konrad Windszus resolved COLLECTIONS-695.
-----------------------------------------
    Resolution: Invalid

> 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)