]> source.dussan.org Git - aspectj.git/commitdiff
generics: implementation of getDeclaredGenericSignature()
authoraclement <aclement>
Mon, 4 Jul 2005 14:58:21 +0000 (14:58 +0000)
committeraclement <aclement>
Mon, 4 Jul 2005 14:58:21 +0000 (14:58 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java

index 9f4ba9574657a25eae354d21faf3d75c7d83aa94..441212a73bcd78caaf67a2fa91ba715db8ffcade 100644 (file)
@@ -450,5 +450,8 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
        public boolean doesNotExposeShadowMungers() {
                return true;
        }
-
+       
+       public String getDeclaredGenericSignature() {
+               return CharOperation.charToString(binding.genericSignature());
+       }
 }
index b95e66ba6b08868a1c64ca1addaf1988a123156a..3a3cdc2f06709b86fec0f4ced4310c182fd34fea 100644 (file)
@@ -21,9 +21,11 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
+import org.aspectj.apache.bcel.classfile.Attribute;
 import org.aspectj.apache.bcel.classfile.Field;
 import org.aspectj.apache.bcel.classfile.JavaClass;
 import org.aspectj.apache.bcel.classfile.Method;
+import org.aspectj.apache.bcel.classfile.Signature;
 import org.aspectj.apache.bcel.classfile.annotation.Annotation;
 import org.aspectj.apache.bcel.classfile.annotation.ElementNameValuePair;
 import org.aspectj.apache.bcel.classfile.annotation.ElementValue;
@@ -74,6 +76,9 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
     private boolean isAnnotationStyleAspect = false;// set upon construction
        private boolean isCodeStyleAspect = false; // not redundant with field above!
 
+//  TODO asc need soon but not just yet...
+//     private boolean discoveredDeclaredSignature = false;
+//     private String declaredSignature = null;
 
        public Collection getTypeMungers() {
                return typeMungers;     
@@ -449,6 +454,16 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                ensureAnnotationTypesRetrieved();
                return annotations;
        }
+
+
+       public String getDeclaredGenericSignature() {
+               Attribute[] as = javaClass.getAttributes();
+               for (int i = 0; i < as.length; i++) {
+                       Attribute attribute = as[i];
+                       if (attribute instanceof Signature) return ((Signature)attribute).getSignature();
+               }
+               throw new RuntimeException("Should not have been asked for the signature?");
+       }
 }