Description
We build a tree, but don't expand it all initially. User can do things that cause the tree to be rebuilt before the child nodes have become visible. This leads to exceptions such as:
java.lang.IndexOutOfBoundsException: Index 1 out of bounds [0,0].
STACK TRACE:
at org.apache.pivot.util.Utils.checkIndexBounds(Utils.java:246)
at org.apache.pivot.collections.ArrayList.get(ArrayList.java:431)
at org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.removeVisibleNodes(TerraTreeViewSkin.java:1358)
at org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.nodesRemoved(TerraTreeViewSkin.java:2064)
at org.apache.pivot.wtk.TreeViewNodeListener$Listeners.lambda$nodesRemoved$1(TreeViewNodeListener.java:38)
at java.lang.Iterable.forEach(Iterable.java:75)
at org.apache.pivot.wtk.TreeViewNodeListener$Listeners.nodesRemoved(TreeViewNodeListener.java:38)
at org.apache.pivot.wtk.TreeView$BranchHandler.itemsRemoved(TreeView.java:365)
at org.apache.pivot.collections.List$ListListenerList.lambda$itemsRemoved$1(List.java:57)
at java.lang.Iterable.forEach(Iterable.java:75)
at org.apache.pivot.collections.List$ListListenerList.itemsRemoved(List.java:57)
at org.apache.pivot.wtk.content.TreeBranch.remove(TreeBranch.java:156)