commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (COLLECTIONS-307) SetUniqueList.subList().contains() method checks against full parent list, not sublist range
Date Thu, 28 Feb 2013 20:05:13 GMT

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

Thomas Neidhart resolved COLLECTIONS-307.
-----------------------------------------

    Resolution: Fixed
    
> SetUniqueList.subList().contains() method checks against full parent list, not sublist
range
> --------------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-307
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-307
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: List
>    Affects Versions: 3.2
>            Reporter: Christian Semrau
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: COLLECTIONS-307.patch
>
>
> The view returned by the subList() method of a SetUniqueList checks contains() against
the set of the original list.
> As shown by the following test snippet.
> 		List list = new ArrayList();
> 		List uniqueList = SetUniqueList.decorate(list);
> 		uniqueList.add("Hello");
> 		uniqueList.add("World");
> 		List subList = list.subList(0, 0);
> 		List subUniqueList = uniqueList.subList(0, 0);
> 		assertFalse(subList.contains("World")); // passes
> 		assertFalse(subUniqueList.contains("World")); // fails

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message