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.

PR590a.java 924B

12345678910111213141516171819202122232425262728293031323334353637
  1. import org.aspectj.testing.Tester;
  2. public class PR590a {
  3. public static void main (String args []) {
  4. staticMethod ();
  5. new PR590a().instanceMethod("bar");
  6. }
  7. public static String staticMethod () {
  8. return null;
  9. }
  10. public String instanceMethod(String a) {
  11. return "foo";
  12. }
  13. }
  14. aspect A {
  15. static Object fieldX = Boolean.TRUE;
  16. //static Object Integer = Boolean.TRUE; // just to screw with you
  17. pointcut pc(Object s): call(!static String PR590a.*(..)) && args(s);
  18. before(): target(Byte) { } //sanity check
  19. //before(): target(BlurghXXX) { } //sanity check, warning in -Xlint
  20. after () returning (Object s): pc(s) {} //ERR CE 29
  21. after () throwing (Object e): pc(e) {} //ERR CE 31
  22. // before(): target(fieldX) { } //ERR, but not handled yet
  23. //before(): target(Integer) { } //ERR -- finds field rather than type, but not handled yet
  24. }