Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.0.4, 2.1
-
All
Description
Start with an empty TextArea, then double click anywhere (which normally would select the current word), there will be basically an assertion error from here:
java.lang.IndexOutOfBoundsException: index: index (-1) < min (0)
at org.apache.pivot.wtk.Component.indexBoundsCheck(Component.java:2861)
at org.apache.pivot.wtk.TextArea.getCharacterAt(TextArea.java:904)
at org.apache.pivot.wtk.skin.TextAreaSkin.selectSpan(TextAreaSkin.java:969)
at org.apache.pivot.wtk.skin.TextAreaSkin.mouseClick(TextAreaSkin.java:1023)
The underlying problem is trying to get the character at offset -1 in the document.
It could also occur in any document in which the first line is empty, and trying to double click there (with a slightly different stack trace):
java.lang.IndexOutOfBoundsException: index: index (-1) < min (0)
at org.apache.pivot.wtk.Component.indexBoundsCheck(Component.java:2861)
at org.apache.pivot.wtk.TextArea.getCharacterAt(TextArea.java:904)
at org.apache.pivot.wtk.skin.TextAreaSkin.selectSpan(TextAreaSkin.java:974)
at org.apache.pivot.wtk.skin.TextAreaSkin.mouseClick(TextAreaSkin.java:1023)
(This is from the "trunk" version).