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 183417

Summary: Allow "go to type" to prefer selected type (fqn)
Product: java Reporter: err <err>
Component: NavigationAssignee: Tomas Zezula <tzezula>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

Description err 2010-04-02 17:59:51 UTC
Same thing happens with "go to source", context menu over an identifier...

(but there are examples when the ide can find the source file)

For example, in a java file there is

    import com.sun.source.util.TreeScanner;


In the Go to Type dialog if I type in
    TreeScanner
there are two choices
    TreeScanner (com.sun.tools.javac.tree)
    TreeScanner (com.sun.source.util)           <<<<<<<<< selected

when the second is selected in the editor get a tab labeled with TreeScanner.java and the popup on the tab is

    ..../.netbeans/dev/var/cache/index/s236/java/14
        /gensrc/com/sun/src/util/TreeScanner.java

and all the methods have

    //compiled code
    throw new RuntimeException("Compiled Code");


HOWEVER, if I am at a breakpoint and Treescanner is in the stacktrace, and I double-click on TreeScanner in the stack I get real source, the popup has
        com/sun/src/util/TreeScanner.java
        in .../jdk1.6.0_18/src.zip
Comment 1 Tomas Zezula 2010-04-02 18:07:45 UTC
The GoTo type dialog uses just selected token, it does not have context to be able to do attribute in file. It supports java, c++, ruby, and other. Choosing the right type is up to you.
Anyway we can create some SPI to allow such a type resolution by the providers.
Comment 2 err 2010-04-02 19:49:07 UTC
Could you help me understand this.

> Choosing the right type is up to you.

Do you mean me the user, or some other part of the system?

If it is some other part of the system, for example some part of the java subsystem, then maybe this is a bug against that.

If it is me, then how do I choose the right type?
Comment 3 Tomas Zezula 2010-04-06 08:06:30 UTC
>Do you mean me the user, or some other part of the system?
The enhancement is about preferring the imported types. The system should.