This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 45935 - LogicalViewProvider.findPath Javadoc unclear
Summary: LogicalViewProvider.findPath Javadoc unclear
Status: CLOSED FIXED
Alias: None
Product: usersguide
Classification: Unclassified
Component: Projects (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords:
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-07-08 15:27 UTC by Jan Lahoda
Modified: 2006-03-24 09:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2004-07-08 15:27:02 UTC
org.netbeans.modules.spi.project.ui.LogicalViewProvider
CVS revision 1.6,
org.netbeans.modules.project.ui.ProjectsRootNode
CVS revision 1.22.

The javadoc of LogicalViewProvider.findPath claims
that the root argument is "a root node from
createLogicalView". I understand this in such a
way that the root == result of (some recent
invocation of) createLogicalView. But, current
ProjectsRootNode sends different node (subclass of
FilterNode, ProjectsRootNode$BadgingNode) into the
findPath method.

Please either:
-clarify that the root argument of the findPath
method can be a wrapper node around the node
returned from createLogicalView and either provide
means of getting the original node or clarify that
the implementor is responsible for getting the
original node.
-send the same node as was returned by the
createLogicalView into the findPath method.
Comment 1 Jesse Glick 2004-07-08 16:28:15 UTC
It think it is the former, i.e. a wrapper node can be passed, and that
fP impls should use nodes properly, i.e. by checking cookies/lookup
only, and never relying on impl class. But will leave it to Petr to
confirm and clarify.
Comment 2 Jan Lahoda 2004-07-08 18:14:51 UTC
Just a note: in the case 1, gathering the original node is invalid, as
the children of the wrapper root node may (not sure whether they are,
not tried) also be FilterNodes, and in this case it would probably be
awaited that the findPath method returns appropriate FilterNode, not
the original node. Therefore lookups (or cookies) of the Nodes should
be used.

After thinking about it more, it seems to me that the case 1 (wrapper
node is allowed) makes more sense than the other case. Therefore I
suggest that the javadoc is modified to reflect this.
Comment 3 Jesse Glick 2004-07-08 19:00:47 UTC
Good point - if the root is a filter node, its children must be as
well. (A Node can only belong to one Children at a time.) So passing
in the original root node would be useless - you would find the
original child, but then you would still not know which filtered child
that corresponded to.
Comment 4 Petr Hrebejk 2004-09-07 16:24:42 UTC
Checking in
projects/projectuiapi/src/org/netbeans/spi/project/ui/LogicalViewProvider.java;
/cvs/projects/projectuiapi/src/org/netbeans/spi/project/ui/LogicalViewProvider.java,v
 <--  LogicalViewProvider.java
new revision: 1.7; previous revision: 1.6
done
Comment 5 Jan Lahoda 2005-02-25 10:58:42 UTC
I think it is OK now (LogicalViewProvider revision 1.7).