選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

DeclareWarningMain.java 496B

12345678910111213141516171819
  1. import org.aspectj.testing.*;
  2. public class DeclareWarningMain {
  3. public static void main (String[] args) { // DW 4 main
  4. Tester.checkAllEvents();
  5. }
  6. static {
  7. Tester.expectEvent("before");
  8. }
  9. }
  10. aspect Warnings {
  11. declare warning : execution(static void main(String[])) : "main"; // for DW 4 main
  12. // just to show that pointcut is valid - works if warning removed
  13. before() : execution(static void main(String[])) {
  14. Tester.event("before");
  15. }
  16. }