Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 67098 - Missing constructor in BeanNode
Missing constructor in BeanNode
Product: platform
Classification: Unclassified
Component: Nodes
All All
: P3 (vote)
: 6.x
Assigned To: Petr Nejedly
: 85507 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2005-10-19 09:42 UTC by timdudgeon
Modified: 2008-12-22 18:15 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

Implementation of the Lookup-accepting ctor. (7.17 KB, patch)
2006-08-11 13:45 UTC, Petr Nejedly
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description timdudgeon 2005-10-19 09:42:18 UTC
BeanNode does not have a constructor that allows a Lookup to be defined. e.g.

protected BeanNode(Object bean, Children children, Lookup lookup)

This prevents the pattern recommended in
Comment 1 Petr Nejedly 2006-08-11 13:45:47 UTC
Created attachment 32826 [details]
Implementation of the Lookup-accepting ctor.
Comment 2 Petr Nejedly 2006-08-11 13:52:51 UTC
I'm proposing to add BeanNode constructor accepting Lookup as one of its
parameters. I have attached proposed (nontrivial) implementation of the proposal
with tests covering both the new functionality and compatibility with previous
usage patterns (that were not covered so far).
I believe the proposal is noncontroversonal (hence the API_REVIEW_FAST keyword).
The only questions I see is:
1. Whether to make new ctor protected (as is the (bean, children) ctor) or
public (which would allow passing additional context w/o subclassing).
2. the order of lookups in the proxy.

Please review carefully as keeping real compatibility was not as trivial as one
cound think.
Comment 3 Jesse Glick 2006-08-11 17:57:14 UTC
Javadoc for new ctor needs a different summary line.

@since org.openide.nodes 6.9

Perhaps it would be better to leave the Lookup alone if passed explicitly. I
don't see a reason to forcibly add the bean to it. IMHO if I pass a Lookup I
expect it to be used as is.
Comment 4 Petr Nejedly 2006-08-15 15:45:23 UTC
OK, I was affraid that some code  in/around BeanNode expects the cookie to be
present, but it seems this is not the case. Without the forced InstanceCookie,
the patch will be quite simple.
Comment 5 Petr Nejedly 2006-08-18 19:05:38 UTC
Implemented as Jesse suggested.

Comment 6 Jaroslav Tulach 2006-09-22 09:04:56 UTC
*** Issue 85507 has been marked as a duplicate of this issue. ***

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo