Bug 326515 - Eclipse shows old compile errors in source which do not exist
Summary: Eclipse shows old compile errors in source which do not exist
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2010-09-29 07:11 EDT by Mark Hagan CLA
Modified: 2010-10-27 06:47 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hagan CLA 2010-09-29 07:11:31 EDT
Build Identifier: Build id: 20100218-1602

My source file has a few icons that indicate compile errors on lines that are correct. The quick fix text refers to an older version of the source. I use ant to build the project and all source compiles fine. There is nothing wrong with the source. Honest. Even when I comment out the line in question, eclipse still shows a compile error icon!

Any ideas what is still hanging around?

Reproducible: Always
Comment 1 Ayushman Jain CLA 2010-09-29 08:16:18 EDT
Can you please provide a reproducible test case, or your project if you can and illustrate where you see the false errors? Also, please test a newer I-build to check if the problem has been fixed now. Thanks!
Comment 2 Mark Hagan CLA 2010-09-29 09:26:37 EDT
What do you mean by 'I-build'? I've run update and it says nothing to update. Is there a better way to update to the latest version?

As far as a test case is concerned, it won't work. What I'm saying is that there is nothing wrong with the actual source. If you create a new project (which I've tried) you won't see the error. It is something to do with my specific project and all the things that have happened to it while I've been developing over the last year. I was just hoping someone might be able to think of where something might be still 'hanging around' in the workspace/project to confuse the UI/compiler that checks for valid classes in order to show the little red 'compile error' icons.
Comment 3 Olivier Thomann CLA 2010-09-29 09:46:01 EDT
Are you sure your project is built ?
What happens if you try to clean/build the corresponding project ?

You are using 3.5.2. Would it be possible for you to move to 3.6.1 ?
Comment 4 Mark Hagan CLA 2010-09-29 09:51:30 EDT
(In reply to comment #3)
> Are you sure your project is built ?
> What happens if you try to clean/build the corresponding project ?
> 
> You are using 3.5.2. Would it be possible for you to move to 3.6.1 ?

That's the bit that might seem odd. I don't use eclipse to build the project. 'Clean' is not available for me to try - it is greyed out. I run an ant build file with the 'Run As' menu option.
Comment 5 Olivier Thomann CLA 2010-09-29 10:03:45 EDT
Do you see the problem in the editor only ?
That might be the reconciler that is reporting issues.

Do you see this error inside a java editor ?
Do you have the option "Report problems as you type" checked ? (See Preferences>Java>Editor).

Why are you using ant and not the built in compiler/builder ?
Comment 6 Mark Hagan CLA 2010-09-29 10:15:16 EDT
(In reply to comment #5)
> Do you see the problem in the editor only ?
Yes.

> That might be the reconciler that is reporting issues.
> 

> Do you see this error inside a java editor ?
If you mean a non-eclipse editor, no I don't.

> Do you have the option "Report problems as you type" checked ? (See
> Preferences>Java>Editor).
Yes.

> 
> Why are you using ant and not the built in compiler/builder ?
Because our dev team members use a mixture of IDE's - Eclipse, Intellij, Emacs - and all the build tools are based on ant. We normally compile completely outside the IDE but this is a standalone test tool so in theory I could use eclipse but for some reason chose ant. Truth is I haven't learned how, which might be part of the reason why I ended up with this issue.
Comment 7 Olivier Thomann CLA 2010-09-29 10:23:13 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > Do you see the problem in the editor only ?
> Yes.
This means it is a problem with the reconciler. I suspect that the build path is not properly set up within Eclipse to let the compiler do its job. So it is obvious that you end up with reconciler errors.
 
> > Do you see this error inside a java editor ?
> If you mean a non-eclipse editor, no I don't.
I mean the Java editor inside Eclipse. Eclipse has several editors and the Java editor is the one used for .java files.
 
> > Do you have the option "Report problems as you type" checked ? (See
> > Preferences>Java>Editor).
> Yes.
If you uncheck it, do you get rid of the errors ?

> Because our dev team members use a mixture of IDE's - Eclipse, Intellij, Emacs
> - and all the build tools are based on ant. We normally compile completely
> outside the IDE but this is a standalone test tool so in theory I could use
> eclipse but for some reason chose ant. Truth is I haven't learned how, which
> might be part of the reason why I ended up with this issue.
I think your project is not properly set up. And this would explain why the reconciler is complaining about compile errors. Are you sure that the build path is correct ?
What happens if you enable the built-in Java builder? Do you also have errors or the code compiles fine ?

Are you mixing 1.4 and 1.5 projects ?
Comment 8 Olivier Thomann CLA 2010-10-20 09:55:51 EDT
Any update on this?
Comment 9 Mark Hagan CLA 2010-10-20 11:59:43 EDT
(In reply to comment #8)
> Any update on this?

Sorry. I created a new project to get it clean and see what happened. It has reoccurred but with different files; though files that have undergone some changes.

To answer questions above.

1)Unchecking "Report problems as you type" had no effect.

2) I currently use an Ant builder and the Java Builder is unchecked. The ant build.xml handles the compilation. I will try with the Java Builder and see what happens.

3) I'm 99% sure (I'm never 100% sure about anything!) the build path is fine. It has the same jars as the ant build.xml which builds the project perfectly.
Comment 10 Mark Hagan CLA 2010-10-20 12:02:49 EDT
(In reply to comment #9)
Checking the Java Builder and performing a 'Clean' removes the error icons!
Comment 11 Olivier Thomann CLA 2010-10-20 12:07:39 EDT
(In reply to comment #10)
> (In reply to comment #9)
> Checking the Java Builder and performing a 'Clean' removes the error icons!
I believe that if you disable the Java builder, I don't see how the JDT markers can be removed. The builder takes care of removing the markers.
Comment 12 Olivier Thomann CLA 2010-10-24 20:25:18 EDT
I would close as INVALID since we cannot expect markers to be removed if you disable the java builder.
Closing as INVALID.
Reopen if you disagree with this.
Comment 13 Ayushman Jain CLA 2010-10-26 06:05:34 EDT
Verified for 3.7M3
Comment 14 Mark Hagan CLA 2010-10-27 06:47:59 EDT
(In reply to comment #12)
> I would close as INVALID since we cannot expect markers to be removed if you
> disable the java builder.
> Closing as INVALID.
> Reopen if you disagree with this.

No need to reopen as there is a sort of solution. But, functionally, I the project does not have the Java Builder selected then these icons should not be shown. I think that is untidy but not enough to pursue a fix. I guess the builder must have been inadvertently selected at some point causing the icons to be there initially and so that is, as you say, an INVALID scenario. Happy to close.