From 5bcf8fadcc2dd607a27e33004a691dc35d983b9d Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 20 Dec 2004 14:46:11 +0000 Subject: [PATCH] Hopefully fixes disappearance of decsofts in AJDT. The addition of the offset to the source location caused problems because a declare soft was being assigned 2 diff offsets in different parts of the weaver. First source location was the offset of the 'declare', second location was the offset for the declares pointcut expression. Now resolved so offset is always position of the 'declare'. --- weaver/src/org/aspectj/weaver/Advice.java | 6 +++--- weaver/src/org/aspectj/weaver/CrosscuttingMembers.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/Advice.java b/weaver/src/org/aspectj/weaver/Advice.java index bafbb3ef5..1c8c92b98 100644 --- a/weaver/src/org/aspectj/weaver/Advice.java +++ b/weaver/src/org/aspectj/weaver/Advice.java @@ -17,6 +17,7 @@ import java.util.Collections; import java.util.List; import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.ISourceLocation; import org.aspectj.weaver.patterns.AndPointcut; import org.aspectj.weaver.patterns.PerClause; import org.aspectj.weaver.patterns.Pointcut; @@ -67,9 +68,8 @@ public abstract class Advice extends ShadowMunger { return ret; } - public static Advice makeSoftener(World world, Pointcut entry, TypePattern exceptionType,ResolvedTypeX inAspect) { - Advice ret = world.concreteAdvice(AdviceKind.Softener, - entry, null, 0, entry); + public static Advice makeSoftener(World world, Pointcut entry, TypePattern exceptionType,ResolvedTypeX inAspect,IHasSourceLocation loc) { + Advice ret = world.concreteAdvice(AdviceKind.Softener, entry, null, 0, loc); ret.exceptionType = exceptionType; ret.concreteAspect = inAspect; diff --git a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java index 62ba60412..0685ef0be 100644 --- a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java +++ b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java @@ -109,7 +109,7 @@ public class CrosscuttingMembers { } else if (declare instanceof DeclareSoft) { DeclareSoft d = (DeclareSoft)declare; // Ordered so that during concretization we can check the related munger - ShadowMunger m = Advice.makeSoftener(world, d.getPointcut(), d.getException(),inAspect); + ShadowMunger m = Advice.makeSoftener(world, d.getPointcut(), d.getException(),inAspect,d); Pointcut concretePointcut = d.getPointcut().concretize(inAspect, 0,m); m.pointcut = concretePointcut; declareSofts.add(new DeclareSoft(d.getException(), concretePointcut)); -- 2.39.5