Bug 292441 - Compile problem not being recorded in the resource model and Eclipse thinks a project is fine when it really has errors
Summary: Compile problem not being recorded in the resource model and Eclipse thinks a...
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: 2.0.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 2.0.2   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-15 13:48 EDT by Andrew Eisenberg CLA
Modified: 2009-11-07 12:23 EST (History)
2 users (show)

See Also:
andrew.eisenberg: iplog+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg CLA 2009-10-15 13:48:48 EDT
From the mailing list.  A user is finding that errors are not being properly recorded as markers in the resource model.  When this happens, the program looks like there are no problems, even when there are.  The problem then occurs at runtime.

Examining the log, I see some strangeness.  I don't know exactly how the message handler finds its files, but here is the file that has changed:

> /Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java

And then there is this message:

> 12:17:30 Not adding marker for problem because it's against a resource which
> is not in the list of affected resources provided by the compiler.
> Resource=L/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java Problem
> message=The method appendConstraints() of type JobListingQuery should be
> tagged with @Override since it actually overrides a superclass method
> line=50

Why is that file not in the list of affected resources provided by the compiler?  does it have something to do with the path? Ie- it seems to be the result of IResource.toString(), rather than the full file system path.  My understanding is that the AspectJ compiler passes around java.io.File objects and not IResource objects.  Is this right?  I am assuming this is an AspectJ bug, but it may turn out that AJDT is passing AspectJ the wrong kind of file handle.

Below is the original email with the full log.  

------------------

Andrew,

Here is a bit more information.  After deploying my project, which had no error markers after incremental compilation, and finding there was a compile error from a runtime exception containing:

{code}
Caused by: java.lang.AbstractMethodError: mhc.jobbank.JobListingQuery.setSuppressed(Ljava/lang/Boolean;)V
{code}

I went back, did a clean / rebuild, found the error, applied the fix and saved.  This changed the error marker on the line from a red x to a gray x, and did not clear the error from the problems view.  I re-saved and checked the AJDT Event Trace which is included below:

{code}
12:17:30 ===========================================================================================
12:17:30 Build kind = AUTOBUILD
12:17:30 Project=mhc-ejb, kind of build requested=Incremental AspectJ compilation
12:17:30 Timer event: 0ms: Flush included source file cache
12:17:30 Timer event: 1ms: Check delta
12:17:30 File: /Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java has changed.
12:17:30 build: Examined delta - 1 changed, 0 added, and 0 deleted source files in required project mhc-ejb
12:17:30 Timer event: 2ms: Looking for and marking configuration changes in mhc-ejb
12:17:30      Configuration changes found: true
12:17:30 Timer event: 2ms: Look for source/resource changes
12:17:30 Setting list of classpath elements with modified contents:
12:17:30       []
12:17:30 Classpath = /Users/dave/Workspace/mhc/mhc-ejb/target/classes:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/charsets.jar:/System/Library/Java/Extensions/AppleScriptEngine.jar:/System/Library/Java/Extensions/CoreAudio.jar:/System/Library/Java/Extensions/dns_sd.jar:/System/Library/Java/Extensions/j3daudio.jar:/System/Library/Java/Extensions/j3dcore.jar:/System/Library/Java/Extensions/j3dutils.jar:/System/Library/Java/Extensions/jai_codec.jar:/System/Library/Java/Extensions/jai_core.jar:/System/Library/Java/Extensions/mlibwrapper_jai.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/System/Library/Java/Extensions/QTJava.zip:/System/Library/Java/Extensions/vecmath.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/apple_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/dnsns.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/localedata.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/sunjce_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/sunpkcs11.jar:/Users/dave/.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar:/Users/dave/.m2/repository/log4j/log4j/1.2.13/log4j-1.2.13.jar:/Users/dave/.m2/repository/h2/h2-core/1.0.0-SNAPSHOT/h2-core-1.0.0-SNAPSHOT.jar:/Users/dave/.m2/repository/jboss-seam/jboss-seam/2.1.1.GA/jboss-seam-2.1.1.GA.jar:/Users/dave/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar:/Users/dave/.m2/repository/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:/Users/dave/.m2/repository/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:/Users/dave/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar:/Users/dave/.m2/repository/jboss-el/jboss-el/1.0_02.CR2/jboss-el-1.0_02.CR2.jar:/Users/dave/.m2/repository/jboss-seam/jboss-seam-ui/2.1.1.GA/jboss-seam-ui-2.1.1.GA.jar:/Users/dave/.m2/repository/jsf-facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1.jar:/Users/dave/.m2/repository/lucene-core/lucene-core/2.3.2/lucene-core-2.3.2.jar:/Users/dave/.m2/repository/hibernate-validator/hibernate-validator/3.0.0.GA/hibernate-validator-3.0.0.GA.jar:/Users/dave/.m2/repository/hibernate-commons-annotations/hibernate-commons-annotations/3.0.0.GA/hibernate-commons-annotations-3.0.0.GA.jar:/Users/dave/.m2/repository/hibernate-search/hibernate-search/3.0.0.GA/hibernate-search-3.0.0.GA.jar:/Users/dave/.m2/repository/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.jar:/Users/dave/.m2/repository/javacsv/javacsv/2.0/javacsv-2.0.jar:/Users/dave/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:/Users/dave/.m2/repository/h2/h2-onet/1.0.0-SNAPSHOT/h2-onet-1.0.0-SNAPSHOT.jar:/Users/dave/.m2/repository/h2/h2-seam/1.0.0-SNAPSHOT/h2-seam-1.0.0-SNAPSHOT.jar:/Users/dave/.m2/repository/h2/h2-web/1.0.0-SNAPSHOT/h2-web-1.0.0-SNAPSHOT.jar:/Users/dave/.m2/repository/h2/h2-actions/1.0.0-SNAPSHOT/h2-actions-1.0.0-SNAPSHOT.jar:/Users/dave/.m2/repository/richfaces/richfaces-ui/3.3.1.GA/richfaces-ui-3.3.1.GA.jar:/Users/dave/.m2/repository/richfaces/richfaces-api/3.3.1.GA/richfaces-api-3.3.1.GA.jar:/Users/dave/.m2/repository/richfaces/richfaces-impl/3.3.1.GA/richfaces-impl-3.3.1.GA.jar:/Users/dave/.m2/repository/jee-api/jee-api/5/jee-api-5.jar:/Users/dave/.m2/repository/jboss/jboss-annotations-ejb3/4.2.2.GA/jboss-annotations-ejb3-4.2.2.GA.jar:/Users/dave/.m2/repository/hibernate/hibernate/3.2.2.GA/hibernate-3.2.2.GA.jar:/Users/dave/.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar:/Users/dave/.m2/repository/asm/asm/1.3.4/asm-1.3.4.jar:/Users/dave/.m2/repository/asm-util/asm-util/1.3.4/asm-util-1.3.4.jar:/Users/dave/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/dave/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar:/Users/dave/.m2/repository/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar:/Users/dave/.m2/repository/jaxen/jaxen/1.1-beta-7/jaxen-1.1-beta-7.jar:/Users/dave/.m2/repository/hibernate-annotations/hibernate-annotations/3.3.0.GA/hibernate-annotations-3.3.0.GA.jar:/Users/dave/.m2/repository/hibernate-annotations/hibernate-commons-annotations/3.3.0.GA/hibernate-commons-annotations-3.3.0.GA.jar:/Users/dave/.m2/repository/jakarta-oro/jakarta-oro/2.0.8/jakarta-oro-2.0.8.jar:/Users/dave/.m2/repository/fop/fop/0.95/fop-0.95.jar:/Users/dave/.m2/repository/avalon-framework/avalon-framework/4.2.0/avalon-framework-4.2.0.jar:/Users/dave/.m2/repository/batik/batik/1.7/batik-1.7.jar:/Users/dave/.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar:/Users/dave/.m2/repository/serializer/serializer/2.7.0/serializer-2.7.0.jar:/Users/dave/.m2/repository/xmlgraphics-commons/xmlgraphics-commons/1.3.1/xmlgraphics-commons-1.3.1.jar:/Users/dave/.m2/repository/jbosscache-core/jbosscache-core/2.2.0.GA/jbosscache-core-2.2.0.GA.jar:/Users/dave/.m2/repository/jgroups/jgroups-all/2.2.0.GA/jgroups-all-2.2.0.GA.jar:/Users/dave/.m2/repository/jboss-aop/jboss-aop/1.5.6.GA/jboss-aop-1.5.6.GA.jar:/Users/dave/.m2/repository/iradix-gis/iradix-gis/1.0/iradix-gis-1.0.jar:/Users/dave/.m2/repository/nekohtml/nekohtml/1.9.6.1/nekohtml-1.9.6.1.jar:/Users/dave/.m2/repository/jboss-seam/jboss-seam-pdf/2.1.1.GA/jboss-seam-pdf-2.1.1.GA.jar:/Users/dave/.m2/repository/itext/itext/2.1.7/itext-2.1.7.jar:/Users/dave/.m2/repository/itext/itext-rtf/2.1.7/itext-rtf-2.1.7.jar:/Users/dave/.m2/repository/jboss-seam/jboss-seam-excel/2.1.1.GA/jboss-seam-excel-2.1.1.GA.jar:/Users/dave/.m2/repository/jxl/jxl/2.6.10/jxl-2.6.10.jar:/Applications/Eclipse/Eclipse-3.5/plugins/org.aspectj.runtime_1.6.6.20090930185500/aspectjrt.jar:
12:17:30 Timer event: 18ms: Pre compile
12:17:30 Sending the following configuration changes to the compiler: []
12:17:30 1 source file changes since last build
12:17:30 Compiler configuration for project mhc-ejb has been read by compiler.  Resetting.
12:17:30      Configuration was []
12:17:30 Resetting list of modified source files.  Was [/Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java]
12:17:30 Preparing for build: planning to be an incremental build
12:17:30 Starting incremental compilation loop 1 of possibly 5
12:17:30 AJC: compiling source files
12:17:30 Timer event: 341ms: Time to first compiled message
12:17:30 AJC: compiled: /Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java
12:17:30 Timer event: 373ms: Time to first woven message
12:17:30 AJC: woven class mhc.jobbank.JobListingQuery (from /Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java)
12:17:30 AJC: woven class mhc.jobbank.JobListingQuery$AjcClosure1 (from /Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java)
12:17:30 AJC: woven class mhc.jobbank.JobListingQuery$AjcClosure3 (from /Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java)
12:17:30 AJC: woven class mhc.jobbank.JobListingQuery$AjcClosure5 (from /Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java)
12:17:30 addSourcelineTask message=The method appendConstraints() of type JobListingQuery should be tagged with @Override since it actually overrides a superclass method file=/Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java line=50
12:17:30 addSourcelineTask message=advice defined in h2.core.partitioned.PartitionedQueryAspect has not been applied [Xlint:adviceDidNotMatch] file=/Users/dave/.m2/repository/h2/h2-core/1.0.0-SNAPSHOT/h2-core-1.0.0-SNAPSHOT.jar!h2/core/partitioned/PartitionedQueryAspect.class line=13
12:17:30 addSourcelineTask message=advice defined in h2.core.partitioned.PartitionedQueryAspect has not been applied [Xlint:adviceDidNotMatch] file=/Users/dave/.m2/repository/h2/h2-core/1.0.0-SNAPSHOT/h2-core-1.0.0-SNAPSHOT.jar!h2/core/partitioned/PartitionedQueryAspect.class line=25
12:17:30 addSourcelineTask message=advice defined in h2.core.collections.SyncAspect has not been applied [Xlint:adviceDidNotMatch] file=/Users/dave/.m2/repository/h2/h2-core/1.0.0-SNAPSHOT/h2-core-1.0.0-SNAPSHOT.jar!h2/core/collections/SyncAspect.class line=12
12:17:30 addSourcelineTask message=advice defined in h2.core.localized.LocalizedQueryAspect has not been applied [Xlint:adviceDidNotMatch] file=/Users/dave/.m2/repository/h2/h2-core/1.0.0-SNAPSHOT/h2-core-1.0.0-SNAPSHOT.jar!h2/core/localized/LocalizedQueryAspect.class line=46
12:17:30 addSourcelineTask message=advice defined in h2.web.jsf.JSFAspect has not been applied [Xlint:adviceDidNotMatch] file=/Users/dave/.m2/repository/h2/h2-web/1.0.0-SNAPSHOT/h2-web-1.0.0-SNAPSHOT.jar!h2/web/jsf/JSFAspect.class line=12
12:17:30 addSourcelineTask message=advice defined in h2.web.jsf.JSFAspect has not been applied [Xlint:adviceDidNotMatch] file=/Users/dave/.m2/repository/h2/h2-web/1.0.0-SNAPSHOT/h2-web-1.0.0-SNAPSHOT.jar!h2/web/jsf/JSFAspect.class line=29
12:17:30 addSourcelineTask message=advice defined in h2.core.utils.LazyAspect has not been applied [Xlint:adviceDidNotMatch] file=/Users/dave/.m2/repository/h2/h2-core/1.0.0-SNAPSHOT/h2-core-1.0.0-SNAPSHOT.jar!h2/core/utils/LazyAspect.class line=14
12:17:30 AspectJ reports build successful, build was: INCREMENTAL
12:17:30 AJDE Callback: finish. Was full build: false
12:17:30 Timer event: 396ms: Total time spent in AJDE
12:17:30 Timer event: 0ms: Refresh after build
12:17:30 Types affected during build = 1
12:17:30 Not adding marker for problem because it's against a resource which is not in the list of affected resources provided by the compiler. Resource=L/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java Problem message=The method appendConstraints() of type JobListingQuery should be tagged with @Override since it actually overrides a superclass method line=50
12:17:30 Not adding marker for problem because it's against a resource which is not in the list of affected resources provided by the compiler. Resource=P/mhc-ejb Problem message=advice defined in h2.core.partitioned.PartitionedQueryAspect has not been applied [Xlint:adviceDidNotMatch] line=13
12:17:30 Not adding marker for problem because it's against a resource which is not in the list of affected resources provided by the compiler. Resource=P/mhc-ejb Problem message=advice defined in h2.core.partitioned.PartitionedQueryAspect has not been applied [Xlint:adviceDidNotMatch] line=25
12:17:30 Not adding marker for problem because it's against a resource which is not in the list of affected resources provided by the compiler. Resource=P/mhc-ejb Problem message=advice defined in h2.core.collections.SyncAspect has not been applied [Xlint:adviceDidNotMatch] line=12
12:17:30 Not adding marker for problem because it's against a resource which is not in the list of affected resources provided by the compiler. Resource=P/mhc-ejb Problem message=advice defined in h2.core.localized.LocalizedQueryAspect has not been applied [Xlint:adviceDidNotMatch] line=46
12:17:30 Not adding marker for problem because it's against a resource which is not in the list of affected resources provided by the compiler. Resource=P/mhc-ejb Problem message=advice defined in h2.web.jsf.JSFAspect has not been applied [Xlint:adviceDidNotMatch] line=12
12:17:30 Not adding marker for problem because it's against a resource which is not in the list of affected resources provided by the compiler. Resource=P/mhc-ejb Problem message=advice defined in h2.web.jsf.JSFAspect has not been applied [Xlint:adviceDidNotMatch] line=29
12:17:30 Not adding marker for problem because it's against a resource which is not in the list of affected resources provided by the compiler. Resource=P/mhc-ejb Problem message=advice defined in h2.core.utils.LazyAspect has not been applied [Xlint:adviceDidNotMatch] line=14
12:17:31 Timer event: 15ms: Delete markers: mhc-ejb (Finished deleting markers for mhc-ejb)
12:17:31 Timer event: 50ms: Create markers: mhc-ejb (Finished creating markers for mhc-ejb)
12:17:31 Created 2 markers in 1 files
{code}
Comment 1 Andrew Clement CLA 2009-10-15 13:56:02 EDT
look at if there is time
Comment 2 Dave Whittaker CLA 2009-10-15 14:22:40 EDT
I thought that was strange too.  I'm not that familiar with the AJDT trace and what it generally reports, but I also thought it was odd that there is no reference at all to the error marker that should have been cleared, just that it would be adding those warning markers if it could find the associated resources.
Comment 3 Dave Whittaker CLA 2009-11-03 15:37:36 EST
I'd really like to get to the bottom of this and I've got a bit of free time.  Do you guys have any suggestions on how I could dig deeper into what is causing the problem and make it any easier to debug / fix?
Comment 4 Andrew Clement CLA 2009-11-03 15:52:25 EST
the normal process should be that you edit and save a file - this causes that file to be compiled and perhaps any dependencies that rely on it.  It is against the rules of compilation for an error to be recorded against something that did not get compiled.  Over the years I've had to address many issues in this area.

I can see three possibilities, which some of those logs may allow us to discount:
- AspectJ did not tell AJDT that a particular file was affected
- resource name used does not match between AJDT and AspectJ
- error was recorded against a file that was not compiled

they are ordered by where I think the problem is more likely to be.
Comment 5 Dave Whittaker CLA 2009-11-04 13:47:02 EST
It would seem to me that this line:

12:17:30 File:
/Users/dave/Workspace/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java
has changed

Implies that AspectJ is telling AJDT that the file has changed, and then this one:

12:17:30 Not adding marker for problem because it's against a resource which is
not in the list of affected resources provided by the compiler.
Resource=L/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java Problem
message=The method appendConstraints() of type JobListingQuery should be tagged
with @Override since it actually overrides a superclass method line=50

Shows that there is some mixup in the naming.  So if that is the issue, I take it that the best way to track this down is to dive into the AJDT code and take a look at how AJDT receives affected resources during an incremental build and then matches them to resources in the project.  I've never taken a look at AJDT source before but I guess now is as good a time as any.
Comment 6 Andrew Eisenberg CLA 2009-11-04 14:11:34 EST
This could be an AJDT problem.  Based on the path expressions shown below, it looks like your project is not in the default location.  Is that correct?

It looks like your project is located here in your file system:

/Users/dave/Workspace/mhc/mhc-ejb

And the name of the name of the project is:

mhc-ejb

This is something I can try to reproduce, but if you are interested in looking at this yourself and digging into AJDT code, you can look at the org.eclipse.ajdt.internal.core.ajde.CoreOutputLocationManager file.
Comment 7 Dave Whittaker CLA 2009-11-04 14:29:55 EST
That's right.  It is a Maven project and the top level POM module is mhc while the sub module that I'm working on which is imported into Eclipse as a project itself is mhc-ejb.  I just got AJDT checked out and built so I'll take a  look and see if I come across anything interesting.
Comment 8 Dave Whittaker CLA 2009-11-04 17:23:09 EST
Ok, I've got it.

UIBuildProgressMonitor.setProgressText() seems to take messages from the AspectJ compiler and interpret them into eclipse markers.  Starting at line 165 it processes "compiled: " messages by creating an Eclipse Path out of the file name in the message and then invoking  workspaceRoot.getFileForLocation() on that path to get an IFile object.  Unfortunately that method doesn't seem to return a resources that correctly identifies a resource if the project isn't in the default location... so instead of getting back L/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java it's returning L/mhc/mhc-ejb/src/main/aspectj/mhc/jobbank/JobListingQuery.java.

I think the fix might be as easy as this substitution on line 185:

//IFile file = workspaceRoot.getFileForLocation(resourcePath);
IFile file =  project.getFile(resourcePath);
Comment 9 Andrew Eisenberg CLA 2009-11-04 18:24:30 EST
I won't have time to try this out until tomorrow.  Thanks for locating the source of the error.  However, I am not sure that your suggested fix will work.  {resourcePath} should be an absolute file system location and the method {workspaceRoot.getFileForLocation(resourcePath)} should convert a file system location to a workspace location.  Whereas, {project.getFile(resourcePath)} should just create a workspace relative path by appending {resourcePath} to the project path (which would be wrong since resourcePath is absolute).  

Nevertheless, this looks helpful and I'll have a look at it tonight or tomorrow.
Comment 10 Dave Whittaker CLA 2009-11-04 18:55:52 EST
Whoops.  You're right, I had subbed that line in, saw that the root was correct and declared victory a bit early.  I'm sure you guys know how Eclipse handles resources better than I do, but for my own benefit I took another stab and this seems to work:

IFile file =  project.getFile(resourcePath.makeRelativeTo(project.getLocation()));

I haven't tested it against a project that doesn't have a non-standard location, and I'm sure it's not right for handling affected resources contained in jar files, but in my case it does seem to fix the problem.
Comment 11 Andrew Eisenberg CLA 2009-11-05 12:48:11 EST
Hmmm...not able to reproduce this exactly on my end.  However, I have created a situation where error markers are not appearing.

Here is the structure on the file system (ie- project A contains project B on the file system):

Proj A/
  Proj B/
    src/
    
And in Eclipse, here is what I have:

Proj A/
  Proj B/src/   (not linked, but used as source folder)

Proj B/
  src/     (source folder)
  
When I have this structure, and add a java file with a compilation problem, the problem does not appear in the problem view and I get the message that you show earlier.  Is this something like what you have?

Also, this:
IFile file = 
project.getFile(resourcePath.makeRelativeTo(project.getLocation()));
will fail once linked source folders are brought into the mix.  However, linked source folders appear to be handled differently, so this solution may actually work.

And indeed, I tried this out and see that if I add a third project into the mix that links to the source folder like this:
File system:
Proj C/

Workspace:
Proj C/
  Proj A/Proj B/src/ (linked)
  
Then the marker appears in Proj C and Proj A, but not Proj B.  This is getting more complicated.

...

All right.  I believe I have a fix now.  The underlying problem was that resources outside of the current project were being added to the list of affected files.  This means that markers from those files are deleted, but not added (that is why you see the message in the event trace view).  Each project is compiled separately and therefore controls markers on its own files.

There are 3 things I needed to fix:

1. The check to see if projects have linked source folders was not correct.
2. The file lookup to get the file from the workspace root was not correct when the file exists in multiple projects in the workspace (the fix was to use Dave's line of code).
3. When dealing with linked source folders, only add the file to the list of affected files if it is in the current project.

Will do some testing and commit shortly.
Comment 12 Dave Whittaker CLA 2009-11-05 13:00:03 EST
Woohoo!  My first line of code contributed to an open source project :)  Let me know when it's available and I'll test it out.
Comment 13 Andrew Eisenberg CLA 2009-11-05 13:44:47 EST
Fix committed.  Works in all situations I was able to try, but we should keep an eye on this to make sure that no more compile problems are dropped.

Thanks for the help, Dave.
Comment 14 Dave Whittaker CLA 2009-11-07 12:23:38 EST
No Problem.  I'm psyched to have actually figured out how to debug the AJ plugin code using Eclipse, hopefully I'll be more helpful with future bugs as well.  I updated to the latest dev build last night and it seems to have fixed the problem.  Thanks for working with me on this.