diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ajcTests.xml | 6 | ||||
-rw-r--r-- | tests/bugs/IncorrectXlintOnInterface.java | 29 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index e7031e59c..0a5613266 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -7840,4 +7840,10 @@ <message kind="warning" line="11" text="In String ctor"/> </compile> </ajc-test> + + <ajc-test dir="bugs" pr="60015" + title="NPE, Incorrect XLint:unmatchedSuperTypeInCall warning"> + <compile files="IncorrectXlintOnInterface.java"> + </compile> + </ajc-test> </suite> diff --git a/tests/bugs/IncorrectXlintOnInterface.java b/tests/bugs/IncorrectXlintOnInterface.java new file mode 100644 index 000000000..5ab34a717 --- /dev/null +++ b/tests/bugs/IncorrectXlintOnInterface.java @@ -0,0 +1,29 @@ +interface ILib { void run(); } + +class UnmatchedCallSupertype implements ILib { + public static void main(String[] args) { + new UnmatchedCallSupertype().run(); + } + public void run() { + System.err.println(this.toString()); + System.err.println(this.toString()); + System.err.println(this.toString()); + System.err.println(this.toString()); + } +} + +aspect X { + + pointcut runCall() : call(* ILib.*(..)); + pointcut monitor() : call(String clone(String)) || runCall(); + + before() : monitor() { + System.err.println(thisJoinPointStaticPart.getSignature().getDeclaringType().getName()); + } +} + +class Client { + public static void main(String[] args) { new Lib().run(); } + static class Lib implements ILib { public void run() {} } +} + |