]> source.dussan.org Git - aspectj.git/commitdiff
fix for pr108425, type parameter used in method of anonymous inner type.
authoracolyer <acolyer>
Tue, 30 Aug 2005 11:39:52 +0000 (11:39 +0000)
committeracolyer <acolyer>
Tue, 30 Aug 2005 11:39:52 +0000 (11:39 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelMethod.java
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java

index e38b6fae8e1b0e2367f9174a262af31aaeecf65a..89f6d67eae307fd8b21a8aeaeddb83abb52a95fb 100644 (file)
@@ -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
index e8db048c60f8eba18ea0cd64376f26ec3f3ec802..3a791072b4f98f339bbc45fc520e7a5ddaedc4e0 100644 (file)
@@ -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;
        }