aboutsummaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
authoraclement <aclement>2009-03-24 01:53:51 +0000
committeraclement <aclement>2009-03-24 01:53:51 +0000
commit78decedeb5b689a9f2ec1bad7a813b2108c0f845 (patch)
tree4b5130d0ba93018b0c723f4dd8ea211d8b187208 /asm
parent2785ffac057a7e7ab13c2f314182543d96a6b692 (diff)
downloadaspectj-78decedeb5b689a9f2ec1bad7a813b2108c0f845.tar.gz
aspectj-78decedeb5b689a9f2ec1bad7a813b2108c0f845.zip
265993: more jdt like handles
Diffstat (limited to 'asm')
-rw-r--r--asm/src/org/aspectj/asm/IProgramElement.java8
-rw-r--r--asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java19
-rw-r--r--asm/src/org/aspectj/asm/internal/ProgramElement.java23
3 files changed, 39 insertions, 11 deletions
diff --git a/asm/src/org/aspectj/asm/IProgramElement.java b/asm/src/org/aspectj/asm/IProgramElement.java
index 18ec29132..f13759b12 100644
--- a/asm/src/org/aspectj/asm/IProgramElement.java
+++ b/asm/src/org/aspectj/asm/IProgramElement.java
@@ -158,7 +158,9 @@ public interface IProgramElement extends Serializable {
public List getParameterSignatures();
- public void setParameterSignatures(List list);
+ public List getParameterSignaturesSourceRefs();
+
+ public void setParameterSignatures(List list, List paramSourceRefs);
public List getParameterTypes();
@@ -320,7 +322,8 @@ public interface IProgramElement extends Serializable {
INTERFACE, ASPECT, ENUM, ENUM_VALUE, ANNOTATION, INITIALIZER, INTER_TYPE_FIELD, INTER_TYPE_METHOD,
INTER_TYPE_CONSTRUCTOR, INTER_TYPE_PARENT, CONSTRUCTOR, METHOD, FIELD, POINTCUT, ADVICE, DECLARE_PARENTS,
DECLARE_WARNING, DECLARE_ERROR, DECLARE_SOFT, DECLARE_PRECEDENCE, CODE, ERROR, DECLARE_ANNOTATION_AT_CONSTRUCTOR,
- DECLARE_ANNOTATION_AT_FIELD, DECLARE_ANNOTATION_AT_METHOD, DECLARE_ANNOTATION_AT_TYPE, SOURCE_FOLDER, PACKAGE_DECLARATION
+ DECLARE_ANNOTATION_AT_FIELD, DECLARE_ANNOTATION_AT_METHOD, DECLARE_ANNOTATION_AT_TYPE, SOURCE_FOLDER,
+ PACKAGE_DECLARATION
};
@@ -367,6 +370,7 @@ public interface IProgramElement extends Serializable {
public boolean isSourceFile() {
return this == FILE_ASPECTJ || this == FILE_JAVA;
}
+
public boolean isFile() {
return this == FILE;
}
diff --git a/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java b/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java
index c822fbf48..92a1d2879 100644
--- a/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java
+++ b/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java
@@ -128,12 +128,21 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
if (ipe.getParameterSignatures() == null || ipe.getParameterSignatures().isEmpty()) {
return "";
}
- StringBuffer sb = new StringBuffer();
+ List sourceRefs = ipe.getParameterSignaturesSourceRefs();
List parameterTypes = ipe.getParameterSignatures();
- for (Iterator iter = parameterTypes.iterator(); iter.hasNext();) {
- char[] element = (char[]) iter.next();
- sb.append(HandleProviderDelimiter.getDelimiter(ipe));
- sb.append(NameConvertor.createShortName(element, false, false));
+ StringBuffer sb = new StringBuffer();
+ if (sourceRefs != null) {
+ for (int i = 0; i < sourceRefs.size(); i++) {
+ String sourceRef = (String) sourceRefs.get(i);
+ sb.append(HandleProviderDelimiter.getDelimiter(ipe));
+ sb.append(sourceRef);
+ }
+ } else {
+ for (Iterator iter = parameterTypes.iterator(); iter.hasNext();) {
+ char[] element = (char[]) iter.next();
+ sb.append(HandleProviderDelimiter.getDelimiter(ipe));
+ sb.append(NameConvertor.createShortName(element, false, false));
+ }
}
return sb.toString();
}
diff --git a/asm/src/org/aspectj/asm/internal/ProgramElement.java b/asm/src/org/aspectj/asm/internal/ProgramElement.java
index 8d3f74044..4c6bcd37b 100644
--- a/asm/src/org/aspectj/asm/internal/ProgramElement.java
+++ b/asm/src/org/aspectj/asm/internal/ProgramElement.java
@@ -594,13 +594,28 @@ public class ProgramElement implements IProgramElement {
return parameters;
}
- public void setParameterSignatures(List list) {
- if (kvpairs == Collections.EMPTY_MAP)
+ public List getParameterSignaturesSourceRefs() {
+ List parameters = (List) kvpairs.get("parameterSigsSourceRefs");
+ return parameters;
+ }
+
+ /**
+ * Set the parameter signatures for this method/constructor. The bit flags tell us if any were not singletypereferences in the
+ * the source. A singletypereference would be 'String' - whilst a qualifiedtypereference would be 'java.lang.String' - this has
+ * an effect on the handles.
+ */
+ public void setParameterSignatures(List list, List sourceRefs) {
+ if (kvpairs == Collections.EMPTY_MAP) {
kvpairs = new HashMap();
- if (list == null || list.size() == 0)
+ }
+ if (list == null || list.size() == 0) {
kvpairs.put("parameterSigs", Collections.EMPTY_LIST);
- else
+ } else {
kvpairs.put("parameterSigs", list);
+ }
+ if (sourceRefs != null && sourceRefs.size() != 0) {
+ kvpairs.put("parameterSigsSourceRefs", sourceRefs);
+ }
}
public String getDetails() {