Bug 161086 [Viewers] performance problem in AbstractTreeViewer.internalExpandToLevel
If you expand to ALL_LEVELS, internalExpandToLevel will call createChildren even if the element has no children, i.e. it does not check if the element is expandable. Found this while experimenting with the Quick Access feature (enter "con", then delete all three characters one at a time).
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java
}
		return result.toArray();
	}
	/**
	 * Returns whether the node corresponding to the given element or tree path
	 * is expanded or collapsed.
	 * 
	 * @param elementOrTreePath
	 *            the element
	 * @return <code>true</code> if the node is expanded, and
	 *         <code>false</code> if collapsed
	 */
	public boolean getExpandedState(Object elementOrTreePath) {
		Assert.isNotNull(elementOrTreePath);
		Widget item = internalGetWidgetToSelect(elementOrTreePath);
		if (item instanceof Item) {
			return getExpanded((Item) item);
		}
		return false;
	}
	/**
	 * Returns the number of child items of the given SWT control.
	 * 
	 * @param control
	 *            the control
	 * @return the number of children
	 */
	protected abstract int getItemCount(Control control);
	/**
	 * Returns the number of child items of the given SWT item.