summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoravasseur <avasseur>2005-05-10 15:44:11 +0000
committeravasseur <avasseur>2005-05-10 15:44:11 +0000
commit83655ff47c1af1ca58c8043626799e0483d5acd4 (patch)
tree0cd02ea9863cbbb759ab0df465dd60a584855b8f /weaver
parent2c4f9d292a521703642169d8c066792d0e0802f5 (diff)
downloadaspectj-83655ff47c1af1ca58c8043626799e0483d5acd4.tar.gz
aspectj-83655ff47c1af1ca58c8043626799e0483d5acd4.zip
fix 75442 thru lateTypeMungers, currently @AJaspectOf and perObject are lateTypeMungers. new LTW tests, some fix in the LTW test error reporting
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/Advice.java2
-rw-r--r--weaver/src/org/aspectj/weaver/CrosscuttingMembers.java30
-rw-r--r--weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java17
-rw-r--r--weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java33
-rw-r--r--weaver/src/org/aspectj/weaver/ResolvedTypeX.java1
-rw-r--r--weaver/src/org/aspectj/weaver/World.java2
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java25
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java39
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java5
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java2
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java11
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/PerCflow.java4
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/PerFromSuper.java2
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/PerObject.java12
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/PerSingleton.java4
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java4
16 files changed, 158 insertions, 35 deletions
diff --git a/weaver/src/org/aspectj/weaver/Advice.java b/weaver/src/org/aspectj/weaver/Advice.java
index 183272886..ce3516515 100644
--- a/weaver/src/org/aspectj/weaver/Advice.java
+++ b/weaver/src/org/aspectj/weaver/Advice.java
@@ -226,7 +226,7 @@ public abstract class Advice extends ShadowMunger {
// ----
/** @param fromType is guaranteed to be a non-abstract aspect
- * @param perClause has been concretized at a higher level
+ * @param clause has been concretized at a higher level
*/
public ShadowMunger concretize(ResolvedTypeX fromType, World world, PerClause clause) {
// assert !fromType.isAbstract();
diff --git a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
index 5787f39c6..403f4e46b 100644
--- a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
+++ b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
@@ -48,7 +48,8 @@ public class CrosscuttingMembers {
private List shadowMungers = new ArrayList(4);
private List typeMungers = new ArrayList(4);
-
+ private List lateTypeMungers = new ArrayList(0);
+
private List declareParents = new ArrayList(4);
private List declareSofts = new ArrayList(0);
private List declareDominates = new ArrayList(4);
@@ -88,18 +89,24 @@ public class CrosscuttingMembers {
}
public void addTypeMunger(ConcreteTypeMunger m) {
- if (m == null) return; //???
+ if (m == null) throw new Error("FIXME AV - should not happen or what ?");//return; //???
typeMungers.add(m);
}
-
+
+ public void addLateTypeMungers(Collection c) {
+ lateTypeMungers.addAll(c);
+ }
+
+ public void addLateTypeMunger(ConcreteTypeMunger m) {
+ lateTypeMungers.add(m);
+ }
+
public void addDeclares(Collection c) {
for (Iterator i = c.iterator(); i.hasNext(); ) {
addDeclare( (Declare)i.next() );
}
}
-
-
public void addDeclare(Declare declare) {
// this is not extensible, oh well
if (declare instanceof DeclareErrorOrWarning) {
@@ -196,7 +203,12 @@ public class CrosscuttingMembers {
changed = true;
typeMungers = other.typeMungers;
}
-
+
+ if (!lateTypeMungers.equals(other.lateTypeMungers)) {
+ changed = true;
+ lateTypeMungers = other.lateTypeMungers;
+ }
+
if (!declareDominates.equals(other.declareDominates)) {
changed = true;
declareDominates = other.declareDominates;
@@ -258,7 +270,11 @@ public class CrosscuttingMembers {
public List getTypeMungers() {
return typeMungers;
}
-
+
+ public List getLateTypeMungers() {
+ return lateTypeMungers;
+ }
+
public List getDeclareAnnotationOnTypes() {
return declareAnnotationsOnType;
}
diff --git a/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java b/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java
index 652666393..b84c44a71 100644
--- a/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java
+++ b/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java
@@ -31,11 +31,12 @@ import org.aspectj.weaver.patterns.DeclareParents;
*/
public class CrosscuttingMembersSet {
private World world;
- //FIXME Alex: we may need a sequencedHashMap there to ensure source based precedence for @AJ advice
+ //FIXME AV - ? we may need a sequencedHashMap there to ensure source based precedence for @AJ advice
private Map members = new HashMap();
private List shadowMungers = null;
private List typeMungers = null;
+ private List lateTypeMungers = null;
private List declareSofts = null;
private List declareParents = null;
private List declareAnnotationOnTypes = null;
@@ -92,6 +93,7 @@ public class CrosscuttingMembersSet {
private void clearCaches() {
shadowMungers = null;
typeMungers = null;
+ lateTypeMungers = null;
declareSofts = null;
declareParents = null;
declareDominates = null;
@@ -119,7 +121,18 @@ public class CrosscuttingMembersSet {
}
return typeMungers;
}
-
+
+ public List getLateTypeMungers() {
+ if (lateTypeMungers == null) {
+ ArrayList ret = new ArrayList();
+ for (Iterator i = members.values().iterator(); i.hasNext(); ) {
+ ret.addAll(((CrosscuttingMembers)i.next()).getLateTypeMungers());
+ }
+ lateTypeMungers = ret;
+ }
+ return lateTypeMungers;
+ }
+
public List getDeclareSofts() {
if (declareSofts == null) {
ArrayList ret = new ArrayList();
diff --git a/weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java b/weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java
index 2a9f73202..116d146a1 100644
--- a/weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java
@@ -15,12 +15,36 @@ package org.aspectj.weaver;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.util.Map;
+import java.util.WeakHashMap;
+import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.HashMap;
import org.aspectj.weaver.patterns.Pointcut;
import org.aspectj.weaver.patterns.FastMatchInfo;
+import org.aspectj.weaver.patterns.PerClause;
import org.aspectj.util.FuzzyBoolean;
public class PerObjectInterfaceTypeMunger extends ResolvedTypeMunger {
+
+ // key is advisedType, value is Set of aspect type that advise the type and are perObject
+ public static Map s_advisedTypeToAspects = new HashMap();
+ public static void registerAsAdvisedBy(ResolvedTypeX matchType, ResolvedTypeX aspectType) {
+ if (PerClause.PEROBJECT.equals(aspectType.getPerClause().getKind())) {
+ Set aspects = (Set)s_advisedTypeToAspects.get(matchType);
+ if (aspects == null) {
+ aspects = new HashSet(1);
+ s_advisedTypeToAspects.put(matchType, aspects);
+ }
+ aspects.add(aspectType);
+ }
+ }
+ public static void unregisterFromAsAdvisedBy(ResolvedTypeX matchType) {
+ s_advisedTypeToAspects.remove(matchType);
+ }
+
private ResolvedMember getMethod;
private ResolvedMember setMethod;
private TypeX aspectType;
@@ -66,7 +90,14 @@ public class PerObjectInterfaceTypeMunger extends ResolvedTypeMunger {
// comment from Andy - this is hard to fix...
// right now I filter @AJ aspect else it end up with duplicate members
- return !matchType.isInterface() && !matchType.isAnnotationStyleAspect();
+ //return !matchType.isInterface() && !matchType.isAnnotationStyleAspect();
+ Set aspects = (Set)s_advisedTypeToAspects.get(matchType);
+ if (aspects == null) {
+ return false;
+ } else {
+ return aspects.contains(aspectType);
+ }
+
}
private FuzzyBoolean isWithinType(ResolvedTypeX type) {
diff --git a/weaver/src/org/aspectj/weaver/ResolvedTypeX.java b/weaver/src/org/aspectj/weaver/ResolvedTypeX.java
index 05fe9ed92..5154d1aa6 100644
--- a/weaver/src/org/aspectj/weaver/ResolvedTypeX.java
+++ b/weaver/src/org/aspectj/weaver/ResolvedTypeX.java
@@ -414,6 +414,7 @@ public abstract class ResolvedTypeX extends TypeX implements AnnotatedElement {
crosscuttingMembers.setPerClause(getPerClause());
crosscuttingMembers.addShadowMungers(collectShadowMungers());
crosscuttingMembers.addTypeMungers(getTypeMungers());
+ //FIXME AV - skip but needed ?? or ?? crosscuttingMembers.addLateTypeMungers(getLateTypeMungers());
crosscuttingMembers.addDeclares(collectDeclares(!this.doesNotExposeShadowMungers()));
crosscuttingMembers.addPrivilegedAccesses(getPrivilegedAccesses());
diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java
index cdcac9fc5..6a3b0814e 100644
--- a/weaver/src/org/aspectj/weaver/World.java
+++ b/weaver/src/org/aspectj/weaver/World.java
@@ -70,6 +70,8 @@ public abstract class World implements Dump.INode {
visitor.visitList(crosscuttingMembersSet.getShadowMungers());
visitor.visitString("Type mungers:");
visitor.visitList(crosscuttingMembersSet.getTypeMungers());
+ visitor.visitString("Late Type mungers:");
+ visitor.visitList(crosscuttingMembersSet.getLateTypeMungers());
if (dumpState_cantFindTypeExceptions!=null) {
visitor.visitString("Cant find type problems:");
visitor.visitList(dumpState_cantFindTypeExceptions);
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
index e25beb343..d28034fed 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
@@ -35,12 +35,16 @@ import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.TypeX;
import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.World;
+import org.aspectj.weaver.PerObjectInterfaceTypeMunger;
import org.aspectj.weaver.ataspectj.Ajc5MemberMaker;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.patterns.ExactTypePattern;
import org.aspectj.weaver.patterns.ExposedState;
import org.aspectj.weaver.patterns.Pointcut;
+import org.aspectj.weaver.patterns.PerClause;
+import org.aspectj.weaver.patterns.PerObject;
+import org.aspectj.weaver.patterns.PerFromSuper;
/**
* Advice implemented for bcel.
@@ -136,7 +140,26 @@ public class BcelAdvice extends Advice {
public void implementOn(Shadow s) {
hasMatchedAtLeastOnce=true;
- BcelShadow shadow = (BcelShadow) s;
+ BcelShadow shadow = (BcelShadow) s;
+
+ //FIXME AV ok ?
+ // callback for perObject AJC MightHaveAspect postMunge (#75442)
+ if (getConcreteAspect() != null
+ && getConcreteAspect().getPerClause() != null
+ && PerClause.PEROBJECT.equals(getConcreteAspect().getPerClause().getKind())) {
+ final PerObject clause;
+ if (getConcreteAspect().getPerClause() instanceof PerFromSuper) {
+ clause = (PerObject)((PerFromSuper) getConcreteAspect().getPerClause()).lookupConcretePerClause(getConcreteAspect());
+ } else {
+ clause = (PerObject) getConcreteAspect().getPerClause();
+ }
+ if (clause.isThis()) {
+ PerObjectInterfaceTypeMunger.registerAsAdvisedBy(s.getThisVar().getType(), getConcreteAspect());
+ } else {
+ PerObjectInterfaceTypeMunger.registerAsAdvisedBy(s.getTargetVar().getType(), getConcreteAspect());
+ }
+ }
+
if (getKind() == AdviceKind.Before) {
shadow.weaveBefore(this);
} else if (getKind() == AdviceKind.AfterReturning) {
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
index c966e346c..305bdcf23 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
@@ -75,6 +75,7 @@ import org.aspectj.weaver.TypeX;
import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.WeaverMetrics;
import org.aspectj.weaver.WeaverStateInfo;
+import org.aspectj.weaver.PerObjectInterfaceTypeMunger;
import org.aspectj.weaver.Shadow.Kind;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.FastMatchInfo;
@@ -88,9 +89,10 @@ class BcelClassWeaver implements IClassWeaver {
BcelWorld world,
LazyClassGen clazz,
List shadowMungers,
- List typeMungers)
+ List typeMungers,
+ List lateTypeMungers)
{
- boolean b = new BcelClassWeaver(world, clazz, shadowMungers, typeMungers).weave();
+ boolean b = new BcelClassWeaver(world, clazz, shadowMungers, typeMungers, lateTypeMungers).weave();
//System.out.println(clazz.getClassName() + ", " + clazz.getType().getWeaverState());
//clazz.print();
return b;
@@ -101,6 +103,7 @@ class BcelClassWeaver implements IClassWeaver {
private final LazyClassGen clazz;
private final List shadowMungers;
private final List typeMungers;
+ private final List lateTypeMungers;
private final BcelObjectType ty; // alias of clazz.getType()
private final BcelWorld world; // alias of ty.getWorld()
@@ -137,7 +140,8 @@ class BcelClassWeaver implements IClassWeaver {
BcelWorld world,
LazyClassGen clazz,
List shadowMungers,
- List typeMungers)
+ List typeMungers,
+ List lateTypeMungers)
{
super();
// assert world == clazz.getType().getWorld()
@@ -145,6 +149,7 @@ class BcelClassWeaver implements IClassWeaver {
this.clazz = clazz;
this.shadowMungers = shadowMungers;
this.typeMungers = typeMungers;
+ this.lateTypeMungers = lateTypeMungers;
this.ty = clazz.getBcelObjectType();
this.cpg = clazz.getConstantPoolGen();
this.fact = clazz.getFactory();
@@ -328,7 +333,7 @@ class BcelClassWeaver implements IClassWeaver {
// we want to "touch" all aspects
if (clazz.getType().isAspect()) isChanged = true;
-
+
// start by munging all typeMungers
for (Iterator i = typeMungers.iterator(); i.hasNext(); ) {
Object o = i.next();
@@ -369,7 +374,6 @@ class BcelClassWeaver implements IClassWeaver {
List methodGens = new ArrayList(clazz.getMethodGens());
for (Iterator i = methodGens.iterator(); i.hasNext();) {
LazyMethodGen mg = (LazyMethodGen)i.next();
- //mg.getBody();
if (! mg.hasBody()) continue;
boolean shadowMungerMatched = match(mg);
if (shadowMungerMatched) {
@@ -378,7 +382,7 @@ class BcelClassWeaver implements IClassWeaver {
isChanged = true;
}
}
- if (! isChanged) return false;
+ //if (! isChanged) return false;//FIXME AV - was active, WHY ?? I need to reach the lateTypeMunger
// now we weave all but the initialization shadows
for (Iterator i = methodGens.iterator(); i.hasNext();) {
@@ -397,7 +401,28 @@ class BcelClassWeaver implements IClassWeaver {
positionAndImplement(initializationShadows);
}
-
+ // now proceed with late type mungers
+ if (lateTypeMungers != null) {
+ for (Iterator i = lateTypeMungers.iterator(); i.hasNext(); ) {
+ Object o = i.next();
+ if ( !(o instanceof BcelTypeMunger) ) {
+ throw new Error("should not happen or what ?");//FIXME AV ??was System.err.println("surprising: " + o);
+ //continue;
+ }
+ BcelTypeMunger munger = (BcelTypeMunger)o;
+ if (munger.matches(clazz.getType())) {
+ //FIXME AV - Andy must track change by this lateMunging only and deal with a reweavable thing
+ boolean typeMungerAffectedType = munger.munge(this);
+ if (typeMungerAffectedType) {
+ isChanged = true;
+ if (inReweavableMode) aspectsAffectingType.add(munger.getAspectType().getName());
+ }
+ }
+ }
+ }
+ // flush to save some memory - FIXME AV - extract in a better way ?
+ PerObjectInterfaceTypeMunger.unregisterFromAsAdvisedBy(clazz.getType());
+
// finally, if we changed, we add in the introduced methods.
if (isChanged) {
clazz.getOrCreateWeaverStateInfo();
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java b/weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java
index 3cedb9235..54bae2c9c 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java
@@ -124,6 +124,7 @@ public class BcelPerClauseAspectAdder extends BcelTypeMunger {
//we cannot return onType.equals(aspectType)
//since we need to eagerly create the nested ajcMighHaveAspect interface on LTW
return true;
+ //return aspectType.equals(onType);
}
private void generatePerClauseMembers(LazyClassGen classGen) {
@@ -218,6 +219,10 @@ public class BcelPerClauseAspectAdder extends BcelTypeMunger {
tryEnd.setTarget(il.getEnd());
// replace the original "return" with a "nop"
+ //TODO AV - a bit odd, looks like Bcel alters bytecode and has a IMPDEP1 in its representation
+ if (clinit.getBody().getEnd().getInstruction().getOpcode() == Constants.IMPDEP1) {
+ clinit.getBody().getEnd().getPrev().setInstruction(new NOP());
+ }
clinit.getBody().getEnd().setInstruction(new NOP());
clinit.getBody().append(il);
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
index 31af19713..ced005ed5 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
@@ -147,7 +147,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
return changed;
}
-
+
private String getShortname(String path) {
int takefrom = path.lastIndexOf('/');
if (takefrom == -1) {
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
index cfd23c4ec..c41201142 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
@@ -72,6 +72,7 @@ import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.WeaverMetrics;
import org.aspectj.weaver.WeaverStateInfo;
import org.aspectj.weaver.World;
+import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.patterns.AndPointcut;
import org.aspectj.weaver.patterns.BindingAnnotationTypePattern;
import org.aspectj.weaver.patterns.BindingTypePattern;
@@ -119,8 +120,9 @@ public class BcelWeaver implements IWeaver {
private boolean needToReweaveWorld = false;
private List shadowMungerList = null; // setup by prepareForWeave
- private List typeMungerList = null; // setup by prepareForWeave
- private List declareParentsList = null; // setup by prepareForWeave
+ private List typeMungerList = null; // setup by prepareForWeave
+ private List lateTypeMungerList = null; // setup by prepareForWeave
+ private List declareParentsList = null; // setup by prepareForWeave
private ZipOutputStream zipOutputStream;
@@ -426,6 +428,7 @@ public class BcelWeaver implements IWeaver {
shadowMungerList = xcutSet.getShadowMungers();
rewritePointcuts(shadowMungerList);
typeMungerList = xcutSet.getTypeMungers();
+ lateTypeMungerList = xcutSet.getLateTypeMungers();
declareParentsList = xcutSet.getDeclareParents();
// The ordering here used to be based on a string compare on toString() for the two mungers -
@@ -1004,7 +1007,7 @@ public class BcelWeaver implements IWeaver {
ShadowMunger element = (ShadowMunger) iter.next();
if (element instanceof BcelAdvice) { // This will stop us incorrectly reporting deow Checkers
BcelAdvice ba = (BcelAdvice)element;
- if (!ba.hasMatchedSomething()) {
+ if (!ba.hasMatchedSomething()) {
// Because we implement some features of AJ itself by creating our own kind of mungers, you sometimes
// find that ba.getSignature() is not a BcelMethod - for example it might be a cflow entry munger.
if (ba.getSignature()!=null) {
@@ -1356,7 +1359,7 @@ public class BcelWeaver implements IWeaver {
clazz = classType.getLazyClassGen();
//System.err.println("got lazy gen: " + clazz + ", " + clazz.getWeaverState());
try {
- boolean isChanged = BcelClassWeaver.weave(world, clazz, shadowMungers, typeMungers);
+ boolean isChanged = BcelClassWeaver.weave(world, clazz, shadowMungers, typeMungers, lateTypeMungerList);
if (isChanged) {
if (dump) dump(classFile, clazz);
return clazz;
diff --git a/weaver/src/org/aspectj/weaver/patterns/PerCflow.java b/weaver/src/org/aspectj/weaver/patterns/PerCflow.java
index 3d647c455..76a2fc345 100644
--- a/weaver/src/org/aspectj/weaver/patterns/PerCflow.java
+++ b/weaver/src/org/aspectj/weaver/patterns/PerCflow.java
@@ -100,14 +100,14 @@ public class PerCflow extends PerClause {
//ATAJ: add a munger to add the aspectOf(..) to the @AJ aspects
if (inAspect.isAnnotationStyleAspect()) {
- inAspect.crosscuttingMembers.addTypeMunger(
+ inAspect.crosscuttingMembers.addLateTypeMunger(
inAspect.getWorld().makePerClauseAspect(inAspect, getKind())
);
}
//ATAJ inline around advice support
if (Ajc5MemberMaker.isAnnotationStyleAspect(inAspect)) {
- inAspect.crosscuttingMembers.addTypeMunger(new BcelAccessForInlineMunger(inAspect));
+ inAspect.crosscuttingMembers.addLateTypeMunger(new BcelAccessForInlineMunger(inAspect));
}
return ret;
diff --git a/weaver/src/org/aspectj/weaver/patterns/PerFromSuper.java b/weaver/src/org/aspectj/weaver/patterns/PerFromSuper.java
index 87d6b61db..63131f5ad 100644
--- a/weaver/src/org/aspectj/weaver/patterns/PerFromSuper.java
+++ b/weaver/src/org/aspectj/weaver/patterns/PerFromSuper.java
@@ -72,7 +72,7 @@ public class PerFromSuper extends PerClause {
- private PerClause lookupConcretePerClause(ResolvedTypeX lookupType) {
+ public PerClause lookupConcretePerClause(ResolvedTypeX lookupType) {
PerClause ret = lookupType.getPerClause();
if (ret == null) return null;
if (ret instanceof PerFromSuper) {
diff --git a/weaver/src/org/aspectj/weaver/patterns/PerObject.java b/weaver/src/org/aspectj/weaver/patterns/PerObject.java
index 2374b8e2c..7e8645608 100644
--- a/weaver/src/org/aspectj/weaver/patterns/PerObject.java
+++ b/weaver/src/org/aspectj/weaver/patterns/PerObject.java
@@ -106,18 +106,18 @@ public class PerObject extends PerClause {
Advice.makePerObjectEntry(world, concreteEntry, isThis, inAspect));
ResolvedTypeMunger munger =
new PerObjectInterfaceTypeMunger(inAspect, concreteEntry);
- inAspect.crosscuttingMembers.addTypeMunger(world.concreteTypeMunger(munger, inAspect));
+ inAspect.crosscuttingMembers.addLateTypeMunger(world.concreteTypeMunger(munger, inAspect));
//ATAJ: add a munger to add the aspectOf(..) to the @AJ aspects
if (inAspect.isAnnotationStyleAspect()) {
- inAspect.crosscuttingMembers.addTypeMunger(
+ inAspect.crosscuttingMembers.addLateTypeMunger(
inAspect.getWorld().makePerClauseAspect(inAspect, getKind())
);
}
//ATAJ inline around advice support
if (Ajc5MemberMaker.isAnnotationStyleAspect(inAspect)) {
- inAspect.crosscuttingMembers.addTypeMunger(new BcelAccessForInlineMunger(inAspect));
+ inAspect.crosscuttingMembers.addLateTypeMunger(new BcelAccessForInlineMunger(inAspect));
}
return ret;
@@ -139,7 +139,11 @@ public class PerObject extends PerClause {
public PerClause.Kind getKind() {
return PEROBJECT;
}
-
+
+ public boolean isThis() {
+ return isThis;
+ }
+
public String toString() {
return "per" + (isThis ? "this" : "target") +
"(" + entry + ")";
diff --git a/weaver/src/org/aspectj/weaver/patterns/PerSingleton.java b/weaver/src/org/aspectj/weaver/patterns/PerSingleton.java
index 7c053e98d..ad780fc02 100644
--- a/weaver/src/org/aspectj/weaver/patterns/PerSingleton.java
+++ b/weaver/src/org/aspectj/weaver/patterns/PerSingleton.java
@@ -100,14 +100,14 @@ public class PerSingleton extends PerClause {
if (!inAspect.isAbstract() && Ajc5MemberMaker.isAnnotationStyleAspect(inAspect)) {
//TODO will those change be ok if we add a serializable aspect ?
// dig: "can't be Serializable/Cloneable unless -XserializableAspects"
- inAspect.crosscuttingMembers.addTypeMunger(
+ inAspect.crosscuttingMembers.addLateTypeMunger(
inAspect.getWorld().makePerClauseAspect(inAspect, getKind())
);
}
//ATAJ inline around advice support
if (Ajc5MemberMaker.isAnnotationStyleAspect(inAspect)) {
- inAspect.crosscuttingMembers.addTypeMunger(new BcelAccessForInlineMunger(inAspect));
+ inAspect.crosscuttingMembers.addLateTypeMunger(new BcelAccessForInlineMunger(inAspect));
}
return ret;
diff --git a/weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java b/weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java
index 157f10223..1971fa83b 100644
--- a/weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java
+++ b/weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java
@@ -150,14 +150,14 @@ public class PerTypeWithin extends PerClause {
//ATAJ: add a munger to add the aspectOf(..) to the @AJ aspects
if (inAspect.isAnnotationStyleAspect()) {
- inAspect.crosscuttingMembers.addTypeMunger(
+ inAspect.crosscuttingMembers.addLateTypeMunger(
inAspect.getWorld().makePerClauseAspect(inAspect, getKind())
);
}
//ATAJ inline around advice support
if (Ajc5MemberMaker.isAnnotationStyleAspect(inAspect)) {
- inAspect.crosscuttingMembers.addTypeMunger(new BcelAccessForInlineMunger(inAspect));
+ inAspect.crosscuttingMembers.addLateTypeMunger(new BcelAccessForInlineMunger(inAspect));
}
return ret;