Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-1021

Undo after delete in TextPane can cause IllegalArgumentException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • wtk
    • None

    Description

      Under various conditions (such as selecting an entire word that is a TextSpan) deleting it with Ctrl/Cmd-X then Undo (Ctrl/Cmd-Z) causes an IllegalArgumentException:
      java.lang.IllegalArgumentException: Child node must be an instance of org.apache.pivot.wtk.text.Block
      STACK TRACE:
      at org.apache.pivot.wtk.text.Document.insert(Document.java:45)
      at org.apache.pivot.wtk.text.Element.add(Element.java:369)
      at org.apache.pivot.wtk.TextPane$RangeRemovedEdit.undo(TextPane.java:134)
      at org.apache.pivot.wtk.TextPane.undo(TextPane.java:796)
      at org.apache.pivot.wtk.skin.TextPaneSkin.keyPressed(TextPaneSkin.java:1360)
      at org.apache.pivot.wtk.Component$ComponentKeyListenerList.lambda$keyPressed$1(Component.java:477)
      at java.lang.Iterable.forEach(Unknown Source)
      at org.apache.pivot.wtk.Component$ComponentKeyListenerList.keyPressed(Component.java:477)
      at org.apache.pivot.wtk.Component.keyPressed(Component.java:2711)
      at org.apache.pivot.wtk.ApplicationContext$DisplayHost.processKeyEvent(ApplicationContext.java:1566)
      at java.awt.Component.processEvent(Unknown Source)
      at org.apache.pivot.wtk.ApplicationContext$DisplayHost.processEvent(ApplicationContext.java:945)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      ...

      Or sometimes an IndexOutOfBoundsException can occur instead (such as doing a second Undo right after the first).

      Attachments

        Activity

          People

            rwhitcomb Roger Lee Whitcomb
            rwhitcomb Roger Lee Whitcomb
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: