From 181c8751fdba860cf269c619937888007a370cd5 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 4 Jul 2005 14:58:21 +0000 Subject: [PATCH] generics: implementation of getDeclaredGenericSignature() --- .../compiler/lookup/EclipseSourceType.java | 5 ++++- .../org/aspectj/weaver/bcel/BcelObjectType.java | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java index 9f4ba9574..441212a73 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java @@ -450,5 +450,8 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { public boolean doesNotExposeShadowMungers() { return true; } - + + public String getDeclaredGenericSignature() { + return CharOperation.charToString(binding.genericSignature()); + } } diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java index b95e66ba6..3a3cdc2f0 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java @@ -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?"); + } } -- 2.39.5