選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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. }