Konrad Windszus created COLLECTIONS-695:
-------------------------------------------

             Summary: PatriciaTrie.submap() does not return expected map
                 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


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)

Reply via email to