Bug 269554 - [plan][incremental] persistent incremental state objects
Summary: [plan][incremental] persistent incremental state objects
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows NT
: P2 normal with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 287338 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-03-20 13:32 EDT by Andrew Clement CLA
Modified: 2013-06-24 11:05 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 Andrew Clement CLA 2009-03-20 13:32:45 EDT
Currently AjState objects that capture the incremental build status of a project are not persisted to disk in between workbench restarts - forcing a full build of all AJ projects on restart.

We should persist them, in a similar way to how State objects are persisted for Java projects.
Comment 1 Andrew Clement CLA 2009-09-28 15:02:03 EDT
This is proving extremely complex to implement.  The post build state is absolutely *not* suited for persistence. And besides the AjState object (which manages dependencies), there is the structure model and the world to consider.  The final of these not only encapsulates resolved type information but also crosscutting information gathered from compiled aspects.
Comment 2 Andrew Clement CLA 2010-03-22 17:52:39 EDT
*** Bug 287338 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Clement CLA 2010-11-25 18:30:31 EST
Going to attack the problem in a better way.  We will need to plugin to eclipse shutting down and have a save participant calling out to AJ to persist state for each project.  Reloading the state would be done in

IncrementalStateManager.retrieveStateFor()

which is called from AjdeCoreBuildManager.performBuild(boolean fullBuild).

The first build after a startup does pass in false for 'fullBuild' but right now as no state is found, the flag is flipped to true and a full build commences.

For initial testing I just constantly persist (no need to plug into the lifecycle).

it will be best to avoid making everything persistable and instead make the larger data structures recoverable.  For example all the complex state in a CrosscuttingMembersSet object can be rebuilt from the aspects, and the aspects should be recoverable from the bytes created last time they were built.
Comment 4 Andrew Clement CLA 2010-12-01 14:58:24 EST
Progressing slowly.  In order to recover the weaver we are creating a new weaver object and bringing the aspects back into it by loading the bytecode for them from the bin folder (we persisted the names of the aspects).  Unfortunately there are codepaths triggered that we'd rather avoid when bringing aspects back in like this:

a) some error checking is done during loading of the aspects.  These errors look out of place.  They are basically duplicate errors for entries we already have in the problems view.

b) Some xlint processing doesnt work.  The xlint 'adviceDidNotMatch' is implemented by the advice structure setting a flag when it has been woven somewhere.  This flag shouldn't really persist in the aspect as it only reflects the status on one particular invocation of the weaver.  The trouble is that because it isn't persisted, when we bring the weaver back into the system on restart and do a simple incremental build of the aspect (for example), the xlint fires because the advice looks like it didn't match anything.
Comment 5 Thomas Hofmann CLA 2010-12-01 15:15:53 EST
Hi Andy,

I just wanted to add that I'm glad you are working on this now.
Comment 6 Andrew Clement CLA 2013-06-24 11:05:41 EDT
unsetting the target field which is currently set for something already released