From c4d2a21b1609ca7473dedce2d855815146cb017f Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 25 Apr 2006 07:29:29 +0000 Subject: [PATCH] test and another part of the fix for 137496 --- tests/bugs152/pr137496/H.java | 28 +++++++++++++++++++ .../systemtest/ajc152/Ajc152Tests.java | 1 + .../org/aspectj/systemtest/ajc152/ajc152.xml | 11 ++++++++ .../org/aspectj/weaver/bcel/BcelShadow.java | 6 +++- 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tests/bugs152/pr137496/H.java diff --git a/tests/bugs152/pr137496/H.java b/tests/bugs152/pr137496/H.java new file mode 100644 index 000000000..b0c3dd6c5 --- /dev/null +++ b/tests/bugs152/pr137496/H.java @@ -0,0 +1,28 @@ +interface P { + public T pm(T t); +// public String pm2(String t); +} + +interface C extends P { + public void cm(); +} + +class CImpl implements C { + public void cm() {} + public String pm(String s) { System.err.println(s);return s;} +// public String pm2(String s) { return s;} +} + +public class H { + + public static void main(String []argv) { + C test = new CImpl(); + test.pm("foo"); // manifests as 'Object pm(Object) call' due to type C being used +// test.pm2("foo"); + } +} + +aspect X { + Object around(): call(* pm(..)) { System.err.println("advice"); return null;} +// before(): call(* pm2(..)) {} +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java index 87a912be1..4f33cca93 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -27,6 +27,7 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testPointcutsAndGenerics_pr137496_3() { runTest("pointcuts and generics - E");} public void testPointcutsAndGenerics_pr137496_4() { runTest("pointcuts and generics - F");} public void testPointcutsAndGenerics_pr137496_5() { runTest("pointcuts and generics - G");} + public void testPointcutsAndGenerics_pr137496_6() { runTest("pointcuts and generics - H");} public void testAspectLibrariesAndASM_pr135001() { runTest("aspect libraries and asm");} public void testStackOverflow_pr136258() { runTest("stack overflow");} public void testIncorrectOverridesEvaluation13() { runTest("incorrect overrides evaluation - 1.3"); } diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml index cc57b9562..cb7cd1fe1 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml +++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml @@ -119,6 +119,17 @@ + + + + + + + + + + + diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index 21cfb1b27..b201b039c 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -3179,7 +3179,11 @@ public class BcelShadow extends Shadow { if (getKind() == PreInitialization) { returnType = UnresolvedType.OBJECTARRAY; } else { - returnType = getReturnType(); + + if (getKind() == ConstructorCall) returnType = getSignature().getDeclaringType(); + else if (getKind() == FieldSet) returnType = ResolvedType.VOID; + else returnType = getSignature().getReturnType().resolve(world); +// returnType = getReturnType(); // for this and above lines, see pr137496 } return new LazyMethodGen( -- 2.39.5