From bcf8d044c05fb716e1161abddd18da04d2fc2364 Mon Sep 17 00:00:00 2001 From: mkersten Date: Fri, 25 Jul 2003 12:39:49 +0000 Subject: [PATCH] Added BCEL API rule for enforcing use of Utility.copyInstruction method in order to work around a BCEL Instruction.copy bug. --- .../ajsrc/org/aspectj/weaver/BcelApiRules.aj | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj diff --git a/weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj b/weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj new file mode 100644 index 000000000..515227107 --- /dev/null +++ b/weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj @@ -0,0 +1,24 @@ + +package org.aspectj.weaver; + +import org.aspectj.weaver.*; +import org.aspectj.weaver.bcel.*; +import org.apache.bcel.generic.*; + +/** + * Enforces the use of BCEL API use. + */ +public aspect BcelApiRules { + + /** + * The Utility method needs to be used instead of the BCEL method doue to a bug + * in the implementation of Instruction.copy() + */ + declare error: + call(* Instruction.copy()) && within(org.aspectj.weaver..*) + && !withincode(* Utility.copyInstruction(Instruction)): + "use Utility.copyInstruction to work-around bug in Select.copy()"; + + +} + \ No newline at end of file -- 2.39.5