Bug 115553 - [navigation] Error highlighting marked occurrences
Summary: [navigation] Error highlighting marked occurrences
Status: RESOLVED DUPLICATE of bug 105738
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2005-11-08 16:30 EST by david marcus CLA
Modified: 2007-11-14 05:32 EST (History)
2 users (show)

See Also:


Attachments
screen capture: attachment to demonstrate the error (4.75 KB, image/gif)
2005-11-08 16:35 EST, david marcus CLA
no flags Details
Screen image capture (3.01 KB, image/gif)
2005-11-09 16:38 EST, david marcus CLA
no flags Details
screen capture #3 (1.50 KB, image/gif)
2005-11-09 16:45 EST, david marcus CLA
no flags Details
screen capture (before problem) (5.18 KB, image/gif)
2005-11-15 16:13 EST, david marcus CLA
no flags Details
screen capture (after problem) (4.94 KB, image/gif)
2005-11-15 16:14 EST, david marcus CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description david marcus CLA 2005-11-08 16:30:36 EST
Running 3.2M2 on Windows/XP w/SP2.

I was editing a Java file.

I just added the comment line (see image to be attached) and hit the ctrl-S 
keys to save the file. The yellow areas shifted to the places you see in the 
image.
Comment 1 david marcus CLA 2005-11-08 16:35:09 EST
Created attachment 29565 [details]
screen capture: attachment to demonstrate the error
Comment 2 Dani Megert CLA 2005-11-09 08:44:45 EST
How did you add the comment?
Anything in .log?
Was it in the Java editor?
Can you reproduce?
Comment 3 david marcus CLA 2005-11-09 10:21:25 EST
How did you add the comment?
==> keyboard entry
      - positioned cursor at the line where I wanted to insert comment
      - entered CR
      - typed line
      - entered CTRL-S at end of line
    Prior to entering the comment and saving the file, the highlighted areas 
were correct.

===============================================
Anything in .log?
==> I didn't check the log at the time the problem occurred, however, I see 
several instances of the following trace in the log

!ENTRY org.eclipse.core.runtime 4 2 2005-11-03 14:24:22.140
!MESSAGE Problems occurred when invoking code from plug-
in: "org.eclipse.core.runtime".
!STACK 0
org.eclipse.swt.SWTException: Invalid thread access
	at org.eclipse.swt.SWT.error(SWT.java:3251)
	at org.eclipse.swt.SWT.error(SWT.java:3174)
	at org.eclipse.swt.SWT.error(SWT.java:3145)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:407)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:311)
	at org.eclipse.swt.custom.StyledText.getTabs(StyledText.java:4401)
	at 
org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.handlePreferenceStoreChanged
(JavaEditor.java:2510)
	at 
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.handlePreferenceSt
oreChanged(CompilationUnitEditor.java:1841)
	at 
org.eclipse.ui.texteditor.AbstractTextEditor$PropertyChangeListener.propertyCha
nge(AbstractTextEditor.java:575)
	at 
org.eclipse.ui.texteditor.ChainedPreferenceStore.firePropertyChangeEvent
(ChainedPreferenceStore.java:163)
	at 
org.eclipse.ui.texteditor.ChainedPreferenceStore.handlePropertyChangeEvent
(ChainedPreferenceStore.java:430)
	at org.eclipse.ui.texteditor.ChainedPreferenceStore.access$0
(ChainedPreferenceStore.java:407)
	at 
org.eclipse.ui.texteditor.ChainedPreferenceStore$PropertyChangeListener.propert
yChange(ChainedPreferenceStore.java:68)
	at 
org.eclipse.jdt.internal.ui.text.PreferencesAdapter.firePropertyChangeEvent
(PreferencesAdapter.java:105)
	at 
org.eclipse.jdt.internal.ui.text.PreferencesAdapter$PropertyChangeListener.prop
ertyChange(PreferencesAdapter.java:41)
	at org.eclipse.core.runtime.Preferences$1.run(Preferences.java:497)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent
(Preferences.java:500)
	at 
org.eclipse.core.internal.preferences.PreferenceForwarder.preferenceChange
(PreferenceForwarder.java:98)
	at org.eclipse.core.internal.preferences.EclipsePreferences$2.run
(EclipsePreferences.java:743)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at 
org.eclipse.core.internal.preferences.EclipsePreferences.firePreferenceEvent
(EclipsePreferences.java:746)
	at org.eclipse.core.internal.preferences.EclipsePreferences.remove
(EclipsePreferences.java:863)
	at org.eclipse.jdt.internal.core.JavaModelManager.setOptions
(JavaModelManager.java:2479)
	at org.eclipse.jdt.core.JavaCore.setOptions(JavaCore.java:4087)
	at org.eclipse.jdt.launching.JavaRuntime.detectDefaultVM
(JavaRuntime.java:1567)
	at org.eclipse.jdt.launching.JavaRuntime.getDefaultVMInstall
(JavaRuntime.java:425)
	at org.eclipse.jdt.internal.launching.JREContainerInitializer.resolveVM
(JREContainerInitializer.java:75)
	at 
org.eclipse.jdt.internal.launching.JREContainerInitializer.initialize
(JREContainerInitializer.java:49)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer
(JavaModelManager.java:1597)
	at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer
(JavaModelManager.java:1046)
	at org.eclipse.jdt.core.JavaCore.getClasspathContainer
(JavaCore.java:1326)
	at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath
(JavaProject.java:2046)
	at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath
(JavaProject.java:1954)
	at org.eclipse.jdt.internal.core.JavaProject.buildStructure
(JavaProject.java:332)
	at org.eclipse.jdt.internal.core.Openable.generateInfos
(Openable.java:233)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed
(JavaElement.java:489)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo
(JavaElement.java:233)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo
(JavaElement.java:219)
	at org.eclipse.jdt.internal.core.JavaProject.getJavaProjectElementInfo
(JavaProject.java:1520)
	at org.eclipse.jdt.internal.core.JavaProject.newNameLookup
(JavaProject.java:2426)
	at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>
(SearchableEnvironment.java:60)
	at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>
(SearchableEnvironment.java:74)
	at org.eclipse.jdt.internal.core.CancelableNameEnvironment.<init>
(CancelableNameEnvironment.java:26)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process
(CompilationUnitProblemFinder.java:148)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process
(CompilationUnitProblemFinder.java:214)
	at 
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation
(ReconcileWorkingCopyOperation.java:80)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run
(JavaModelOperation.java:718)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation
(JavaModelOperation.java:777)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile
(CompilationUnit.java:1081)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run
(JavaReconcilingStrategy.java:98)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at 
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile
(JavaReconcilingStrategy.java:82)
	at 
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile
(JavaReconcilingStrategy.java:174)
	at 
org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile
(CompositeReconcilingStrategy.java:114)
	at 
org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconc
ile(JavaCompositeReconcilingStrategy.java:120)
	at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess
(MonoReconciler.java:103)
	at org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess
(JavaReconciler.java:328)
	at 
org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run
(AbstractReconciler.java:170)

===============================================
Was it in the Java editor?
==> yes

===============================================
Can you reproduce?
==> Not at will, but it happens often enough.
Comment 4 Dani Megert CLA 2005-11-09 10:31:17 EST
>Can you reproduce?
>==> Not at will, but it happens often enough.
OK, when it happens next time please check the .log and see whether a .log entry
was created.
Comment 5 david marcus CLA 2005-11-09 16:38:16 EST
Created attachment 29645 [details]
Screen image capture
Comment 6 david marcus CLA 2005-11-09 16:39:00 EST
While playing around and trying to duplicate the problem on demand, I 
experienced the case where the highlighting disappeared and was erratic upon 
return.

I created a new Java file (see later below).
Highlighted 'myMethod' (this worked).
Clicked outside the Eclipse window to look at the 'log' file for Eclipse.

When I got back to the Eclipse window, the highlighting disappeared entirely. 
Clicking on the 'myMethod' (or double clicking) made no difference.

I then tried to click on the 'flag' variable, and got the messed-up 
highlighting(see attachment).

-David


Newly created Java file


public class test
{
    private boolean flag = true;
    
    public test()
    {
        while (flag)
        {
            //-- myMethod invocation
            myMethod();
        }
    }
    
    public void myMethod()
    {
        flag = false;
    }
}
Comment 7 Dani Megert CLA 2005-11-09 16:44:14 EST
If you close and reopen the file the problem goes away, right?
Comment 8 david marcus CLA 2005-11-09 16:44:38 EST
Another sample of the problem. In the attached sample of Java code

        if (logFileDir == null)
            computeLogfileDirectoryFile();

The method name was highlighted in yellow.

I then inserted a comment between the 'if' and the invocation of the 
method 'computeLogfileDirectoryFile'.

As I was typing the comment (and before I finished it) the tail end of the 
comment became highlighted in yellow (see attached image #3)
Comment 9 david marcus CLA 2005-11-09 16:45:23 EST
Created attachment 29649 [details]
screen capture #3
Comment 10 david marcus CLA 2005-11-09 16:50:59 EST
"If you close and reopen the file the problem goes away, right?"

==> Yes. Though I've gotten used to using CTRL-F to open the search window and 
then getting right back to the window (without actually searching for 
anything). When I get back to the Java code, I can then click on a variable to 
see it highlighted.
Comment 11 Dani Megert CLA 2005-11-09 16:58:13 EST
I'm still not able to reproduce this. Can you try 3.2 M3?
What are your "Mark Occurrence" settings?

Note that it is per design that the marks go away when another shell gets focus,
but the cheese you're seeing is of course a bug.
Comment 12 david marcus CLA 2005-11-09 17:42:08 EST
(In reply to comment #11)
> I'm still not able to reproduce this. Can you try 3.2 M3?
> What are your "Mark Occurrence" settings?
> Note that it is per design that the marks go away when another shell gets 
focus,
> but the cheese you're seeing is of course a bug.

I will upgrade to M3 and then be on the lookout for the problem.

Just to recap, on the surface there seem to be two separate problems (they, of 
course, may have the same underlying cause):

1) The 'cheese'... where the yellow areas show up in the wrong places and 
sometimes the wrong length and count of yellow areas

2) the highlighting disappears until some other action restores it (example, 
CTRL-F to open search winow and then go back to Java file).

Comment 13 david marcus CLA 2005-11-14 14:48:15 EST
I installed M3. Initial indications are that the problem has been resolved.

Unless you  know for sure that the bug was fixed, I recommend keeping the bug 
opened for just a bit longer in case the problem pops up again.

-David
Comment 14 david marcus CLA 2005-11-15 16:11:02 EST
Further update using M3.

THe problem of incorrect highlighting is still occurring (albeit less often, 
perhaps due to my changing usage pattern).

See screen cature #4 (the before image) and capture #5 (after image) to follow 
the discussion below.

I highlighted a method invocation, 'open' - this worked (see screen capture 
#4).

I then double-clicked on the 'open' method name to highlight it in blue and 
replaced it with a new name. As I was typing the new name 'accessLogfile', the 
yellow highlighting turned on and highlighted the end of the name I was typing 
as well as the last line of the screen capture. In both places, the yellow 
highlighting did not fit correctly over a token (see screen capture #5).
Comment 15 david marcus CLA 2005-11-15 16:13:54 EST
Created attachment 29980 [details]
screen capture (before problem)

See comment #14
Comment 16 david marcus CLA 2005-11-15 16:14:14 EST
Created attachment 29981 [details]
screen capture (after problem)

See comment #14
Comment 17 Walter Harley CLA 2007-04-02 21:33:49 EDT
I believe this is a duplicate of bug 105738.
Comment 18 Dani Megert CLA 2007-06-22 09:59:43 EDT
Get rid of deprecated state.
Comment 19 Dani Megert CLA 2007-06-22 10:04:52 EDT
.
Comment 20 Dani Megert CLA 2007-11-14 05:31:23 EST
We finally have a test case.
Comment 21 Dani Megert CLA 2007-11-14 05:32:24 EST

*** This bug has been marked as a duplicate of bug 105738 ***