Ranjan George created COLLECTIONS-697:
-----------------------------------------
Summary: JavaDoc for FixedSizeList should warn modifying the
underlying list is still allowed and is not prevented
Key: COLLECTIONS-697
URL: https://issues.apache.org/jira/browse/COLLECTIONS-697
Project: Commons Collections
Issue Type: Bug
Reporter: Ranjan George
{code}
public void testAllowsMutationOfUnderlyingCollection() {
List<String> decoratedList = new ArrayList<>();
decoratedList.add("item 1");
decoratedList.add("item 2");
//
FixedSizeList<String> fixedSizeList =
FixedSizeList.fixedSizeList(decoratedList);
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());
}
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)