You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2015/11/08 22:28:10 UTC

[jira] [Updated] (COLLECTIONS-304) SetUniqueList set method use corrupts uniqness

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

Thomas Neidhart updated COLLECTIONS-304:
----------------------------------------
    Fix Version/s: 3.2.2

> SetUniqueList set method use corrupts uniqness
> ----------------------------------------------
>
>                 Key: COLLECTIONS-304
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-304
>             Project: Commons Collections
>          Issue Type: Bug
>    Affects Versions: 3.2
>         Environment: JDK 1.6/Windows/Eclipse Ganymede
>            Reporter: RafaƂ Figas
>             Fix For: 3.2.2, 4.0-alpha1, 4.0
>
>         Attachments: COLLECTIONS-304.patch, Commons-304-test.diff
>
>
> When set method is used to put element (Strawberry) on list, then it is possible to add the same element (Strawberry) with add method. Also you cannot add element (Lemon) that has been once removed with set method. Reproduction code below:
> List<String> list = new LinkedList<String>();
> SetUniqueList decoratedList = SetUniqueList.decorate(list);
> decoratedList.add("Apple");
> decoratedList.add("Lemon");
> decoratedList.add("Orange");
> System.out.println(decoratedList.toString());
> decoratedList.set(1, "Strawberry");
> System.out.println(decoratedList.toString());
> decoratedList.add(1, "Strawberry");
> System.out.println(decoratedList.toString());
> decoratedList.add(1, "Lemon");
> System.out.println(decoratedList.toString());



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)