]> source.dussan.org Git - aspectj.git/commitdiff
Added BCEL API rule for enforcing use of Utility.copyInstruction method in order...
authormkersten <mkersten>
Fri, 25 Jul 2003 12:39:49 +0000 (12:39 +0000)
committermkersten <mkersten>
Fri, 25 Jul 2003 12:39:49 +0000 (12:39 +0000)
weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj [new file with mode: 0644]

diff --git a/weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj b/weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj
new file mode 100644 (file)
index 0000000..5152271
--- /dev/null
@@ -0,0 +1,24 @@
+\r
+package org.aspectj.weaver;\r
+\r
+import org.aspectj.weaver.*;\r
+import org.aspectj.weaver.bcel.*;\r
+import org.apache.bcel.generic.*;\r
+\r
+/**\r
+ * Enforces the use of BCEL API use.\r
+ */\r
+public aspect BcelApiRules {\r
+       \r
+       /**\r
+        * The Utility method needs to be used instead of the BCEL method doue to a bug\r
+        * in the implementation of Instruction.copy()\r
+        */\r
+       declare error:\r
+               call(* Instruction.copy()) && within(org.aspectj.weaver..*)\r
+                        && !withincode(* Utility.copyInstruction(Instruction)):\r
+               "use Utility.copyInstruction to work-around bug in Select.copy()";\r
+\r
+\r
+}\r
+   
\ No newline at end of file