From 85af57c52f16fb27506ed109681a7098ae73b197 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 2 May 2008 02:20:22 +0000 Subject: [PATCH] 229910 - dont generate bad code for around advice on fieldset for an inherited field --- weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index 86c3ab39f..800097b32 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -3460,12 +3460,12 @@ public class BcelShadow extends Shadow { if (targetVar != null && targetVar != thisVar) { UnresolvedType targetType = getTargetType(); targetType = ensureTargetTypeIsCorrect(targetType); - // see pr109728 - this fixes the case when the declaring class is sometype 'X' but the getfield + // see pr109728,pr229910 - this fixes the case when the declaring class is sometype 'X' but the (gs)etfield // in the bytecode refers to a subtype of 'X'. This makes sure we use the type originally // mentioned in the fieldget instruction as the method parameter and *not* the type upon which the // field is declared because when the instructions are extracted into the new around body, // they will still refer to the subtype. - if (getKind()==FieldGet && getActualTargetType()!=null && + if ((getKind()==FieldGet || getKind()==FieldSet) && getActualTargetType()!=null && !getActualTargetType().equals(targetType.getName())) { targetType = UnresolvedType.forName(getActualTargetType()).resolve(world); } -- 2.39.5