Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342023

Summary: loadedNum variable identifying
Product: z_Archived Reporter: Alex Mising name <PsiersAdmin>
Component: NebulaAssignee: Donald Dunne <donald.g.dunne>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Alex Mising name CLA 2011-04-06 09:39:30 EDT
Build Identifier: 20110218-0911

loadedNum variable identifying in class XViewer.java in method updateStatusLabel() must be changed from:
loadedNum = ((ITreeContentProvider) getContentProvider()).getChildren(getRoot()).length;
to:
loadedNum = ((ITreeContentProvider) getContentProvider()).getElements(getRoot()).length;

Reproducible: Always
Comment 1 Donald Dunne CLA 2011-08-17 16:27:18 EDT
According to the javadoc (see below), getChildren(getRoot()) is just as valid as getElement(getRoot()).  Notice the "(including a root)".

What's the reason you want/need this changed?

    /**
     * Returns the child elements of the given parent element.
     * <p>
     * The difference between this method and <code>IStructuredContentProvider.getElements</code> 
     * is that <code>getElements</code> is called to obtain the 
     * tree viewer's root elements, whereas <code>getChildren</code> is used
     * to obtain the children of a given parent element in the tree (including a root).
     * </p>
     * The result is not modified by the viewer.
     *
     * @param parentElement the parent element
     * @return an array of child elements
     */
    public Object[] getChildren(Object parentElement);
Comment 2 Donald Dunne CLA 2011-09-29 16:15:01 EDT
Given the above reasons, this bug is not valid.
Comment 3 Donald Dunne CLA 2011-09-29 16:15:45 EDT
closing bug