Gary Gregory
2018-10-11 03:28:33 UTC
Please update the changes.xml and close the Jira ticket if the work is done.
Gary
Gary
[
https://issues.apache.org/jira/browse/COLLECTIONS-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16640867#comment-16640867
]
--------------------------------------------
https://github.com/apache/commons-collections/pull/55
----------------------------------------------------------------------------------------------------------
modifying the list of the constructed FixedSizeList. Not sure if this was
by design, but at the very list I think the JavaDoc should caution against
this.
This message was sent by Atlassian JIRA
(v7.6.3#76005)
https://issues.apache.org/jira/browse/COLLECTIONS-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16640867#comment-16640867
]
--------------------------------------------
https://github.com/apache/commons-collections/pull/55
JavaDoc for FixedSizeList should warn that modifying underlying list is
still allowed and is not prevented----------------------------------------------------------------------------------------------------------
Key: COLLECTIONS-697
https://issues.apache.org/jira/browse/COLLECTIONS-697Project: Commons Collections
Issue Type: Bug
Reporter: Ranjan George
Priority: Major
I just noticed that it is not explicitly mentioned in the JavaDoc that
modifying the underlying list of a FixedSizeList would actually land upIssue Type: Bug
Reporter: Ranjan George
Priority: Major
I just noticed that it is not explicitly mentioned in the JavaDoc that
modifying the list of the constructed FixedSizeList. Not sure if this was
by design, but at the very list I think the JavaDoc should caution against
this.
Following is a test case that written that you could use to check this.
{code:java}
public void testAllowsMutationOfUnderlyingCollection() {
List<String> decoratedList = new ArrayList<>();
decoratedList.add("item 1");
decoratedList.add("item 2");
//
FixedSizeList<String> fixedSizeList =
FixedSizeList.fixedSizeList(decoratedList);{code:java}
public void testAllowsMutationOfUnderlyingCollection() {
List<String> decoratedList = new ArrayList<>();
decoratedList.add("item 1");
decoratedList.add("item 2");
//
FixedSizeList<String> fixedSizeList =
int sizeBefore = fixedSizeList.size();
//
boolean changed = decoratedList.add("New Value");
Assert.assertTrue(changed);
//
Assert.assertEquals("Modifying an the underlying list is allowed",
sizeBefore + 1, fixedSizeList.size());//
boolean changed = decoratedList.add("New Value");
Assert.assertTrue(changed);
//
Assert.assertEquals("Modifying an the underlying list is allowed",
}
{code}
--{code}
This message was sent by Atlassian JIRA
(v7.6.3#76005)