Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 132414 - PathFinder in TreeUtilities doesn't work
PathFinder in TreeUtilities doesn't work
Product: javafx
Classification: Unclassified
Component: Editor
All All
: P1 (vote)
Assigned To: David Strupl
Depends on: 132199
  Show dependency treegraph
Reported: 2008-04-09 15:03 UTC by Alexey Butenko
Modified: 2008-06-04 15:17 UTC (History)
0 users

See Also:
Issue Type: DEFECT

Test (4.58 KB, text/plain)
2008-04-10 11:27 UTC, Alexey Butenko

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Butenko 2008-04-09 15:03:34 UTC
PathFinder always returned whole CompilationUnit but not the smaller parts,
like blocks, fields, classes, which is needed for implementing breakpoints in debugger.
Comment 1 David Strupl 2008-04-09 21:01:56 UTC
Marking as invalid. Please show me the code from where you call it and where it fails - after you supply this
(preferable as a reproducible test case) please reopen the issue.

Please note that I have not finished this as this is currently not called from anywhere (in the sources that I have)
besides the code that I work on (code completion).

I don't say I will not finish it just that I need to have a proper test case to work with.

As to what it not implemented - I have not copied the code for "findNameSpan" as I was not sure what it does and whether
we need it here. Maybe it would be just ok to call 
sourcePositions.getStartPosition(getCurrentPath().getCompilationUnit(), node) and similarly getEndPosition. The other
alternative is to copy the findNameSpan methods from java but that would require some more checking whether that works
ok in JFX case.
Comment 2 Alexey Butenko 2008-04-10 11:27:41 UTC
Created attachment 59963 [details]
Comment 3 Alexey Butenko 2008-04-10 11:30:00 UTC
I've attached example of source code which can reproduce the problem.
Without this code I'm not able to submit breakpoints during debug session,
because class name is always null and other info is not correct
Comment 4 David Strupl 2008-04-10 12:48:16 UTC
Ok, looking at it ..
Comment 5 David Strupl 2008-04-10 13:11:09 UTC
Unfortunatelly I cannot move forward with this one without #132199 being solved first. The positions in the tree we are
getting from javafxc are not correct ...
Comment 6 Alexey Butenko 2008-04-11 10:11:45 UTC
Also I've noticed that in TreeUtilities all calls of path.getLeaf().getKind() it is Java kinds trees, then Kind.OTHER will be returned for all instances of JavaFXTree,
so getJavaFXKind should be used to get JavaFX kind.
Comment 7 David Strupl 2008-04-11 10:14:19 UTC
Thanks for the catch - I will try to fix that but with the wrong positions we will not get much further ;-(
Comment 8 David Strupl 2008-04-14 11:34:50 UTC

I have just pushed


it includes updated test + some change in the pathfinder.

Can you give it a try please?

I am closing this issue and if something more is needed please reopen or create a new one.

Br, David

PS: I did not touch the kind as the code is used to fine tune the position on braces etc. Maybe we could improve that
also but please test first whether this will be ok for you ...
Comment 9 Alexey Butenko 2008-06-04 15:17:35 UTC
It seems like the method is working ok

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