Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

GenericPerTypeWithin.java 478B

123456789101112131415161718192021222324
  1. package bugs;
  2. public class GenericPerTypeWithin {
  3. public static void main(String[] args) {
  4. new C();
  5. }
  6. }
  7. class C {
  8. C() {}
  9. }
  10. class B {
  11. B() {}
  12. }
  13. abstract aspect Singleton<Target> pertypewithin(Target) {
  14. pointcut creation() : execution(Target+.new()) ;
  15. pointcut creationOfAnything(): execution(*.new());
  16. before() : creation() { }
  17. before() : creationOfAnything() {} // should not match B.new() because of the ptw
  18. }
  19. aspect A extends Singleton<C> {}