Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] incremental structure models, options

> -----Original Message-----
> From: aspectj-dev-admin@xxxxxxxxxxx 
> [mailto:aspectj-dev-admin@xxxxxxxxxxx]
> On Behalf Of Wes Isberg
...
> Only the rebuilt portion of the structure model is displayed.  Indeed, 
> I don't understand how the structure model is managed during 
> incremental builds.  Normally it's built during the compile as a 
> side-effect of weaving, updating munged units as available.  But 
> during incremental compiles, not everything is munged (true?), which 
> suggests a more difficult algorithm for updating an existing tree 
> (removing invalidated relations/nodes and adding new ones).  I'd be 
> interested in how this is or will be solved; I assume it will take a 
> full rebuild of the structure tree.  In the interim, a batch compile 
> is required to get a full structure model in ajbrowser.

Here's how I've been thinking that it should be implemented.  Please holler
if I've overlooked anything.

First, we have to deal with updating the model with the declaration trees of
files that have been changed, added, or removed.  We can get those lists
from org.aspectj.ajdt.internal.core.builder.AjState.  Changed and added
files should have been working in the update that I sent out.  To remove
deleted files from the model we find the file node corresponding to the
deleted file (using
org.aspectj.asm.StructureModel.findRootNodeForSourceFile(..)) and remove it
from it's parent.  Currently nothing but the parent (i.e. package node)
refers to source files so we don't have to worry about updating other
references.

Then, we need to deal with updating the crosscutting structure.  If the
changed/added/removed file contains an aspect we should have triggered a
batch build.  In that case we don't have to worry since we get a full new
model.  If the file contains plain Java we need to make sure that any advice
that applies to stuff in that file is added as links to the corresponding
nodes.  I believe that should already work, since the weaver has that info
when weaving the new classes with the previously loaded aspects.  [Is that
right Erik?]  That gets us the "affected by" links.  We have to make sure
that the aspect also has the "affects" link to the nodes in the new file.  I
believe that org.aspectj.weaver.AsmAdaptor.addLink(..) is called it will
ensure that the both links will exist, but that should be verified.

If I weren't on the Mediterranean right now I'd try to figure out how
intertype declarations fit into this.  But I am, so let's save that for
later.  Poor intertype declarations, always getting left behind.

Let me know how it goes,

Mik

--
http://kerstens.org/mik 




Back to the top