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.
Summary: | [65cat] Introduce "Go to Implementation" or change "Go to Declaration" | ||
---|---|---|---|
Product: | java | Reporter: | piero <piero> |
Component: | Navigation | Assignee: | Tomas Zezula <tzezula> |
Status: | NEW --- | ||
Severity: | blocker | CC: | dkonecny, dmocek, hmichel, malfunction84, markiewb, nvarun, tpavek, tprochazka |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: | Screenshot how it looks like in IntelliJ IDEA |
Description
piero
2008-07-29 18:23:28 UTC
Daniel Sheppard brought up a good point on the Mailing List. Maybe it would be better to introduce a new Shortcut named "Go To Implementation" instead of overwrite the existing "Go To Declaration". Created attachment 66162 [details]
Screenshot how it looks like in IntelliJ IDEA
Actually, the attached image, is a snapshot of Intelli J’s Java Editor, with Logical View of Project on the left. The code shows, when you use a pre-defined shortcut key, on a method invocation (which is an implementation of an interface method), the editor pop-up a code-completion like window with the list of classes that might have implemented that particular method. That’s ridiculous! This is what Intelli J provides, so it contradicts Dynamic Binding concept, and Piero wants to have such feature in NetBeans. Well, I would like to refine this RFE as follows- In NetBeans, the user should have an option/shortcut key (as suggested by Daniel) to navigate to the implemented method, analogous to the concept of dynamic binding. Not, what the image shows in Intelli J. Following is the usecase- 6 public class UserImpl implements User { 7 8 public void callCheck() { 9 callImpl(); 10 new UserImpl().callImpl(); 11 } 12 13 public void callImpl() { 14 System.out.println("Implementation Invoked..."); 15 } 16 17 public static void main(String[] args) { 18 new UserImpl().callCheck(); 19 20 // Dynamic Binding... 21 User anonUser = new UserImpl(); 22 anonUser.callImpl(); 23 } 24 } 25 26 interface User { 27 28 public void callImpl(); 29 }; Clicking on callImpl() in line #22, doesn't navigate to the implemented version of callImpl(), i.e. line #13. Instead, user is navigated to line #28. So, this should not exist, hence Piero filed a RFE, and I hope this post makes it even more clear, what enhancement is required. This doesn't work for Windows too! I am using Windows XP SP2. *** Issue 62015 has been marked as a duplicate of this issue. *** *** Issue 18358 has been marked as a duplicate of this issue. *** Aren't issue 104311 and issue 136532 duplicates as well? Just a note that despite nvarun's comment that the intellij "go to implementations" is ridiculous, I personally (and many developer I know where I work where intellij is heavily used) find it extremely useful and one of things that we miss when we use Netbeans for some projects. The small pop-up window with all possible implementations on the classpath is very useful. My experience is that 95% of the time I can quickly identify exactly which implementation I'm interested in, select it, and be at the implementation I care about in a second or less without having needed to use the mouse. It really helps navigate code quickly in my experience and I would love to see it in Netbeans. @pughbri, I think I sounded too harsh. I realized my mistake and had removed the same in my blog entry[1] last year itself. However, I forgot to do the same here. I am again sorry for that comment. [1] http://nbguru.wordpress.com/2008/07/30/getting-your-basics-right/#comment-549 Hope this sounds better. It would be okay with me to combine "Go to Declaration" and "Go to Implementation" into a single shortcut. The class selection menu that appears could contain both declarations and implementations, perhaps with icons or color differences to easily differentiate the two. But I can also see why someone might want them to be separate. Regardless of whether or not they are combined, if the class selection menu would only contain one class, it should jump directly to that class and not display the menu. In the "Go to Implementation" plug-in for previous versions of NetBeans, this was not the case. If there was only one implementation, it would display a menu containing that one class, which adds an unnecessary extra click. *** Issue 170558 has been marked as a duplicate of this issue. *** *** Bug 104311 has been marked as a duplicate of this bug. *** |