Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 170471

Summary: APT GeneratedResourceChangeListener "blind spot"
Product: [Eclipse Project] JDT Reporter: Vladimir Piskarev <vpiskarov>
Component: APTAssignee: Generic inbox for the JDT-APT component <jdt-apt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
Test annotation processor plugin.
none
Test project. none

Description Vladimir Piskarev CLA 2007-01-15 09:47:48 EST
Build ID: M20060921-0945

Steps To Reproduce:
1. Write and deploy a generating annotation processor. For instance, let us assume that there is annotation processor for @Foo annotation which generates files x/y/z.foo (where x.y.z is the fully qualified name of the class annotated with @Foo).
2. Create a Java project in a blank workspace. Enable annotation processing for the project appropriately. Create a Java class annotated with @Foo.
3. Restart Eclipse. - Important!
4. Delete the class created in step 2. See that generated *.foo file has not been deleted.

More information:
This behaviour is caused by Eclipse's lazy plug-in loading behavior. Since plug-in activation may occur well after the workspace has started up, there is no opportunity add a resource change listener when the workspace is first started. This causes a "blind spot" for listeners, because they cannot process changes that occur between the time of workspace creation and the time when their plug-in is activated. 

The solution to this problem is to take advantage of the save participant mechanism. For more details see this great article by John Arthorne: http://www.eclipse.org/articles/Article-Resource-deltas/resource-deltas.html (Save participants).
Comment 1 Vladimir Piskarev CLA 2007-01-15 10:07:54 EST
Created attachment 56903 [details]
Test annotation processor plugin.
Comment 2 Vladimir Piskarev CLA 2007-01-15 10:09:03 EST
Created attachment 56904 [details]
Test project.
Comment 3 Walter Harley CLA 2007-01-15 14:00:40 EST
Sounds like a good idea.  Maybe we can get replace one of our existing resource change listeners with an ISavedState resource change listener.  Will investigate for 3.3.
Comment 4 Walter Harley CLA 2009-08-03 17:01:50 EDT
Reassigning to jdt-apt-inbox, per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009.
Comment 5 Eclipse Genie CLA 2018-10-31 16:54:14 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.