Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-346

SetUniqueList.decorate throws exceptions that is not documented

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.2
    • Fix Version/s: None
    • Component/s: List
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              justfly Jimmy Shi

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment