You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Andrew Thornton <an...@caret.cam.ac.uk> on 2005/02/22 15:37:27 UTC

DefaultMutableTreeNode

Hi!
    I'm trying to use the DefaultMutableTreeNode from 
org.apache.myfaces.custom.tree, however I've spotted a probable bug in 
one of the constructors.

Do you really mean:

public DefaultMutableTreeNode(ArrayList children, boolean allowsChildren)

and not

public DefaultMutableTreeNode(List children, boolean allowsChildren)

I can't see any reason why you'd want to use an ArrayList over a generic 
List implementation. What am I missing?

Thanks,
andy
--
Andrew Thornton
andrew@caret.cam.ac.uk

Re: DefaultMutableTreeNode

Posted by Oliver Rossmueller <ol...@tuxerra.com>.
Andrew,

thank you for the hint, there is no reason for using ArrayList, just a 
stupid cut/paste bug. The fix is in the cvs, the constructor now asks 
for List.

Oliver


Andrew Thornton wrote:

> Hi!
>    I'm trying to use the DefaultMutableTreeNode from 
> org.apache.myfaces.custom.tree, however I've spotted a probable bug in 
> one of the constructors.
>
> Do you really mean:
>
> public DefaultMutableTreeNode(ArrayList children, boolean allowsChildren)
>
> and not
>
> public DefaultMutableTreeNode(List children, boolean allowsChildren)
>
> I can't see any reason why you'd want to use an ArrayList over a 
> generic List implementation. What am I missing?
>
> Thanks,
> andy
> -- 
> Andrew Thornton
> andrew@caret.cam.ac.uk



-- 
Oliver Rossmueller
Software Engineer and IT-Consultant
Hamburg, Germany
http://www.rossmueller.com


Re: DefaultMutableTreeNode

Posted by Sean Schofield <se...@gmail.com>.
Andrew,

We are currently rewriting the tree component.  The new one should be
much simpler to use.  My recommendation to you is to check out the
latest source code and take a look at tree2.  The plan is to
ultimately replace tree with tree2 (and to rename tree2 back to tree.)

I haven't worked much on the original tree so I can't help you there. 
But I can help with questions on tree2.

sean


On Tue, 22 Feb 2005 14:37:27 +0000, Andrew Thornton
<an...@caret.cam.ac.uk> wrote:
> Hi!
>     I'm trying to use the DefaultMutableTreeNode from
> org.apache.myfaces.custom.tree, however I've spotted a probable bug in
> one of the constructors.
> 
> Do you really mean:
> 
> public DefaultMutableTreeNode(ArrayList children, boolean allowsChildren)
> 
> and not
> 
> public DefaultMutableTreeNode(List children, boolean allowsChildren)
> 
> I can't see any reason why you'd want to use an ArrayList over a generic
> List implementation. What am I missing?
> 
> Thanks,
> andy
> --
> Andrew Thornton
> andrew@caret.cam.ac.uk
>