You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

A.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package symbols;
  2. strictfp aspect A issingleton() {
  3. /** objects */
  4. pointcut instanceof_C(): this(C);
  5. pointcut hasaspect_A(): if(A.hasAspect());
  6. /** lexical extents */
  7. pointcut within_C(): within(C);
  8. pointcut withinall_C(): within(C+);
  9. pointcut withincode_C(): withincode(void C.*(..));
  10. /** control flow */
  11. pointcut cflow_C(): cflow(withincode_C());
  12. pointcut cflowtop_C(): cflow(withincode_C() && !cflowbelow(withincode_C()));
  13. /** methods and constructors */
  14. pointcut calls_C(): call(int C.*(..));
  15. pointcut receptions_C(): call(int C.*(..));
  16. pointcut executions_C(): execution(* C.*(..,float,..));
  17. //pointcut callsto_C(): callsto(call(void C.*()));
  18. /** exception handlers */
  19. pointcut handlers_Thr(): handler(java.lang.Throwable);
  20. pointcut handlers_Err(): handler(java.lang.Error);
  21. pointcut handlers_Exc(): handler(java.lang.Exception);
  22. pointcut handlers_Rt(): handler(java.lang.RuntimeException);
  23. /** fields */
  24. pointcut gets_f(): get(float C.*);
  25. pointcut sets_f(): set(float C.*);
  26. /** Advices */
  27. //before(): call(void C.*()) { }
  28. before(): this(C) && call(String Object.toString()) { }
  29. before(): execution(C.new()) { }
  30. after(): call(void C.*()) { }
  31. after() returning (int x): call(int C.*(..)) { }
  32. after() throwing (RuntimeException e): call(void C.MethV()) {
  33. throw new RuntimeException("test");
  34. }
  35. void around() : call(void C.MethV()) { proceed(); }
  36. /** Introductions */
  37. public double symbols.C.intrD;
  38. private void C.intrMethV() { intrD += 1; }
  39. }