Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

EachObjectNoThis.java 442B

1234567891011121314151617181920212223
  1. import org.aspectj.testing.Tester;
  2. public class EachObjectNoThis {
  3. public static void main(String[] args) {
  4. new C().foo();
  5. }
  6. }
  7. class C {
  8. public void foo() {
  9. }
  10. }
  11. aspect A /*of eachobject(!instanceof(Object))*/ {
  12. {
  13. // This doesn't appy
  14. //Tester.checkFailed("this aspect shouldn't exist");
  15. }
  16. before(): !target(Object) && call(* *(..)) {
  17. Tester.checkFailed("this aspect shouldn't exist");
  18. }
  19. }