summaryrefslogtreecommitdiffstats
path: root/weaver/src/org
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-08-30 11:39:52 +0000
committeracolyer <acolyer>2005-08-30 11:39:52 +0000
commita3ee66152903e1de3dce8cc30b2741dfdafb2614 (patch)
tree64612004fe3b7f671fc3b5b338eda9908fcb6d24 /weaver/src/org
parent2ec1f35b5c9f4374970fbe33f1be86dc615253ab (diff)
downloadaspectj-a3ee66152903e1de3dce8cc30b2741dfdafb2614.tar.gz
aspectj-a3ee66152903e1de3dce8cc30b2741dfdafb2614.zip
fix for pr108425, type parameter used in method of anonymous inner type.
Diffstat (limited to 'weaver/src/org')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelMethod.java3
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java12
2 files changed, 12 insertions, 3 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelMethod.java b/weaver/src/org/aspectj/weaver/bcel/BcelMethod.java
index e38b6fae8..89f6d67ea 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelMethod.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelMethod.java
@@ -272,8 +272,7 @@ final class BcelMethod extends ResolvedMemberImpl {
// generic method declaration
canBeParameterized = true;
}
- Signature.ClassSignature genericTypeSig = bcelObjectType.getGenericClassTypeSignature();
- Signature.FormalTypeParameter[] parentFormals = (genericTypeSig != null ? genericTypeSig.formalTypeParameters : new Signature.FormalTypeParameter[0]);
+ Signature.FormalTypeParameter[] parentFormals = bcelObjectType.getAllFormals();
Signature.FormalTypeParameter[] formals = new
Signature.FormalTypeParameter[parentFormals.length + mSig.formalTypeParameters.length];
// put method formal in front of type formals for overriding in lookup
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
index e8db048c6..3a791072b 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
@@ -501,13 +501,14 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
}
private boolean genericSignatureUnpacked = false;
+ private Signature.FormalTypeParameter[] formalsForResolution = null;
private void unpackGenericSignature() {
if (genericSignatureUnpacked) return;
genericSignatureUnpacked = true;
Signature.ClassSignature cSig = getGenericClassTypeSignature();
if (cSig != null) {
- Signature.FormalTypeParameter[] formalsForResolution = cSig.formalTypeParameters;
+ formalsForResolution = cSig.formalTypeParameters;
if (isNestedClass()) {
// we have to find any type variables from the outer type before proceeding with resolution.
Signature.FormalTypeParameter[] extraFormals = getFormalTypeParametersFromOuterClass();
@@ -545,6 +546,15 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
}
}
+ public Signature.FormalTypeParameter[] getAllFormals() {
+ unpackGenericSignature();
+ if (formalsForResolution == null) {
+ return new Signature.FormalTypeParameter[0];
+ } else {
+ return formalsForResolution;
+ }
+ }
+
private boolean isNestedClass() {
return javaClass.getClassName().indexOf('$') != -1;
}