[JIRA] Closed: (JXT-82) ListView's clear empties the whole backingList instead of only the entries it's responsible for

Brent Putman (JIRA) noreply at shibboleth.net
Sat Oct 22 19:56:26 BST 2011


     [ https://issues.shibboleth.net/jira/browse/JXT-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brent Putman closed JXT-82.
---------------------------

    Resolution: Fixed

Fixed in r743.

> ListView's clear empties the whole backingList instead of only the entries it's responsible for
> -----------------------------------------------------------------------------------------------
>
>                 Key: JXT-82
>                 URL: https://issues.shibboleth.net/jira/browse/JXT-82
>             Project: XMLTooling - Java
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: anli.shundi at idp.protectnetwork.org
>            Assignee: Brent Putman
>             Fix For: 1.3.3
>
>
> class {{ListView<ElementType extends XMLObject> extends AbstractList<ElementType>}} inside {{IndexedXMLObjectChildrenList}} overrides the method {{clear()}} of {{java.util.AbstracList}} but violates its javadoc:
> According to http://download.oracle.com/javase/6/docs/api/java/util/AbstractList.html#subList(int,%20int)
> {quote}
> ...the following idiom removes a range of elements from a list:
>       {{list.subList(from, to).clear();}}
> {quote}
> ListView's clear calls {{backingList.clear();}} instead; that is it clears the whole backing list instead of limiting to the QNames it lists itself.  A quick fix would be to call {{backingList.removeAll(this)}} instead.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the commits mailing list