-
Bug
-
Resolution: Fixed
-
Normal
-
7.0.4
-
Security Level: Jimmy
-
None
the implementation of the getChild method unecessarily calls getChildCount() for the last item in the path.
This results in performance problems when the call to getChildCount is expensive(e.g. loaded from DB).
getChildCount is called many times when scrolling down a a tree and tree nodes get loaded from the server, or when opening dynamically added tree nodes.
here a suggested much simpler implementation also usable as a WORKAROUND
@Override public Hierarchy<String> getChild(int[] path) { Hierarchy<String> parent = getRoot(); for (int index : path) { parent = getChild(parent, index); } return parent; }