From: aclement Date: Tue, 13 Jan 2009 20:30:06 +0000 (+0000) Subject: 260384: Literal.FALSE and clone() X-Git-Tag: pre268419~224 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2a58fc63d699f4be27bd81a5512b079e923e498d;p=aspectj.git 260384: Literal.FALSE and clone() --- 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) {