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 18358 - "go to source" should go to implementation
Summary: "go to source" should go to implementation
Status: RESOLVED DUPLICATE of bug 142112
Alias: None
Product: editor
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 3.x
Hardware: Other Other
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-05 12:56 UTC by zohar
Modified: 2008-08-01 08:54 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zohar 2001-12-05 12:56:08 UTC
Let's say that you have the following code:

  List myList = new ArrayList();
  
myList.size();

currently, when I'm trying to use the "go to source" mechanism on 'size()', 
it takes me to List.size() (the interface). I would have liked it to take me to ArrayList.size().
Comment 1 _ ttran 2001-12-05 14:07:22 UTC
myList is declared as List not ArrayList.  That's the reason why "go
to source" leads you to the impl of List.size().

Comment 2 zohar 2001-12-05 14:12:51 UTC
I know, but getting me there is usually of no interest. Is there a problem enhancing the 
behavior to do that? I remember JBuilder does that.
Comment 3 Jan Lahoda 2001-12-05 19:34:35 UTC
Hi,
   as a first thing - I do not think this is a defect, I think it was
designed to work this way. I will mark this issue as enhancement. Mark
as defect if you disagree.
To the question - I understand why do you want this. Sometimes, I feel
I would use such feature. But, I am not sure how to generaly find out
the content of a variable without executing the program with given
arguments and user input. Consider following code:
public void test(boolean useArray) {
   List list;
   if (useArray) list = new ArrayList();
   else list = new Vector();
   list.size();
}
Here is impossible to find out what will be the object referenced by
"list".
The only think we *can* (in general, not in today code) do is to find
the variable content when it is "simple" to find it. And that would
mean:
1. This feature will work only sometimes (it is only heuristic). I do
not like such features.
2. Parse/analyze method body. I am affraid that this is much, much
work. Martin, Mila, what do you think about it?
In all cases, I do not think this is "simple to implement" feature.
Comment 4 zohar 2001-12-09 07:11:21 UTC
Why don't you like the heutistic aproach? TMHO it's better to do a 
better job most of the time, than to give up and say that you're not 
going to do anything at all because you know that you're going to 
fail sometimes...
Comment 5 Svata Dedic 2001-12-11 12:47:40 UTC
Guys, will you implement this enhancement on your own, or should I
make this dependent on RFE for complete metamodel of java source ?
Comment 6 Jan Lahoda 2001-12-11 14:42:09 UTC
To first question - I do not like heuristic approach, because it will
probably pass and fail in very similar cases (little or no difference
for human), so one can not rely on it. I mean, you can rely on word
matching and on abbreviations for 100%. You could rely on basic code
completion on (say) 90%. But you could not rely on such heuristic
approach, it will not be sure that you will have good result, or even
any result at all. And I do not like features I can not rely on.
There are other reasons (less important), like that it is nearly
untesteable.

For Svata's question - I can not speak for Mila, but I think that
parsing method body in editor module would be quite bad solution
(impact on performance and bugs count would be probably significant),
so we probably should wait for metamodel and get needed information
from it. Svata, please, can you make this dependent on the "metamodel"
issue? (I did not find it, sorry.) Mila, do you agree?
Comment 7 Miloslav Metelka 2001-12-12 15:39:23 UTC
I agree.
If it helps to people let's do it, but I understand that it makes
Honza a little nervous. We need to document the process of finding the
assigned type so that it's testable by QA.
Comment 8 zohar 2002-01-01 05:40:27 UTC
Is this really targeted for 3.3.1?
Comment 9 zohar 2002-02-14 09:40:49 UTC
when do you expect to start seeing any progress on this?
Comment 10 Marek Grummich 2002-07-22 09:56:22 UTC
Set target milestone to TBD
Comment 11 Marek Grummich 2002-07-22 09:58:58 UTC
Set target milestone to TBD
Comment 12 Roman Strobl 2004-12-08 17:05:58 UTC
Changing subcomponent to navigation.
Comment 13 Vitezslav Stejskal 2008-08-01 08:54:19 UTC

*** This issue has been marked as a duplicate of 142112 ***