Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

TestMatchingCtors.aj 3.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Each pointcut should match as specified the methods that immediately follow it
  2. aspect TestMatching {
  3. before(): execution(C001*.new(@Anno1 *)) {}
  4. static class C001a { C001a(AnnotatedWithAnno1 p) {} } // yes
  5. before(): execution(C002*.new(@Anno1 (*))) {}
  6. static class C002a { C002a(@Anno1 String p) {} } // yes
  7. static class C002b { C002b(Integer p) {} } // no
  8. before(): execution(C003*.new(@Anno2 (*))) {}
  9. static class C003a { C003a(@Anno2 String p) {} } // yes
  10. static class C003b { C003b(@Anno1 String p) {} } // no
  11. static class C003c { C003c(Integer p) {} } // no
  12. before(): execution(C004*.new(@Anno1 (@Anno2 *))) {}
  13. static class C004a { C004a(@Anno1 AnnotatedWithAnno2 p) {} } // yes
  14. static class C004b { C004b(@Anno2 String p) {} } // no
  15. static class C004c { C004c(@Anno1 String p) {} } // no
  16. static class C004d { C004d(Integer p) {} } // no
  17. before(): execution(C005*.new(@Anno1 *,@Anno2 *)) {}
  18. static class C005a { C005a(AnnotatedWithAnno1 p,AnnotatedWithAnno2 q) {} } // yes
  19. static class C005b { C005b(AnnotatedWithAnno1 p,@Anno2 String q) {} } // no
  20. static class C005c { C005c(String p,AnnotatedWithAnno2 q) {} } // no
  21. before(): execution(C006*.new(@Anno1 (*),@Anno2 (*))) {}
  22. static class C006a { C006a(@Anno1 String p,@Anno2 String q) {} } // yes
  23. static class C006b { C006b(AnnotatedWithAnno1 p,@Anno2 String q) {} } // no
  24. static class C006c { C006c(String p,AnnotatedWithAnno2 q) {} } // no
  25. static class C006d { C006d(AnnotatedWithAnno1 p,AnnotatedWithAnno2 q) {} } // no
  26. static class C006e { C006e(@Anno1 @Anno2 String p,@Anno1 @Anno2 String q) {} } // yes
  27. before(): execution(C007*.new(@Anno1 (@Anno2 *))) {}
  28. static class C007a { C007a(@Anno1 AnnotatedWithAnno2 p) {} } // yes
  29. static class C007b { C007b(@Anno1 String p) {} } // no
  30. static class C007c { C007c(AnnotatedWithAnno2 p) {} } // no
  31. static class C007d { C007d(@Anno1 AnnotatedWithAnno1 p) {} } // no
  32. before(): execution(C008*.new(@Anno1 (*),..,@Anno2 (*))) {}
  33. static class C008a { C008a(@Anno1 String p,Integer q,@Anno2 String r) {} } // yes
  34. static class C008b { C008b(@Anno1 String p,@Anno2 String r) {} } // yes
  35. static class C008c { C008c(@Anno1 String p,Integer q,String r,@Anno2 String s) {} } // yes
  36. static class C008d { C008d(@Anno1 String p,Integer q,String r,@Anno2 String s,String t) {} } // no
  37. static class C008e { C008e(String p,Integer q,String r,@Anno2 String s) {} } // no
  38. before(): execution(C009*.new(@Anno1 (*),..,@Anno2 *)) {}
  39. static class C009a { C009a(@Anno1 String p, Integer q,AnnotatedWithAnno2 r) {} } // yes
  40. static class C009b { C009b(@Anno1 String p, Integer q,@Anno2 AnnotatedWithAnno2 r) {} } // yes
  41. static class C009c { C009c(@Anno1 String p, Integer q,@Anno2 Integer r) {} } // no
  42. static class C009d { C009d(String p, Integer q,@Anno2 Integer r) {} } // no
  43. before(): execution(C010*.new(..,@Anno1 (*))) {}
  44. static class C010a { C010a(@Anno1 String p,@Anno1 String q) {} } // yes
  45. static class C010b { C010b(String p,@Anno1 String q) {} } // yes
  46. static class C010c { C010c(@Anno1 String p,String q) {} } // no
  47. before(): execution(C011*.new(@Anno1 *...)) {}
  48. static class C011a { C011a(AnnotatedWithAnno1... p) {} } // no (the array is not annotated)
  49. static class C011b { C011b(@Anno1 String... p) {} } // no
  50. before(): execution(C012*.new(@Anno1 (*...))) {}
  51. static class C012a { C012a(@Anno1 String... p) {} } // yes
  52. static class C012b { C012b(AnnotatedWithAnno1... p) {} } // no
  53. }