You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2010/06/19 21:42:22 UTC

[jira] Closed: (COLLECTIONS-346) SetUniqueList.decorate throws exceptions that is not documented

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

Henri Yandell closed COLLECTIONS-346.
-------------------------------------

    Resolution: Won't Fix

Agreed, but it should be javadoc'd in java.util.Arrays.asList as that's the location that is throwing the UnsupportedOperationException.

SetUniqueList.decorate() isn't the one making the decision here; the coder is as they've chosen to pass in an unmodifiable list (though Arrays.asList doesn't make that clear, at least in the 1.5 javadoc).

Resolving as nothing for us to do.

> SetUniqueList.decorate throws exceptions that is not documented
> ---------------------------------------------------------------
>
>                 Key: COLLECTIONS-346
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-346
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: List
>    Affects Versions: 3.2
>            Reporter: Jimmy Shi
>
> public static void main(String[] args) {
>         List<String> testList=Arrays.asList("a","b","c","a","b","c","e");
>         SetUniqueList decoratedList = SetUniqueList.decorate(testList);
>         System.out.println(decoratedList);
>     }
>  
> throws below exception:
> Exception in thread "main" java.lang.UnsupportedOperationException
> 	at java.util.AbstractList.remove(AbstractList.java:172)
> 	at java.util.AbstractList$Itr.remove(AbstractList.java:437)
> 	at java.util.AbstractList.removeRange(AbstractList.java:662)
> 	at java.util.AbstractList.clear(AbstractList.java:258)
> 	at org.apache.commons.collections.list.SetUniqueList.decorate(SetUniqueList.java:80)
> caused by the list to decorate is unmodifiable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.