pombreda / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
0 stars 0 forks source link

FastTree getChildCount() implementation and documention #236

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The implementation and javadoc of the following two methods are inconsistent.

From javadoc:
int     getChildCount()
          Gets the number of children contained in this item.
int     getItemCount()
          Gets the number of items contained at the root of this tree.

From implementation:
http://cs/p?hl=en#google3/third_party/java/gwt_incubator/checkout/src/com/google
/gwt/widgetideas/client/FastTree.java&q=class%20FastTree&l=60

  public int getChildCount() {
    return root.getChildCount();
  }

  /**
   * Gets the number of items contained at the root of this tree.
   *
   * @return this tree's item count
   */
  public int getItemCount() {
    return root.getChildCount();
  }

What version of gwt and gwt-incubator are you using?
 --gwt_version=aw30 
   '//third_party/java/gwt_incubator:versioned-incubator',

What OS and browser are you using?
Firefox

Do you see this error in hosted mode, web mode, or both?
both 

(If possible, please include a test case that shows the problem)

Hopefully using the test case you have generously provided, what steps will
reproduce the problem? 
1.
2.
3.

What is the expected output? What do you see instead?

Workaround if you have one:

Please provide any additional information below,  and thank you for taking
the time and effort to report this issue, as good issue reports are
critical for our quest to make GWT's new widgets and libraries shine.

Original issue reported on code.google.com by minzho...@gmail.com on 18 Feb 2009 at 7:14

GoogleCodeExporter commented 9 years ago
Just realized it attached to my gmail account.  I meant to use my corp account
minz@google.com . Please keep me posted on its progress.

Original comment by minzho...@gmail.com on 18 Feb 2009 at 7:20

GoogleCodeExporter commented 9 years ago
Will do. Thanks for the report!

Original comment by ecc%google.com@gtempaccount.com on 2 Mar 2009 at 4:11

GoogleCodeExporter commented 9 years ago
Hey Minz,

getChildCount is a method in FastTreeItem which returns the number of children 
items
"this" has:

 public int getChildCount() {
    if (children == null) {
      return 0;
    }
    return children.size();
  }

getItemCount is a method on FastTree which returns the number of children items 
the
root has by calling getChildCount on the root item, so it's a convenience 
method.  

I guess I'm not exactly sure what you want changed.  I don't see the javadoc in 
the
code for getChildCount, where do you see it?

Also "minz@google.com" doesn't seem to exist...

Original comment by nwolf+legacy@google.com on 27 Mar 2009 at 2:35

GoogleCodeExporter commented 9 years ago
I see both getChildCount() and getItemCount() as methods on FastTree.
http://code.google.com/p/google-web-toolkit-incubator/source/browse/trunk/src/co
m/google/gwt/widgetideas/client/FastTree.java?spec=svn1372&r=1372
In this file:

@290-292
  public int getChildCount() {
    return root.getChildCount();
  }

@308-315
  /**
   * Gets the number of items contained at the root of this tree.
   * 
   * @return this tree's item count
   */
  public int getItemCount() {
    return root.getChildCount();
  }

Original comment by minzho...@gmail.com on 27 Mar 2009 at 10:09