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.

GenericClassInAdvice.java 1.1KB

123456789101112131415161718192021222324252627282930
  1. // priviligedness of aspect contributes to the error
  2. //public aspect GenericClassInAdvice { // comment out this line and comment the
  3. // following to be able to compile...
  4. privileged aspect GenericClassInAdvice {
  5. Object around(final SomeInterface src, final SomeInterface dst) : call(!void *.*(..)) && this(src) && target(dst) {
  6. // the parameterized constructor contributes to the error
  7. // final PayloadClass<Object> payloadClass = new PayloadClass/*<Object>*/() {
  8. // comment out this line and comment the following to be able to compile...
  9. final PayloadClass<Object> payloadClass = new PayloadClass<Object>() {
  10. public void run() {
  11. // this triggers a compiler error in combination with:
  12. // * privilegedness of the aspect "privileged aspect ..."
  13. // * parameterized constructor "new PayloadClass<Object>() {...}'
  14. // * the existence of a payload field in PayloadClass
  15. Object payload = proceed(src,dst); // comment this line and the following or rename 'payload' to 'pl' to be able to compile...
  16. this.setPayload(payload);
  17. }
  18. };
  19. payloadClass.run();
  20. return payloadClass.getPayload();
  21. }
  22. }