aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/src
diff options
context:
space:
mode:
authoraclement <aclement>2006-06-06 08:38:28 +0000
committeraclement <aclement>2006-06-06 08:38:28 +0000
commit5e74f35fa0ac6002b0a291259b88c1b0017fbf40 (patch)
tree4058bc2e6745d73742c7faeea0d0130addf04879 /org.aspectj.ajdt.core/src
parentd1dbf827ea64012890fd2de97d684722f81f3226 (diff)
downloadaspectj-5e74f35fa0ac6002b0a291259b88c1b0017fbf40.tar.gz
aspectj-5e74f35fa0ac6002b0a291259b88c1b0017fbf40.zip
some code for 141730 - store type signatures in program elements rather than processed type names.
Diffstat (limited to 'org.aspectj.ajdt.core/src')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java15
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java51
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java2
3 files changed, 39 insertions, 29 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
index d2b09def2..ac3f04b53 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
@@ -49,6 +49,7 @@ import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IHierarchy;
+import org.aspectj.asm.INameConvertor;
import org.aspectj.asm.IProgramElement;
import org.aspectj.asm.internal.ProgramElement;
import org.aspectj.bridge.AbortException;
@@ -83,6 +84,8 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.problem.DefaultProblemFacto
import org.aspectj.util.FileUtil;
import org.aspectj.weaver.Dump;
import org.aspectj.weaver.ResolvedType;
+import org.aspectj.weaver.TypeFactory;
+import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.World;
import org.aspectj.weaver.bcel.BcelWeaver;
import org.aspectj.weaver.bcel.BcelWorld;
@@ -631,7 +634,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
AsmManager.setCreatingModel(config.isEmacsSymMode() || config.isGenerateModelMode());
if (!AsmManager.isCreatingModel()) return;
- AsmManager.getDefault().createNewASM();
+ AsmManager.getDefault().createNewASM(new NameConverter());
// AsmManager.getDefault().getRelationshipMap().clear();
IHierarchy model = AsmManager.getDefault().getHierarchy();
String rootLabel = "<root>";
@@ -1276,5 +1279,15 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
}
}
+
+ private class NameConverter implements INameConvertor {
+
+ public char[] convertName(char[] name) {
+ UnresolvedType ut = TypeFactory.createTypeFromSignature(new String(name));
+ ResolvedType rt = getWorld().resolve(ut);
+ return rt.getName().toCharArray();
+ }
+
+ }
}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
index e254a5135..a7265f761 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
@@ -25,7 +25,14 @@ import org.aspectj.ajdt.internal.compiler.ast.InterTypeFieldDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.InterTypeMethodDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
import org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment;
+import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.asm.IProgramElement;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.weaver.AdviceKind;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.UnresolvedType;
@@ -39,13 +46,6 @@ import org.aspectj.weaver.patterns.OrPointcut;
import org.aspectj.weaver.patterns.ReferencePointcut;
import org.aspectj.weaver.patterns.TypePattern;
import org.aspectj.weaver.patterns.TypePatternList;
-import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
/**
* @author Mik Kersten
@@ -296,34 +296,31 @@ public class AsmElementFormatter {
Argument[] argArray = md.arguments;
if (argArray == null) {
pe.setParameterNames(Collections.EMPTY_LIST);
- pe.setParameterTypes(Collections.EMPTY_LIST);
+ pe.setParameterSignatures(Collections.EMPTY_LIST);
} else {
List names = new ArrayList();
- List types = new ArrayList();
-
+ List paramSigs = new ArrayList();
for (int i = 0; i < argArray.length; i++) {
String argName = new String(argArray[i].name);
- String argType = "<UnknownType>"; // pr135052
- TypeReference typeR = argArray[i].type;
- if (typeR!=null) {
- TypeBinding typeB = typeR.resolvedType;
- if (typeB==null) {
- if (typeR.getTypeName()!=null)
- argType = CharOperation.toString(typeR.getTypeName());
- } else {
- argType = typeB.debugName();
+ //String argType = "<UnknownType>"; // pr135052
+ if (acceptArgument(argName, argArray[i].type.toString())) {
+ TypeReference typeR = argArray[i].type;
+ if (typeR!=null) {
+ TypeBinding typeB = typeR.resolvedType;
+ if (typeB==null) {
+ typeB = typeR.resolveType(md.scope);
+ }
+ EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(md.scope);
+ UnresolvedType ut = factory.fromBinding(typeB);
+ paramSigs.add(ut.getSignature().toCharArray());
}
- }
-
-
-// String argType = argArray[i].type.resolvedType.debugName();
- if (acceptArgument(argName, argArray[i].type.toString())) {
names.add(argName);
- types.add(argType);
- }
+ }
}
pe.setParameterNames(names);
- pe.setParameterTypes(types);
+ if (!paramSigs.isEmpty()) {
+ pe.setParameterSignatures(paramSigs);
+ }
}
}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
index b9f2c9662..4522a8b33 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
@@ -52,7 +52,7 @@ public class IncrementalStateManager {
element.wipeAllKnowledge();
}
incrementalStates.clear();
- AsmManager.getDefault().createNewASM(); // forget what you know...
+ AsmManager.getDefault().createNewASM(null); // forget what you know...
}
public static Set getConfigFilesKnown() {