diff options
author | wisberg <wisberg> | 2004-01-09 07:27:47 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2004-01-09 07:27:47 +0000 |
commit | d131f0ebb3a73897e3d8fde263aad11a4ba88d47 (patch) | |
tree | 4f490cd877492fd15ed49d825ad0458d340a6731 /tests/bugs/DeclaringTypeWarning.java | |
parent | de570fcef14299ec316be22aaf4885fcbc1f48c2 (diff) | |
download | aspectj-d131f0ebb3a73897e3d8fde263aad11a4ba88d47.tar.gz aspectj-d131f0ebb3a73897e3d8fde263aad11a4ba88d47.zip |
added comments
Diffstat (limited to 'tests/bugs/DeclaringTypeWarning.java')
-rw-r--r-- | tests/bugs/DeclaringTypeWarning.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/bugs/DeclaringTypeWarning.java b/tests/bugs/DeclaringTypeWarning.java index d61e1fbe5..272404162 100644 --- a/tests/bugs/DeclaringTypeWarning.java +++ b/tests/bugs/DeclaringTypeWarning.java @@ -2,22 +2,26 @@ class A { void run() {} } class B extends A {} aspect C { - before() : runB() { } // warn here - pointcut runB(): call(void B.run()); - before() : call(int B.run()) {} + before() : runB() { } + pointcut runB(): call(void B.run()); // CW 6 XLint, for each shadow (12, 14) + before() : call(int B.run()) {} // pointcut not matched } public class DeclaringTypeWarning { public static void main(String[] args) { // ok with -1.4; otherwise, becomes A.run in bytecode - new B().run(); + new B().run(); // CW 12 DW // never works - compile-time type of reference is A, not B ((A) new B()).run(); } } aspect D { - declare error : call(void B.run()) : // warn here - "This should be the only error"; + // produces CW 12 DW only under 1.4 (correct method signature) + declare warning : call(void B.run()) : // no XLint warning here (?) + "declare warning : call(void B.run())"; - declare error : call(int B.run()) : - "This error should not happen"; + // should never produce a warning + declare warning : call(int B.run()) : + "declare warning : call(int B.run())"; } + +/** @testcase PR#41952 XLint when call declaring type is not defining type */ |