From 2b6f28eaefef88f26aa7d089f7b50e3e5129a514 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 10 May 2006 11:19:05 +0000 Subject: 134471 - incremental structure model repair code overhaul --- asm/src/org/aspectj/asm/IRelationship.java | 2 ++ asm/src/org/aspectj/asm/internal/Relationship.java | 15 +++++++++++++++ weaver/src/org/aspectj/weaver/World.java | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/asm/src/org/aspectj/asm/IRelationship.java b/asm/src/org/aspectj/asm/IRelationship.java index 7d901e0a9..508ce4892 100644 --- a/asm/src/org/aspectj/asm/IRelationship.java +++ b/asm/src/org/aspectj/asm/IRelationship.java @@ -83,4 +83,6 @@ public interface IRelationship extends Serializable { return ALL[ordinal]; } } + + public boolean isAffects(); } diff --git a/asm/src/org/aspectj/asm/internal/Relationship.java b/asm/src/org/aspectj/asm/internal/Relationship.java index 6cef5f3e7..e057d5057 100644 --- a/asm/src/org/aspectj/asm/internal/Relationship.java +++ b/asm/src/org/aspectj/asm/internal/Relationship.java @@ -76,5 +76,20 @@ public class Relationship implements IRelationship { public boolean hasRuntimeTest() { return hasRuntimeTest; } + + // For repairing the relationship map on incremental builds, we need + // to know the direction of the relationship: either 'affects' or 'affected by' + // this set are considered the 'affects' relationship. If we know which direction + // it is in, we know which ones should be removed when a particular resource + // is modified because the subsequent reweave will re-add it. + public boolean isAffects() { + // TODO should be a well defined set (enum type) with a flag for this... + return name.equals("advises") || + name.equals("declares on") || + name.equals("softens") || + name.equals("matched by") || + name.equals("declared on") || + name.equals("annotates"); + } } diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index 7f4263e38..90f7aa74c 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -55,6 +55,11 @@ public abstract class World implements Dump.INode { /** The heart of the world, a map from type signatures to resolved types */ protected TypeMap typeMap = new TypeMap(this); // Signature to ResolvedType + // See pr134471 - we would like to set this false but need for handles in the structure model + // to be independent of location before we can do that. + /** Should we take into account source location when comparing mungers - which may trigger full builds */ + public final static boolean compareLocations = true; + /** Calculator for working out aspect precedence */ private AspectPrecedenceCalculator precedenceCalculator; -- cgit v1.2.3