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.

CompoundMessage.java 470B

12345678910111213141516
  1. class A { void run() {} }
  2. class B extends A {}
  3. aspect C {
  4. before() : runB() { }
  5. pointcut runB(): call(void B.run()); // CW 6 XLint, for each shadow (12, 14)
  6. }
  7. public class CompoundMessage {
  8. public static void main(String[] args) {
  9. // ok with -1.4; otherwise, becomes A.run in bytecode
  10. new B().run(); // CW 12 DW
  11. // never works - compile-time type of reference is A, not B
  12. new B().run(); // CW 12 DW
  13. }
  14. }