From 60efccceb5bb8e517570eb442f7b2c0152925c82 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 14 Jun 2005 14:56:23 +0000 Subject: [PATCH] Fix for 99089: [generics][itds] ArrayIndexOutOfBoundsException - Generics in privileged aspects. Correct handling for parameterized signatures. --- weaver/src/org/aspectj/weaver/AjcMemberMaker.java | 3 +-- weaver/src/org/aspectj/weaver/Member.java | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/AjcMemberMaker.java b/weaver/src/org/aspectj/weaver/AjcMemberMaker.java index a80e7e3a7..113c2e505 100644 --- a/weaver/src/org/aspectj/weaver/AjcMemberMaker.java +++ b/weaver/src/org/aspectj/weaver/AjcMemberMaker.java @@ -283,8 +283,7 @@ public class AjcMemberMaker { // -- privileged accessors public static ResolvedMember privilegedAccessMethodForMethod(TypeX aspectType, ResolvedMember method) { - String sig; - sig = method.getSignature(); + String sig = method.getDeclaredSignature(); return new ResolvedMember(Member.METHOD, method.getDeclaringType(), Modifier.PUBLIC | (method.isStatic() ? Modifier.STATIC : 0), diff --git a/weaver/src/org/aspectj/weaver/Member.java b/weaver/src/org/aspectj/weaver/Member.java index 37aab9dc6..29f439203 100644 --- a/weaver/src/org/aspectj/weaver/Member.java +++ b/weaver/src/org/aspectj/weaver/Member.java @@ -56,6 +56,7 @@ public class Member implements Comparable, AnnotatedElement { Object[] returnAndParams = signatureToTypes(signature,false); this.returnType = (TypeX) returnAndParams[0]; this.parameterTypes = (TypeX[]) returnAndParams[1]; + signature = typesToSignature(returnType,parameterTypes,true); } } @@ -75,10 +76,10 @@ public class Member implements Comparable, AnnotatedElement { this.name = name; this.parameterTypes = parameterTypes; if (kind == FIELD) { - this.signature = returnType.getRawTypeSignature(); + this.signature = returnType.getRawTypeSignature(); this.declaredSignature = returnType.getSignature(); } else { - this.signature = typesToSignature(returnType, parameterTypes,true); + this.signature = typesToSignature(returnType, parameterTypes,true); this.declaredSignature = typesToSignature(returnType,parameterTypes,false); } } @@ -111,7 +112,8 @@ public class Member implements Comparable, AnnotatedElement { else buf.append(paramTypes[i].getSignature()); } buf.append(")"); - buf.append(returnType.getSignature()); + if (returnType.isParameterized() && useRawTypes) buf.append(returnType.getRawTypeSignature()); + else buf.append(returnType.getSignature()); return buf.toString(); } -- 2.39.5