if (index < 0) error (SWT.ERROR_INVALID_RANGE); int i = 0; TreeItem item = null; while (item == null && i < items.length) { TreeItem next = items [i++]; if (next != null && next.parentItem == null &&  next.index == index) { item = next; } } if (item == null) error (SWT.ERROR_INVALID_RANGE); return item;
int count = getItemCount (null); if (index < 0 || index >= count) error (SWT.ERROR_INVALID_RANGE); return _getItem (null, index);
public TreeItem getItem (int index) {	checkWidget ();	if (index < 0) error (SWT.ERROR_INVALID_RANGE);	int i = 0;	TreeItem item = null;	while (item == null && i < items.length) {		TreeItem next = items [i++];		if (next != null && next.parentItem == null &&  next.index == index) {			item = next;		}	}	if (item == null) error (SWT.ERROR_INVALID_RANGE);	return item;}