aboutsummaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
Diffstat (limited to 'asm')
-rw-r--r--asm/.classpath13
-rw-r--r--asm/src/org/aspectj/asm/AsmManager.java3
-rw-r--r--asm/src/org/aspectj/asm/IHierarchy.java3
-rw-r--r--asm/src/org/aspectj/asm/INameConvertor.java17
-rw-r--r--asm/src/org/aspectj/asm/IProgramElement.java7
-rw-r--r--asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java9
-rw-r--r--asm/src/org/aspectj/asm/internal/ProgramElement.java50
7 files changed, 80 insertions, 22 deletions
diff --git a/asm/.classpath b/asm/.classpath
index 5781c41ae..a96910321 100644
--- a/asm/.classpath
+++ b/asm/.classpath
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="testsrc"/>
- <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
- <classpathentry kind="src" path="/bridge"/>
- <classpathentry kind="lib" path="/lib/junit/junit.jar" sourcepath="/lib/junit/junit-src.jar"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="testsrc"/>
+ <classpathentry sourcepath="JRE_SRC" kind="var" path="JRE_LIB"/>
+ <classpathentry kind="src" path="/bridge"/>
+ <classpathentry sourcepath="/lib/junit/junit-src.jar" kind="lib" path="/lib/junit/junit.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/util"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/asm/src/org/aspectj/asm/AsmManager.java b/asm/src/org/aspectj/asm/AsmManager.java
index e9b8c4bc1..f7d0c677e 100644
--- a/asm/src/org/aspectj/asm/AsmManager.java
+++ b/asm/src/org/aspectj/asm/AsmManager.java
@@ -77,8 +77,9 @@ public class AsmManager {
handleProvider = new OptimizedFullPathHandleProvider();
}
- public void createNewASM() {
+ public void createNewASM(INameConvertor convertor) {
hierarchy = new AspectJElementHierarchy();
+ hierarchy.setNameConvertor(convertor);
mapper = new RelationshipMap(hierarchy);
}
diff --git a/asm/src/org/aspectj/asm/IHierarchy.java b/asm/src/org/aspectj/asm/IHierarchy.java
index d458da338..82428481b 100644
--- a/asm/src/org/aspectj/asm/IHierarchy.java
+++ b/asm/src/org/aspectj/asm/IHierarchy.java
@@ -102,4 +102,7 @@ public interface IHierarchy extends Serializable {
public void flushHandleMap();
public void updateHandleMap(Set deletedFiles);
+
+ public void setNameConvertor(INameConvertor convertor);
+ public INameConvertor getNameConvertor();
} \ No newline at end of file
diff --git a/asm/src/org/aspectj/asm/INameConvertor.java b/asm/src/org/aspectj/asm/INameConvertor.java
new file mode 100644
index 000000000..58197bbf7
--- /dev/null
+++ b/asm/src/org/aspectj/asm/INameConvertor.java
@@ -0,0 +1,17 @@
+/********************************************************************
+ * Copyright (c) 2006 Contributors. All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ * Helen Hawkins - initial version
+ *******************************************************************/
+package org.aspectj.asm;
+
+public interface INameConvertor {
+
+ public char[] convertName(char[] name);
+
+}
diff --git a/asm/src/org/aspectj/asm/IProgramElement.java b/asm/src/org/aspectj/asm/IProgramElement.java
index d0024aac8..f88c2dbba 100644
--- a/asm/src/org/aspectj/asm/IProgramElement.java
+++ b/asm/src/org/aspectj/asm/IProgramElement.java
@@ -116,12 +116,13 @@ public interface IProgramElement extends Serializable {
public String toLabelString();
public String toLabelString(boolean getFullyQualifiedArgTypes);
- public List getParameterTypes();
- public void setParameterTypes(List list);
-
public List getParameterNames();
public void setParameterNames(List list);
+ public List getParameterSignatures();
+ public void setParameterSignatures(List list);
+ public List getParameterTypes();
+
/**
* The format of the string handle is not specified, but is stable across
* compilation sessions.
diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
index 42c60a203..62a1a31a8 100644
--- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
+++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
@@ -29,6 +29,7 @@ public class AspectJElementHierarchy implements IHierarchy {
protected IProgramElement root = null;
protected String configFile = null;
+ private transient INameConvertor convertor = null;
private Map fileMap = null;
private Map handleMap = null;
@@ -449,5 +450,13 @@ public class AspectJElementHierarchy implements IHierarchy {
return hid.substring(0,hid.indexOf("|"));
}
+ public void setNameConvertor(INameConvertor convertor) {
+ this.convertor = convertor;
+ }
+
+ public INameConvertor getNameConvertor() {
+ return convertor;
+ }
+
}
diff --git a/asm/src/org/aspectj/asm/internal/ProgramElement.java b/asm/src/org/aspectj/asm/internal/ProgramElement.java
index 35b6a60be..0e8826fc1 100644
--- a/asm/src/org/aspectj/asm/internal/ProgramElement.java
+++ b/asm/src/org/aspectj/asm/internal/ProgramElement.java
@@ -22,9 +22,11 @@ import java.util.Map;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.HierarchyWalker;
+import org.aspectj.asm.INameConvertor;
import org.aspectj.asm.IProgramElement;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.ISourceLocation;
+import org.aspectj.util.CharOperation;
/**
@@ -408,16 +410,22 @@ public class ProgramElement implements IProgramElement {
sb.append(name);
List ptypes = getParameterTypes();
- if (ptypes != null) {
+ if (ptypes != null && (!ptypes.isEmpty()
+ || this.kind.equals(IProgramElement.Kind.METHOD))
+ || this.kind.equals(IProgramElement.Kind.CONSTRUCTOR)
+ || this.kind.equals(IProgramElement.Kind.ADVICE)
+ || this.kind.equals(IProgramElement.Kind.POINTCUT)
+ || this.kind.equals(IProgramElement.Kind.INTER_TYPE_METHOD)
+ || this.kind.equals(IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR)) {
sb.append('(');
for (Iterator it = ptypes.iterator(); it.hasNext(); ) {
- String arg = (String)it.next();
+ char[] arg = (char[])it.next();
if (getFullyQualifiedArgTypes) {
sb.append(arg);
} else {
- int index = arg.lastIndexOf(".");
+ int index = CharOperation.lastIndexOf('.',arg);
if (index != -1) {
- sb.append(arg.substring(index + 1));
+ sb.append(CharOperation.subarray(arg,index+1,arg.length));
} else {
sb.append(arg);
}
@@ -503,17 +511,35 @@ public class ProgramElement implements IProgramElement {
//parameterNames = list;
}
- public List getParameterTypes() {
- List parameterTypes = (List)kvpairs.get("parameterTypes");
- return parameterTypes;
+ public List getParameterTypes() {
+ List l = getParameterSignatures();
+ if (l == null || l.isEmpty()) {
+ return Collections.EMPTY_LIST;
+ }
+ List params = new ArrayList();
+ for (Iterator iter = l.iterator(); iter.hasNext();) {
+ char[] param = (char[])iter.next();
+ INameConvertor convertor = AsmManager.getDefault().getHierarchy().getNameConvertor();
+ if (convertor != null) {
+ params.add(convertor.convertName(param));
+ } else {
+ params.add(param);
+ }
+ }
+ return params;
}
- public void setParameterTypes(List list) {
- if (kvpairs==Collections.EMPTY_MAP) kvpairs = new HashMap();
- if (list==null || list.size()==0) kvpairs.put("parameterTypes",Collections.EMPTY_LIST);
- else kvpairs.put("parameterTypes",list);
-// parameterTypes = list;
+
+ public List getParameterSignatures() {
+ List parameters = (List)kvpairs.get("parameterSigs");
+ return parameters;
}
+ public void setParameterSignatures(List list) {
+ if (kvpairs==Collections.EMPTY_MAP) kvpairs = new HashMap();
+ if (list==null || list.size()==0) kvpairs.put("parameterSigs",Collections.EMPTY_LIST);
+ else kvpairs.put("parameterSigs",list);
+ }
+
public String getDetails() {
String details = (String)kvpairs.get("details");
return details;