You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/09/29 04:58:29 UTC

[GitHub] [commons-collections] akiyamaneko opened a new pull request #185: prevent setCollection API In FixedSizeList

akiyamaneko opened a new pull request #185:
URL: https://github.com/apache/commons-collections/pull/185


   prevent `setCollection` API In FixedSizeList
   `setCollection` can replace the whole list, it is better not to support the api.
   
   ```java
           List<String> initList = new ArrayList<String>() {{
               add("hello");
               add("world");
           }};
   
           FixedSizeList<String> fixedSizeList = new FixedSizeList<>(initList);
           //  size is 2
           System.out.println(fixedSizeList.size());
   
           List<String> replacedList = new ArrayList<String>() {{
               add("replaced");
               add("list");
               add("test");
           }};
           fixedSizeList.setCollection(replacedList);
           // size now change to 3
           System.out.println(fixedSizeList.size());
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-collections] akiyamaneko closed pull request #185: prevent setCollection API In FixedSizeList

Posted by GitBox <gi...@apache.org>.
akiyamaneko closed pull request #185:
URL: https://github.com/apache/commons-collections/pull/185


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org