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 182533 - Mark Occurrences will not navigate between constructor and other class usages
Summary: Mark Occurrences will not navigate between constructor and other class usages
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 199667 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-22 22:57 UTC by Jesse Glick
Modified: 2012-11-30 02:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2010-03-22 22:57:51 UTC
...
someVar = new Some<#1>Listener();
...
private class SomeList<#2>ener {
  SomeListen<#3>er() {...}
}

If you place the caret at position #2, Alt-Up/Down will say "there is no occurrence to navigate to", when clearly the user wanted to see where this class was used. Navigation between #1 and #3 works, but this is not a workaround if the class has no explicit constructor, or you want to find usages of static methods.

The only reliable workaround is to use the Find Usages dialog, which is slower and more work.
Comment 1 Dusan Balek 2011-10-20 12:08:31 UTC
*** Bug 199667 has been marked as a duplicate of this bug. ***
Comment 2 Jesse Glick 2012-01-03 17:10:58 UTC
Duplicate issue points out that this is a more general problem. For example:

import org.openide.util.RequestProcessor;
...
private final RequestProcessor.Task task;
private static final RequestProcessor PROC = new RequestProcessor(...);

You can navigate between the first and third occurrences of the token "RequestProcessor", but the fourth is in its own singleton cycle.

Of course when there are multiple constructors of a class, it can be useful to cycle just between all calls to a particular overload (and the definition, if in the same compilation unit) - analogous to the case that a regular method has multiple overloads. But I think this use case is less common than just wanting to see where a class is used, including all calls to any of its constructors, so it would be preferable to make occurrence navigation cycle between all of these; Find Usages is always available as a fallback when you want to look for calls to a particular overload.
Comment 3 Dusan Balek 2012-11-28 12:48:46 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/284d9f39c4c0
Comment 4 Quality Engineering 2012-11-30 02:43:24 UTC
Integrated into 'main-golden', will be available in build *201211300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/284d9f39c4c0
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #182533: Mark Occurrences will not navigate between constructor and other class usages - fixed.