From 369de870280d4ae4f1e984a7bd8a76affb4ed0a2 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 6 Jul 2006 12:12:07 +0000 Subject: [PATCH] test and fix for 148409 --- tests/bugs153/pr148409/Blurgh.java | 27 +++++++++++++++++++ tests/bugs153/pr148409/X.java | 4 +++ tests/bugs153/pr148409/aop.xml | 5 ++++ .../systemtest/ajc153/Ajc153Tests.java | 5 ++-- .../org/aspectj/systemtest/ajc153/ajc153.xml | 6 +++++ .../org/aspectj/weaver/UnresolvedType.java | 13 +++++++-- 6 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 tests/bugs153/pr148409/Blurgh.java create mode 100644 tests/bugs153/pr148409/X.java create mode 100644 tests/bugs153/pr148409/aop.xml diff --git a/tests/bugs153/pr148409/Blurgh.java b/tests/bugs153/pr148409/Blurgh.java new file mode 100644 index 000000000..b44c0a9b6 --- /dev/null +++ b/tests/bugs153/pr148409/Blurgh.java @@ -0,0 +1,27 @@ + + +interface SecurityEntity {} +class Goo {} +interface Base {} +interface Hoo { public void m(X x);} + +class Foo extends Goo implements Hoo { + + public void m(B b) { + } +} + + +interface Interface1 extends Base {} + +class Impl1 implements Interface1 {} + + + + +public class Blurgh { + public static void main(String []argv) { + new Foo(); + } +} + diff --git a/tests/bugs153/pr148409/X.java b/tests/bugs153/pr148409/X.java new file mode 100644 index 000000000..7011b8b0c --- /dev/null +++ b/tests/bugs153/pr148409/X.java @@ -0,0 +1,4 @@ +aspect X { + before(): staticinitialization(Fo*) { } + before(): call(Fo*.new(..)) { } +} diff --git a/tests/bugs153/pr148409/aop.xml b/tests/bugs153/pr148409/aop.xml new file mode 100644 index 000000000..a0dd0df7b --- /dev/null +++ b/tests/bugs153/pr148409/aop.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java index 8d0a2f602..6c3b5b0b4 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java @@ -33,8 +33,9 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testVerifyErrNoTypeCflowField_pr145693_1() { runTest("verifyErrNoTypeCflowField"); } public void testVerifyErrInpathNoTypeCflowField_pr145693_2() { runTest("verifyErrInpathNoTypeCflowField"); } public void testCpathNoTypeCflowField_pr145693_3() { runTest("cpathNoTypeCflowField"); } - //public void testVisibilityProblem_pr149071() { runTest("visibility problem");} - //public void testAdviceNotWovenAspectPath_pr147841() { runTest("advice not woven on aspectpath");} + // public void testVisibilityProblem_pr149071() { runTest("visibility problem");} + // public void testAdviceNotWovenAspectPath_pr147841() { runTest("advice not woven on aspectpath");} + public void testGenericSignatures_pr148409() { runTest("generic signature problem"); } ///////////////////////////////////////// public static Test suite() { diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml index 5954001c6..30c4a1a8a 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml @@ -75,6 +75,12 @@ + + + + + + diff --git a/weaver/src/org/aspectj/weaver/UnresolvedType.java b/weaver/src/org/aspectj/weaver/UnresolvedType.java index 328acdaf7..49834e148 100644 --- a/weaver/src/org/aspectj/weaver/UnresolvedType.java +++ b/weaver/src/org/aspectj/weaver/UnresolvedType.java @@ -346,8 +346,17 @@ public class UnresolvedType implements TypeVariableDeclaringElement { ret.typeVariables = new TypeVariable[ftps.length]; for (int i = 0; i < ftps.length; i++) { Signature.FormalTypeParameter parameter = ftps[i]; - Signature.ClassTypeSignature cts = (Signature.ClassTypeSignature)parameter.classBound; - ret.typeVariables[i]=new TypeVariable(ftps[i].identifier,UnresolvedType.forSignature(cts.outerType.identifier+";")); + if (parameter.classBound instanceof Signature.ClassTypeSignature) { + Signature.ClassTypeSignature cts = (Signature.ClassTypeSignature)parameter.classBound; + ret.typeVariables[i]=new TypeVariable(ftps[i].identifier,UnresolvedType.forSignature(cts.outerType.identifier+";")); + } else if (parameter.classBound instanceof Signature.TypeVariableSignature) { + Signature.TypeVariableSignature tvs = (Signature.TypeVariableSignature)parameter.classBound; + UnresolvedTypeVariableReferenceType utvrt = new UnresolvedTypeVariableReferenceType(new TypeVariable(tvs.typeVariableName)); + ret.typeVariables[i]=new TypeVariable(ftps[i].identifier,utvrt); + } else { + throw new BCException("UnresolvedType.forGenericTypeSignature(): Do not know how to process type variable bound of type '"+ + parameter.classBound.getClass()+"'. Full signature is '"+sig+"'"); + } } ret.signatureErasure = sig; ret.signature = ret.signatureErasure; -- 2.39.5