From: aclement Date: Tue, 3 Aug 2004 14:53:38 +0000 (+0000) Subject: Some more fix for Bugzilla Bug 60015 X-Git-Tag: for_ajdt1_1_12~63 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ef7885fd1269261aec9cb1265f0e15472fdb03bb;p=aspectj.git Some more fix for Bugzilla Bug 60015 NPE, Incorrect XLint:unmatchedSuperTypeInCall warning --- 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 @@ + + + + + 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() {} } +} + diff --git a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java index 6154f07d8..4dda76c47 100644 --- a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java @@ -114,6 +114,11 @@ public class KindedPointcut extends Pointcut { exactDeclaringType.resolve(world))) { return; } + + // PR60015 - Don't report the warning if the declaring type is object and 'this' is an interface + if (exactDeclaringType.isInterface(world) && shadowDeclaringType.equals(world.resolve("java.lang.Object"))) { + return; + } SignaturePattern nonConfusingPattern = new SignaturePattern(