You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Noel Grandin (JIRA)" <ji...@apache.org> on 2011/03/16 09:43:29 UTC
[jira] Resolved: (PIVOT-716) Clearing a Document by removing all
elements crashes
[ https://issues.apache.org/jira/browse/PIVOT-716?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Noel Grandin resolved PIVOT-716.
--------------------------------
Resolution: Fixed
Fix Version/s: 2.0.1
Assignee: Noel Grandin
> Clearing a Document by removing all elements crashes
> ----------------------------------------------------
>
> Key: PIVOT-716
> URL: https://issues.apache.org/jira/browse/PIVOT-716
> Project: Pivot
> Issue Type: Bug
> Components: wtk
> Affects Versions: 2.0.1
> Reporter: Bill van Melle
> Assignee: Noel Grandin
> Priority: Critical
> Fix For: 2.0.1
>
>
> In version 2.0, I could clear a Document by doing
> doc.remove(0, doc.getLength());
> In the current trunk, this causes a crash:
> java.lang.IndexOutOfBoundsException: offset+characterCount>this.characterCount offset=0 characterCount=38 this.characterCount=0
> at org.apache.pivot.wtk.text.Element.getRange(Element.java:263)
> at org.apache.pivot.wtk.text.Element.getRange(Element.java:39)
> at org.apache.pivot.wtk.TextPane$RangeRemovedEdit.<init>(TextPane.java:122)
> at org.apache.pivot.wtk.TextPane$2.rangeRemoved(TextPane.java:268)
> at org.apache.pivot.wtk.text.Node$NodeListenerList.rangeRemoved(Node.java:66)
> at org.apache.pivot.wtk.text.Node.rangeRemoved(Node.java:217)
> at org.apache.pivot.wtk.text.Element.remove(Element.java:454)
> Example available on request, but you should be able to reproduce it by taking the code from https://issues.apache.org/jira/browse/PIVOT-715, add a suitable id to the Document node, and write code to do the remove call shown above.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira