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 47411 - [40cat] Double clicking a method in the tree does not move cursor to its definition in the source.
Summary: [40cat] Double clicking a method in the tree does not move cursor to its defi...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 47088 47517 47822 47973 48614 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-18 17:24 UTC by gugrim
Modified: 2007-09-26 09:14 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The JavaSourceNodeFactory$CompatibleNode contains two OpenCookies (83.04 KB, image/png)
2004-08-19 17:16 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gugrim 2004-08-18 17:24:10 UTC
[ BUILD # : 200408171800 ]
[ JDK VERSION : J2SE 1.4.2 ]

Double clicking a method or field in the project tree does not move cursor to its definition in the source. Instead the cursor is placed on line 1.
Comment 1 Martin Matula 2004-08-18 20:35:29 UTC
This works for some elements, for some it does not (see duplicates).
Comment 2 Martin Matula 2004-08-18 20:36:10 UTC
*** Issue 47088 has been marked as a duplicate of this issue. ***
Comment 3 Jan Becicka 2004-08-19 08:36:22 UTC
It is really iffy problem. Reassigning to openide for further evaluation.

Where is the problem:
RefactoringFilterNode.getCookie(OpenCookie.class) does not return the
same value as
RefactoringFilterNode.getOriginal().getCookie(OpenCookie.class)

although javadoc of FilterNode.getCookie() says:
"Delegates to original, if not special lookup provided in constructor,
Otherwise it delegates to the lookup."

RefactoringFilterNode do not provide any special Lookup in constructor.
Please evaluate. Thanks.
Comment 4 Petr Hrebejk 2004-08-19 10:14:18 UTC
That is very likely a java problem.
Comment 5 Jan Becicka 2004-08-19 14:27:45 UTC
Hrebejku, did you read my last comment? Any evaluation?
Comment 6 Petr Hrebejk 2004-08-19 14:57:13 UTC
Huh, did not passing to Jartda for evealuation. Could you please
specify what it returns in which case in order to help Jarda a bit.

Thanks
Comment 7 Tomas Hurka 2004-08-19 15:42:01 UTC
Yes, FilterNode.getCookie() founds OpenCookie in lookup returned by internalLookup(). 
This cookie is implemented by JavaEditor, while OpenCookie returned by 
getOriginal().getCookie() is implemented by 
org.netbeans.modules.java.ui.nodes.elements.ElementNode.OpenCookieImpl 
Comment 8 Jaroslav Tulach 2004-08-19 17:16:10 UTC
Created attachment 16963 [details]
The JavaSourceNodeFactory$CompatibleNode contains two OpenCookies
Comment 9 Jaroslav Tulach 2004-08-19 17:19:24 UTC
Simplest solution would be to remove the unwanted OpenCookie from your
node. I will try to fix the problem on nodes side, but I am not sure
how quickly I am going to be able to find the fix.
Comment 10 Martin Matula 2004-08-19 17:33:25 UTC
I've just talked to Yarda. The problem seems to be that there are both
JavaEditor (which also implements OpenCookie) and
ElementNode$OpenCookieImpl in the lookup. Unfortunatelly JavaEditor
gets preference. Jarda is going to fix this. However, we should
consider whether we really need to have JavaEditor in the lookup on
these nodes - I guess this is a question on Honza Pokorsky.
Comment 11 Jaroslav Tulach 2004-08-24 14:44:05 UTC
cvs -q ci -m "#47411: Better ordering of AbstractLookup.Pairs in the
setPairs method so the lookup queries better match the cookie ones"

Checking in src/org/openide/nodes/Node.java;
/cvs/openide/src/org/openide/nodes/Node.java,v  <--  Node.java
new revision: 1.87; previous revision: 1.86
done
Checking in src/org/openide/nodes/NodeLookup.java;
/cvs/openide/src/org/openide/nodes/NodeLookup.java,v  <--  NodeLookup.java
new revision: 1.9; previous revision: 1.8
done
Processing log script arguments...
More commits to come...
Checking in test/unit/src/org/openide/nodes/CookieSetTest.java;
/cvs/openide/test/unit/src/org/openide/nodes/CookieSetTest.java,v  <--
 CookieSetTest.java
new revision: 1.5; previous revision: 1.4
done
Checking in test/unit/src/org/openide/nodes/NodeLookupTest.java;
/cvs/openide/test/unit/src/org/openide/nodes/NodeLookupTest.java,v 
<--  NodeLookupTest.java
new revision: 1.20; previous revision: 1.19
Comment 12 Jan Pokorsky 2004-08-24 17:10:30 UTC
*** Issue 47822 has been marked as a duplicate of this issue. ***
Comment 13 Jan Pokorsky 2004-08-26 11:06:03 UTC
*** Issue 47973 has been marked as a duplicate of this issue. ***
Comment 14 pfelenda 2004-08-27 09:52:50 UTC
dev build 200408262030
Is this really fixed ? 
I tried double click to a method, constructor or field, but the caret is 
placed at begin of the file.
Comment 15 Jan Becicka 2004-08-27 15:42:50 UTC
Jardo, why did you reassing this issue back to java?
RefactoringFilterNode.getCookie(OpenCookie.class) still returns
JavaEditor instance while
RefactoringFilterNode.getOriginal().getCookie(OpenCookie.class)
returns ElementNode.OpenCookieImpl instance.

But javadoc states, that FilterNode.getCookie() only delegates to
original. It means, that it should return the same value. Or am I wrong?
Comment 16 Jaroslav Tulach 2004-08-30 17:40:45 UTC
Well it seemed to work for me when I tried it, but I can see now that
it is still broken.
Comment 17 Jaroslav Tulach 2004-08-30 18:39:26 UTC
Another improvement. Now double clicking worked for me (but it worked
after the first fix as well).

Checking in src/org/openide/nodes/NodeLookup.java;
/cvs/openide/src/org/openide/nodes/NodeLookup.java,v  <--  NodeLookup.java
new revision: 1.10; previous revision: 1.9
done
Processing log script arguments...
More commits to come...
Checking in test/unit/src/org/openide/nodes/CookieSetTest.java;
/cvs/openide/test/unit/src/org/openide/nodes/CookieSetTest.java,v  <--
 CookieSetTest.java
new revision: 1.6; previous revision: 1.5
Comment 18 Jaroslav Tulach 2004-08-31 08:48:01 UTC
Yet another improvement. Changing comparator to compare the queried
classes first, then compare the actual implementations, so the
Lookup.setPairs will not get different pair than expected when asking
for first instance of a class.



Checking in src/org/openide/nodes/NodeLookup.java;
/cvs/openide/src/org/openide/nodes/NodeLookup.java,v  <--  NodeLookup.java
new revision: 1.11; previous revision: 1.10
done
Processing log script arguments...
More commits to come...
Checking in test/unit/src/org/openide/nodes/CookieSetTest.java;
/cvs/openide/test/unit/src/org/openide/nodes/CookieSetTest.java,v  <--
 CookieSetTest.java
new revision: 1.7; previous revision: 1.6
Comment 19 Jan Becicka 2004-09-08 12:38:52 UTC
*** Issue 48614 has been marked as a duplicate of this issue. ***
Comment 20 Jan Pokorsky 2004-09-29 16:24:32 UTC
*** Issue 47517 has been marked as a duplicate of this issue. ***
Comment 21 Quality Engineering 2007-09-20 12:44:00 UTC
Reorganization of java component