Details
Description
AbstractTree utilizes Collections.EMPTY_LIST for a node's children container. This assumes that this node will never have children during its lifecycle as EMPTY_LIST will always be empty since it does not support add(int, Object)
To fix, change item = Collections.EMPTY_LIST with item = new ArrayList(0);
private final void buildItemChildren(TreeItem item)
{
List items;
// if the node is expanded
if (isNodeExpanded((TreeNode)item.getModelObject()))
else
{ // it's not expanded, just set children to an empty list //items = Collections.EMPTY_LIST; items = new ArrayList(0); } item.setChildren(items);
}