commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Semrau (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COLLECTIONS-307) SetUniqueList.subList().contains() method checks against full parent list, not sublist range
Date Wed, 12 Nov 2008 17:01:51 GMT

    [ https://issues.apache.org/jira/browse/COLLECTIONS-307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646952#action_12646952
] 

Christian Semrau commented on COLLECTIONS-307:
----------------------------------------------

The same problem occurs with containsAll().

> 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
>
> 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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message