Community
Participate
Working Groups
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.
Created attachment 29565 [details] screen capture: attachment to demonstrate the error
How did you add the comment? Anything in .log? Was it in the Java editor? Can you reproduce?
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.
>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.
Created attachment 29645 [details] Screen image capture
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; } }
If you close and reopen the file the problem goes away, right?
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)
Created attachment 29649 [details] screen capture #3
"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.
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.
(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).
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
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).
Created attachment 29980 [details] screen capture (before problem) See comment #14
Created attachment 29981 [details] screen capture (after problem) See comment #14
I believe this is a duplicate of bug 105738.
Get rid of deprecated state.
.
We finally have a test case.
*** This bug has been marked as a duplicate of bug 105738 ***