From 2a58fc63d699f4be27bd81a5512b079e923e498d Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 13 Jan 2009 20:30:06 +0000 Subject: [PATCH] 260384: Literal.FALSE and clone() --- weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java index 25a20746b..72e24c1ea 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java @@ -41,6 +41,7 @@ import org.aspectj.weaver.ShadowMunger; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.WeaverMessages; import org.aspectj.weaver.World; +import org.aspectj.weaver.Shadow.Kind; import org.aspectj.weaver.ast.Literal; import org.aspectj.weaver.ast.Test; import org.aspectj.weaver.patterns.ExactTypePattern; @@ -264,7 +265,14 @@ class BcelAdvice extends Advice { // PerObjectInterfaceTypeMunger.registerAsAdvisedBy(s.getTargetVar().getType(), getConcreteAspect()); // } // } - + if (pointcutTest == Literal.FALSE) { // not usually allowed, except in one case (260384) + Member sig = shadow.getSignature(); + if (sig.getArity() == 0 && shadow.getKind() == Shadow.MethodCall && sig.getName().charAt(0) == 'c' + && sig.getReturnType().equals(ResolvedType.OBJECT) && sig.getName().equals("clone")) { + return false; + } + } + if (getKind() == AdviceKind.Before) { shadow.weaveBefore(this); } else if (getKind() == AdviceKind.AfterReturning) { -- 2.39.5