Bug 115639

Summary: Bogus "XXX cannot be resolved to a type" annotations in editor
Product: [Eclipse Project] JDT Reporter: Richard Dunlap <rdunlap>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3    
Version: 3.1.1   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Image of bogus error annotations none

Description Richard Dunlap CLA 2005-11-09 10:19:53 EST
A new editor problem has surfaced where the edit window is filled with bogus error annotations indicating 
that numerous types cannot be resolved.   The projects build and run just fine, the only problem seems to 
be with the editor (and it's very annoying).

If I open the Java file containing the "alleged" undefined type, the offending bogus error annotations 
spontaneously go away and when I close that same file, the error annotations come back.

There are no errors in the log file.  There are no compile errors, and there are no error indications on the 
file's icons.  I have been using this workspace for about two months and the problem just surfaced last 
night.  Nothing was changed in the project other than some Java source files were edited.
Comment 1 Richard Dunlap CLA 2005-11-09 10:29:25 EST
Created attachment 29600 [details]
Image of bogus error annotations

Here is a snapshot of a typical editor with false error indications, note the
lack of an error indication on the file tab at the top of the window.
Comment 2 Olivier Thomann CLA 2005-11-09 10:32:11 EST
Would it be possible to get a test case that would help us to reproduce this issue?
Comment 3 Richard Dunlap CLA 2005-11-09 10:48:49 EST
(In reply to comment #2)
> Would it be possible to get a test case that would help us to reproduce this issue?

Hmm...  Where to begin?  First, there's nothing special that I am doing.  I'm just opening a file in the 
editor.  It was working yesterday, nothing changed and the problem just surfaced last night.  I was 
forced to kill Eclipse because it froze up last night.  Perhaps something in the project was corrupted?

 I could give you a little background about the projects.  My workspace has multiple projects, two of 
these projects depend upon two other projects.  They also depend upon two Jar file libraries.  The 
projects contain multiple source directories which are links to directories outside of the workspace.

Are there any logs that I could look at (other than the main error log)? Or is there any metadata I can 
delete? etc?

Comment 4 Richard Dunlap CLA 2005-11-09 11:22:53 EST
Yes I DO have a test case!!  And a very simple one at that.

Create the following two files in the same Java package.

in Foo.java:
------START FILE--------
public class Foo {
}

class Bar {
}
-------END FILE---------
in FooBar.java:

------START FILE--------
public class FooBar extends Bar {
}
-------END FILE---------


That's it!

Now, it will all compile.  But if you open 'FooBar.java' while the file 'Foo.java' is NOT open, you will see 
the error annotation in question (cannot resolve type Bar).  However, if you open the file 'Foo.java', the 
problem goes away.
Comment 5 Frederic Fusier CLA 2005-11-09 11:56:18 EST

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