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 136665

Summary: Mark occurrences is lost after goto next
Product: java Reporter: Egor Ushakov <gorrus>
Component: EditorAssignee: Max Sauer <msauer>
Status: RESOLVED FIXED    
Severity: blocker CC: tor, vv159170
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 133913    

Description Egor Ushakov 2008-06-06 15:53:19 UTC
Open any Java file and click on any widely used variable to see mark occurrences.
Press Alt+Down or Alt+Up to go to the next or previous place - all ok,
but carret is places at the beginning of the variable name and highlighting disappears.
This does not happen inside import directive or javadoc.
Comment 1 Vladimir Voskresensky 2008-06-06 17:03:38 UTC
The problem is with constructions like:
"return userGuess.equals(|getWord(idx));"
when cursor position is inside method call

due to MarkOccurrencesHighlighter:353
        if (!insideJavadoc) {
            el = info.getTrees().getElement(tp);
        }
 => equals instead of getWord is current java element

as workaround for GoToMarkOccurrencesAction, I will move to the end of identifier to keep "current" object to be
returned from info.getTrees().getElement(tp);
Comment 2 Vladimir Voskresensky 2008-06-06 17:04:26 UTC
I will commit workaround in trunk and downgrade to P3
Comment 3 Vladimir Voskresensky 2008-06-06 17:16:26 UTC
http://hg.netbeans.org/main/rev/8f417bdb256d
put workaround. Please, evaluate the priority of the defect now
Comment 4 Quality Engineering 2008-06-07 16:11:06 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #243 build
Changeset: http://hg.netbeans.org/main/rev/8f417bdb256d
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: workaround for IZ#136665: Mark occurrences is lost after goto next
- move to the end of identifier, instead of start of it
Comment 5 Jan Becicka 2008-07-25 10:15:13 UTC
Maxi, please evaluate.
Comment 7 Quality Engineering 2008-08-08 15:45:53 UTC
Integrated into 'main-golden', available in build *200808081401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/c838ebd206dd
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #136665: mark occurrences should work when the caret is before the first letter of an identifier.
Comment 8 Quality Engineering 2008-08-09 03:41:47 UTC
Integrated into 'main-golden', available in build *200808090201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/cb45026922a8
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #136665: the problem has been fixed in c838ebd206dd, so removing the workaround - changeset 8f417bdb256d